Class IsHamiltonianGraphAlgorithm<TVertex, TEdge>
Algorithm that checks if a graph is Hamiltonian (has a path that links all vertices and pass one and only one time by each vertex).
Inheritance
System.Object
IsHamiltonianGraphAlgorithm<TVertex, TEdge>
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: QuikGraph.Algorithms
Assembly: QuikGraph.dll
Syntax
public class IsHamiltonianGraphAlgorithm<TVertex, TEdge>
where TEdge : IUndirectedEdge<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Constructors
| Improve this Doc View SourceIsHamiltonianGraphAlgorithm(IUndirectedGraph<TVertex, TEdge>)
Initializes a new instance of the IsHamiltonianGraphAlgorithm<TVertex, TEdge> class.
Declaration
public IsHamiltonianGraphAlgorithm(IUndirectedGraph<TVertex, TEdge> graph)
Parameters
Type | Name | Description |
---|---|---|
IUndirectedGraph<TVertex, TEdge> | graph | Graph to check. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Methods
| Improve this Doc View SourceGetPermutations()
Gets vertices permutations.
Declaration
public List<List<TVertex>> GetPermutations()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<System.Collections.Generic.List<TVertex>> | List of permutations. |
IsHamiltonian()
Returns true if the graph is Hamiltonian, otherwise false.
Declaration
public bool IsHamiltonian()
Returns
Type | Description |
---|---|
System.Boolean | True if the graph is Hamiltonian, false otherwise. |