Class StronglyConnectedComponentsAlgorithm<TVertex, TEdge>
Algorithm that computes strongly connected components of a graph.
Inheritance
Implements
Inherited Members
Namespace: QuikGraph.Algorithms.ConnectedComponents
Assembly: QuikGraph.dll
Syntax
public sealed class StronglyConnectedComponentsAlgorithm<TVertex, TEdge> : AlgorithmBase<IVertexListGraph<TVertex, TEdge>>, IAlgorithmComponent, IConnectedComponentAlgorithm<TVertex, TEdge, IVertexListGraph<TVertex, TEdge>>, IAlgorithm<IVertexListGraph<TVertex, TEdge>>, IComputation where TEdge : IEdge<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Remarks
A strongly connected component is a sub graph where there is a path from every vertex to every other vertices.
Constructors
| Improve this Doc View SourceStronglyConnectedComponentsAlgorithm(IAlgorithmComponent, IVertexListGraph<TVertex, TEdge>, IDictionary<TVertex, Int32>)
Initializes a new instance of the StronglyConnectedComponentsAlgorithm<TVertex, TEdge> class.
Declaration
public StronglyConnectedComponentsAlgorithm(IAlgorithmComponent host, IVertexListGraph<TVertex, TEdge> visitedGraph, IDictionary<TVertex, int> components)
Parameters
Type | Name | Description |
---|---|---|
IAlgorithmComponent | host | Host to use if set, otherwise use this reference. |
IVertexListGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
System.Collections.Generic.IDictionary<TVertex, System.Int32> | components | Graph components. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
StronglyConnectedComponentsAlgorithm(IVertexListGraph<TVertex, TEdge>)
Initializes a new instance of the StronglyConnectedComponentsAlgorithm<TVertex, TEdge> class.
Declaration
public StronglyConnectedComponentsAlgorithm(IVertexListGraph<TVertex, TEdge> visitedGraph)
Parameters
Type | Name | Description |
---|---|---|
IVertexListGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
StronglyConnectedComponentsAlgorithm(IVertexListGraph<TVertex, TEdge>, IDictionary<TVertex, Int32>)
Initializes a new instance of the StronglyConnectedComponentsAlgorithm<TVertex, TEdge> class.
Declaration
public StronglyConnectedComponentsAlgorithm(IVertexListGraph<TVertex, TEdge> visitedGraph, IDictionary<TVertex, int> components)
Parameters
Type | Name | Description |
---|---|---|
IVertexListGraph<TVertex, TEdge> | visitedGraph | Graph to visit. |
System.Collections.Generic.IDictionary<TVertex, System.Int32> | components | Graph components. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentNullException |
|
Properties
| Improve this Doc View SourceComponentCount
Number of components.
Declaration
public int ComponentCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Components
Graph components.
Declaration
public IDictionary<TVertex, int> Components { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<TVertex, System.Int32> |
ComponentsPerStep
Number of components discovered per step.
Declaration
public List<int> ComponentsPerStep { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<System.Int32> |
DiscoverTimes
Times of vertices discover.
Declaration
public IDictionary<TVertex, int> DiscoverTimes { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<TVertex, System.Int32> |
Graphs
Strongly connected components.
Declaration
public BidirectionalGraph<TVertex, TEdge>[] Graphs { get; }
Property Value
Type | Description |
---|---|
BidirectionalGraph<TVertex, TEdge>[] |
Roots
Root vertices associated to their minimal linked vertex.
Declaration
public IDictionary<TVertex, TVertex> Roots { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<TVertex, TVertex> |
Steps
Number of steps spent.
Declaration
public int Steps { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
VerticesPerStep
Vertices treated per step.
Declaration
public List<TVertex> VerticesPerStep { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<TVertex> |
Methods
| Improve this Doc View SourceInitialize()
Called on algorithm initialization step.
Declaration
protected override void Initialize()
Overrides
InternalCompute()
Algorithm compute step.
Declaration
protected override void InternalCompute()