Class DirectedCycle
- Namespace
- AlgorithmsSW.Digraph
- Assembly
- AlgorithmsSW.dll
Provides an algorithm for finding a directed cycle in a digraph== if one exists.
public class DirectedCycle
- Inheritance
-
DirectedCycle
- Inherited Members
- Extension Methods
Constructors
DirectedCycle(IReadOnlyDigraph)
Initializes a new instance of the DirectedCycle class.
public DirectedCycle(IReadOnlyDigraph digraph)
Parameters
digraph
IReadOnlyDigraphThe graph to find a cycle in.
Properties
HasCycle
Gets a value indicating whether the graph has a directed cycle.
public bool HasCycle { get; }
Property Value
Methods
Cycle()
Returns the vertices in a directed cycle, if one exists.
public IEnumerable<int> Cycle()
Returns
Exceptions
- InvalidOperationException
No cycle has been found.