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.



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

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?



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

def contains_hamcycle
  @contains_hamcycle
end

#edges_in_allObject

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



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

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.



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

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



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

def hamiltonian_neighbours(vertex)
  @edges_in_all[vertex]
end