Skip to content

@graphty/algorithms / index / stronglyConnectedComponents

Function: stronglyConnectedComponents() ​

stronglyConnectedComponents(g, options?): LabelResult

Defined in: indexed/scc.ts:36

Strongly connected components by an iterative Tarjan: roots in index order, neighbours in row order unless options.arcOrder gives another, and component c is the c-th to complete -- the numbering the legacy stronglyConnectedComponents gives its result array. Completion order is a reverse topological order of the condensation.

Parameters ​

g ​

AdjacencyView

A directed adjacency

options? ​

ArcOrderOption = {}

The neighbour order

Returns ​

LabelResult

The partition, labels in completion order

Throws ​

Error when the graph is undirected