Skip to content

@graphty/algorithms / index / numberOfConnectedComponents

Function: numberOfConnectedComponents() ​

numberOfConnectedComponents(graph): number

Defined in: algorithms/components/connected.ts:87

Find the number of connected components

Parameters ​

graph ​

Graph

The input graph (must be undirected)

Returns ​

number

The number of connected components in the graph