Table of Contents

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 IDigraph

A directed graph with no cycles.

Properties

HasHamiltonianPath

Gets a value indicating whether the digraph has a Hamiltonian path.

public bool HasHamiltonianPath { get; }

Property Value

bool

Path

Gets the vertices on a Hamiltonian path in the digraph, if there is one.

public IEnumerable<int> Path { get; }

Property Value

IEnumerable<int>

Exceptions

InvalidOperationException

there is no Hamiltonian cycle.