7 lines
378 B
Text
7 lines
378 B
Text
// graph from https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm
|
|
// with vertices id zero based (vs 1 based in article)
|
|
// ids start at zero and are consecutive (no holes), graph is unsorted
|
|
graph:= // ( (id, links/Edges), ...)
|
|
T( T(0,1), T(2,0), T(5,2,6), T(6,5),
|
|
T(1,2), T(3,1,2,4), T(4,5,3), T(7,4,7,6) );
|
|
Tarjan(graph);
|