Class Connectivity
- Namespace
- AlgorithmsSW.Graph
- Assembly
- AlgorithmsSW.dll
A class for querying connectivity properties of a graph.
public class Connectivity
- Inheritance
-
Connectivity
- Inherited Members
- Extension Methods
Constructors
Connectivity(IReadOnlyGraph)
Initializes a new instance of the Connectivity class from the given graph.
public Connectivity(IReadOnlyGraph graph)
Parameters
graph
IReadOnlyGraphThe graph to analyze.
Properties
ComponentCount
Gets the total number of connected components in the graph.
public int ComponentCount { get; }
Property Value
IsConnected
Gets a value indicating whether the entire graph is connected as a single component.
public bool IsConnected { get; }
Property Value
Methods
AreConnected(int, int)
Determines if two vertices are connected.
public bool AreConnected(int vertex0, int vertex1)
Parameters
Returns
GetComponentIndex(int)
public int GetComponentIndex(int vertex)
Parameters
vertex
int
Returns
GetShortestPathBetween(int, int)
Gets the shortest path between two vertices.
public IEnumerable<int> GetShortestPathBetween(int vertex0, int vertex1)
Parameters
Returns
- IEnumerable<int>
An enumerable of integers representing the shortest path.