Class: Yargraph::UndirectedGraph::EdgeSearchResult

Inherits:
Object
  • Object
show all
Defined in:
lib/yargraph.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEdgeSearchResult

Returns a new instance of EdgeSearchResult.



424
425
426
427
# File 'lib/yargraph.rb', line 424

def initialize
  @edges_in_all = EdgeSet.new
  @edges_in_none = EdgeSet.new
end

Instance Attribute Details

#contains_hamcycleObject

True, false, or dunno (nil), does the graph contain one or more Hamiltonian cycles?



422
423
424
# File 'lib/yargraph.rb', line 422

def contains_hamcycle
  @contains_hamcycle
end

#edges_in_allObject

EdgeSets of edges that are contained in, or not contained in all Hamiltonian cycles.



419
420
421
# File 'lib/yargraph.rb', line 419

def edges_in_all
  @edges_in_all
end

#edges_in_noneObject

EdgeSets of edges that are contained in, or not contained in all Hamiltonian cycles.



419
420
421
# File 'lib/yargraph.rb', line 419

def edges_in_none
  @edges_in_none
end

Instance Method Details

#hamiltonian_neighbours(vertex) ⇒ Object

Return an Set of neighbours that must be next or previous in a hamiltonian cycle (& path?)



430
431
432
# File 'lib/yargraph.rb', line 430

def hamiltonian_neighbours(vertex)
  @edges_in_all[vertex]
end