Class: Yargraph::UndirectedGraph::EdgeSearchResult
- Inherits:
-
Object
- Object
- Yargraph::UndirectedGraph::EdgeSearchResult
- Defined in:
- lib/yargraph.rb
Instance Attribute Summary collapse
-
#contains_hamcycle ⇒ Object
True, false, or dunno (nil), does the graph contain one or more Hamiltonian cycles?.
-
#edges_in_all ⇒ Object
EdgeSets of edges that are contained in, or not contained in all Hamiltonian cycles.
-
#edges_in_none ⇒ Object
EdgeSets of edges that are contained in, or not contained in all Hamiltonian cycles.
Instance Method Summary collapse
-
#hamiltonian_neighbours(vertex) ⇒ Object
Return an Set of neighbours that must be next or previous in a hamiltonian cycle (& path?).
-
#initialize ⇒ EdgeSearchResult
constructor
A new instance of EdgeSearchResult.
Constructor Details
#initialize ⇒ EdgeSearchResult
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_hamcycle ⇒ Object
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_all ⇒ Object
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_none ⇒ Object
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 |