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.
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_hamcycle ⇒ Object
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_all ⇒ Object
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_none ⇒ Object
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 |