Show / Hide Table of Contents

Class WeaklyConnectedComponentsAlgorithm<TVertex, TEdge>

Algorithm that computes weakly connected components of a graph.

Inheritance
System.Object
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>
WeaklyConnectedComponentsAlgorithm<TVertex, TEdge>
Implements
IAlgorithmComponent
IConnectedComponentAlgorithm<TVertex, TEdge, IVertexListGraph<TVertex, TEdge>>
IAlgorithm<IVertexListGraph<TVertex, TEdge>>
IComputation
Inherited Members
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.SyncRoot
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.State
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Compute()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Abort()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.StateChanged
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.OnStateChanged(EventArgs)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Started
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.OnStarted(EventArgs)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Finished
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.OnFinished(EventArgs)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Aborted
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.OnAborted(EventArgs)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.VisitedGraph
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Services
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.GetService<T>()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.TryGetService<T>(T)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.TryGetService(Type, Object)
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.ThrowIfCancellationRequested()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.Initialize()
AlgorithmBase<IVertexListGraph<TVertex, TEdge>>.InternalCompute()
AlgorithmBase<IVertexListGraph<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 WeaklyConnectedComponentsAlgorithm<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 weakly connected component is a maximal sub graph of a graph such that for every pair of vertices (u,v) in the sub graph, there is an undirected path from u to v and a directed path from v to u.

Constructors

| Improve this Doc View Source

WeaklyConnectedComponentsAlgorithm(IAlgorithmComponent, IVertexListGraph<TVertex, TEdge>, IDictionary<TVertex, Int32>)

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

Declaration
public WeaklyConnectedComponentsAlgorithm(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

visitedGraph is null.

System.ArgumentNullException

components is null.

| Improve this Doc View Source

WeaklyConnectedComponentsAlgorithm(IVertexListGraph<TVertex, TEdge>)

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

Declaration
public WeaklyConnectedComponentsAlgorithm(IVertexListGraph<TVertex, TEdge> visitedGraph)
Parameters
Type Name Description
IVertexListGraph<TVertex, TEdge> visitedGraph

Graph to visit.

Exceptions
Type Condition
System.ArgumentNullException

visitedGraph is null.

| Improve this Doc View Source

WeaklyConnectedComponentsAlgorithm(IVertexListGraph<TVertex, TEdge>, IDictionary<TVertex, Int32>)

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

Declaration
public WeaklyConnectedComponentsAlgorithm(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

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>
| Improve this Doc View Source

Graphs

Weakly connected components.

Declaration
public BidirectionalGraph<TVertex, TEdge>[] Graphs { get; }
Property Value
Type Description
BidirectionalGraph<TVertex, TEdge>[]

Methods

| Improve this Doc View Source

Clean()

Called on algorithm cleanup step.

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

Initialize()

Called on algorithm initialization step.

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

InternalCompute()

Algorithm compute step.

Declaration
protected override void InternalCompute()
Overrides
QuikGraph.Algorithms.AlgorithmBase<QuikGraph.IVertexListGraph<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