Class IncrementalConnectedComponentsAlgorithm<TVertex, TEdge>
Algorithm that incrementally computes connected components of a growing graph.
Inheritance
System.Object
AlgorithmBase<IMutableVertexAndEdgeSet<TVertex, TEdge>>
IncrementalConnectedComponentsAlgorithm<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.ConnectedComponents
Assembly: QuikGraph.dll
Syntax
public sealed class IncrementalConnectedComponentsAlgorithm<TVertex, TEdge> : AlgorithmBase<IMutableVertexAndEdgeSet<TVertex, TEdge>>, IAlgorithm<IMutableVertexAndEdgeSet<TVertex, TEdge>>, IComputation, IAlgorithmComponent, IDisposable where TEdge : IEdge<TVertex>
Type Parameters
Name | Description |
---|---|
TVertex | Vertex type. |
TEdge | Edge type. |
Constructors
| Improve this Doc View SourceIncrementalConnectedComponentsAlgorithm(IAlgorithmComponent, IMutableVertexAndEdgeSet<TVertex, TEdge>)
Initializes a new instance of the IncrementalConnectedComponentsAlgorithm<TVertex, TEdge> class.
Declaration
public IncrementalConnectedComponentsAlgorithm(IAlgorithmComponent host, IMutableVertexAndEdgeSet<TVertex, TEdge> visitedGraph)
Parameters
Type | Name | Description |
---|---|---|
IAlgorithmComponent | host | Host to use if set, otherwise use this reference. |
IMutableVertexAndEdgeSet<TVertex, TEdge> | visitedGraph | Graph to visit. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
IncrementalConnectedComponentsAlgorithm(IMutableVertexAndEdgeSet<TVertex, TEdge>)
Initializes a new instance of the IncrementalConnectedComponentsAlgorithm<TVertex, TEdge> class.
Declaration
public IncrementalConnectedComponentsAlgorithm(IMutableVertexAndEdgeSet<TVertex, TEdge> visitedGraph)
Parameters
Type | Name | Description |
---|---|---|
IMutableVertexAndEdgeSet<TVertex, TEdge> | visitedGraph | Graph to visit. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
Properties
| Improve this Doc View SourceComponentCount
Number of components.
Declaration
public int ComponentCount { get; }
Property Value
Type | Description |
---|---|
System.Int32 |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The algorithm has not been run. |
Methods
| Improve this Doc View SourceDispose()
Declaration
public void Dispose()
GetComponents()
Gets a copy of the connected components. Key is the number of components, Value contains the vertex -> component index map.
Declaration
public KeyValuePair<int, IDictionary<TVertex, int>> GetComponents()
Returns
Type | Description |
---|---|
System.Collections.Generic.KeyValuePair<System.Int32, System.Collections.Generic.IDictionary<TVertex, System.Int32>> | Number of components associated to components vertex mapping. |
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | The algorithm has not been run. |
InternalCompute()
Algorithm compute step.
Declaration
protected override void InternalCompute()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IMutableVertexAndEdgeSet<TVertex, TEdge>>.InternalCompute()
Implements
System.IDisposable