Description |
Python implementation of Tarjan's algorithm Tarjan's algorithm takes as input a
directed (possibly cyclic!) graph and returns as output its strongly connected
components in a topological order.Example.. code:: >>>
tarjan({1:[2],2:[1,5],3:[4],4:[3,5],5:[6],6:[7],7:[8],8:[6,9],9:[]}) [[9], [8,
7, 6], [5], [2, 1], [4, 3]]Uses Cyclic dependencies In various cases,
dependencies might be cyclic and...
|