Table of Contents

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 IDigraph

The graph to find the strong components of.

Properties

ComponentCount

Gets the component id of a given vertex.

public int ComponentCount { get; }

Property Value

int

StronglyConnected

Gets a value indicating whether the graph is strongly connected.

public bool StronglyConnected { get; }

Property Value

bool

Methods

GetComponentIndex(int)

Gets the component ID of a given vertex.

public int GetComponentIndex(int vertex)

Parameters

vertex int

The vertex to get the component ID of.

Returns

int

GetStronglyConnectedComponent(int)

Gets the vertices in a given strongly connected component.

public IEnumerable<int> GetStronglyConnectedComponent(int componentId)

Parameters

componentId int

The component ID to get the vertices of.

Returns

IEnumerable<int>

IsStronglyConnected(int, int)

Gets a value indicating whether two vertices are strongly connected.

public bool IsStronglyConnected(int vertex1, int vertex2)

Parameters

vertex1 int
vertex2 int

Returns

bool

true if the vertices are strongly connected; otherwise, false.