Python implementation of Tarjan's strongly connected components algorith,