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.



449
450
451
452
# File 'lib/yargraph.rb', line 449

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?



447
448
449
# File 'lib/yargraph.rb', line 447

def contains_hamcycle
  @contains_hamcycle
end

#edges_in_allObject

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



444
445
446
# File 'lib/yargraph.rb', line 444

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.



444
445
446
# File 'lib/yargraph.rb', line 444

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?)



455
456
457
# File 'lib/yargraph.rb', line 455

def hamiltonian_neighbours(vertex)
  @edges_in_all[vertex]
end