Show / Hide Table of Contents

Class ConnectedComponentsAlgorithm<TVertex, TEdge>

Algorithm that computes connected components of a graph.

Inheritance
System.Object
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>
ConnectedComponentsAlgorithm<TVertex, TEdge>
Implements
IAlgorithmComponent
IConnectedComponentAlgorithm<TVertex, TEdge, IUndirectedGraph<TVertex, TEdge>>
IAlgorithm<IUndirectedGraph<TVertex, TEdge>>
IComputation
Inherited Members
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.SyncRoot
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.State
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Compute()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Abort()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.StateChanged
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.OnStateChanged(EventArgs)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Started
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.OnStarted(EventArgs)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Finished
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.OnFinished(EventArgs)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Aborted
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.OnAborted(EventArgs)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.VisitedGraph
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Services
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.GetService<T>()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.TryGetService<T>(T)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.TryGetService(Type, Object)
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.ThrowIfCancellationRequested()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Initialize()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.InternalCompute()
AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>.Clean()
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 ConnectedComponentsAlgorithm<TVertex, TEdge> : AlgorithmBase<IUndirectedGraph<TVertex, TEdge>>, IAlgorithmComponent, IConnectedComponentAlgorithm<TVertex, TEdge, IUndirectedGraph<TVertex, TEdge>>, IAlgorithm<IUndirectedGraph<TVertex, TEdge>>, IComputation where TEdge : IEdge<TVertex>
Type Parameters
Name Description
TVertex

Vertex type.

TEdge

Edge type.

Constructors

| Improve this Doc View Source

ConnectedComponentsAlgorithm(IAlgorithmComponent, IUndirectedGraph<TVertex, TEdge>, IDictionary<TVertex, Int32>)

Initializes a new instance of the ConnectedComponentsAlgorithm<TVertex, TEdge> class.

Declaration
public ConnectedComponentsAlgorithm(IAlgorithmComponent host, IUndirectedGraph<TVertex, TEdge> visitedGraph, IDictionary<TVertex, int> components)
Parameters
Type Name Description
IAlgorithmComponent host

Host to use if set, otherwise use this reference.

IUndirectedGraph<TVertex, TEdge> visitedGraph

Graph to visit.

System.Collections.Generic.IDictionary<TVertex, System.Int32> components

Graph components.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

System.ArgumentNullException

components is null.

| Improve this Doc View Source

ConnectedComponentsAlgorithm(IUndirectedGraph<TVertex, TEdge>)

Initializes a new instance of the ConnectedComponentsAlgorithm<TVertex, TEdge> class.

Declaration
public ConnectedComponentsAlgorithm(IUndirectedGraph<TVertex, TEdge> visitedGraph)
Parameters
Type Name Description
IUndirectedGraph<TVertex, TEdge> visitedGraph

Graph to visit.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

| Improve this Doc View Source

ConnectedComponentsAlgorithm(IUndirectedGraph<TVertex, TEdge>, IDictionary<TVertex, Int32>)

Initializes a new instance of the ConnectedComponentsAlgorithm<TVertex, TEdge> class.

Declaration
public ConnectedComponentsAlgorithm(IUndirectedGraph<TVertex, TEdge> visitedGraph, IDictionary<TVertex, int> components)
Parameters
Type Name Description
IUndirectedGraph<TVertex, TEdge> visitedGraph

Graph to visit.

System.Collections.Generic.IDictionary<TVertex, System.Int32> components

Graph components.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

System.ArgumentNullException

components is null.

Properties

| Improve this Doc View Source

ComponentCount

Number of components.

Declaration
public int ComponentCount { get; }
Property Value
Type Description
System.Int32
| Improve this Doc View Source

Components

Graph components.

Declaration
public IDictionary<TVertex, int> Components { get; }
Property Value
Type Description
System.Collections.Generic.IDictionary<TVertex, System.Int32>

Methods

| Improve this Doc View Source

Initialize()

Called on algorithm initialization step.

Declaration
protected override void Initialize()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IUndirectedGraph<TVertex, TEdge>>.Initialize()
| Improve this Doc View Source

InternalCompute()

Algorithm compute step.

Declaration
protected override void InternalCompute()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IUndirectedGraph<TVertex, TEdge>>.InternalCompute()

Implements

IAlgorithmComponent
IConnectedComponentAlgorithm<TVertex, TEdge, TGraph>
IAlgorithm<TGraph>
IComputation

Extension Methods

GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, String, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter)
GraphMLExtensions.SerializeToGraphML<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, XmlReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeFromGraphML<TVertex, TEdge, TGraph>(TGraph, String, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
GraphMLExtensions.DeserializeAndValidateFromGraphML<TVertex, TEdge, TGraph>(TGraph, TextReader, IdentifiableVertexFactory<TVertex>, IdentifiableEdgeFactory<TVertex, TEdge>)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String)
SerializationExtensions.SerializeToXml<TVertex, TEdge, TGraph>(TGraph, XmlWriter, VertexIdentity<TVertex>, EdgeIdentity<TVertex, TEdge>, String, String, String, String, Action<XmlWriter, TGraph>, Action<XmlWriter, TVertex>, Action<XmlWriter, TEdge>)
  • Improve this Doc
  • View Source
In This Article
Back to top QuikGraph