Class StrongComponents
- Namespace
- AlgorithmsSW.Digraph
- Assembly
- AlgorithmsSW.dll
An algorithm that finds the strong components of a directed graph.
[ExerciseReference(4, 2, 23)]
public class StrongComponents
- Inheritance
-
StrongComponents
- Inherited Members
- Extension Methods
Constructors
StrongComponents(IDigraph)
Initializes a new instance of the StrongComponents class.
public StrongComponents(IDigraph digraph)
Parameters
digraph
IDigraphThe graph to find the strong components of.
Properties
ComponentCount
Gets the component id of a given vertex.
public int ComponentCount { get; }
Property Value
StronglyConnected
Gets a value indicating whether the graph is strongly connected.
public bool StronglyConnected { get; }
Property Value
Methods
GetComponentIndex(int)
Gets the component ID of a given vertex.
public int GetComponentIndex(int vertex)
Parameters
vertex
intThe vertex to get the component ID of.
Returns
GetStronglyConnectedComponent(int)
Gets the vertices in a given strongly connected component.
public IEnumerable<int> GetStronglyConnectedComponent(int componentId)
Parameters
componentId
intThe component ID to get the vertices of.
Returns
IsStronglyConnected(int, int)
Gets a value indicating whether two vertices are strongly connected.
public bool IsStronglyConnected(int vertex1, int vertex2)