Graph.tarjan

Using Tarjan's algorithm, returns a range of strongly connected components (SCCs). Each SCC consists of a list of vertices that are strongly connected. The SCCs are listed in reverse topological order.

Time complexity: O(|v| + |E|)

By filtering for SCCs that consist of more than 1 vertex, we can find and display all the cycles in a graph.

class Graph(A, B, EdgeDataAB = size_t, EdgeDataBA = size_t)
@property
tarjan
()
if (
!is(A == B)
)

Meta