Class HamiltonianPathWithDegrees
- Namespace
- AlgorithmsSW.Digraph
- Assembly
- AlgorithmsSW.dll
Algorithm to find a Hamiltonian cycle in a directed graph.
[ExerciseReference(4, 2, 24)]
public class HamiltonianPathWithDegrees : IHamiltonianPath
- Inheritance
-
HamiltonianPathWithDegrees
- Implements
- Inherited Members
- Extension Methods
Constructors
HamiltonianPathWithDegrees(IDigraph)
Initializes a new instance of the HamiltonianPathWithDegrees class.
public HamiltonianPathWithDegrees(IDigraph digraph)
Parameters
digraph
IDigraphA directed graph with no cycles.
Properties
HasHamiltonianPath
Gets a value indicating whether the digraph has a Hamiltonian path.
public bool HasHamiltonianPath { get; }
Property Value
Path
Gets the vertices on a Hamiltonian path in the digraph, if there is one.
public IEnumerable<int> Path { get; }
Property Value
Exceptions
- InvalidOperationException
there is no Hamiltonian cycle.