MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / kosaraju

Function kosaraju

graphs/scc_kosaraju.py:24–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

22
23
24def kosaraju():
25 global graph, reversed_graph, scc, component, visit, stack
26 for i in range(n):
27 dfs(i)
28 visit = [False] * n
29 for i in stack[::-1]:
30 if visit[i]:
31 continue
32 component = []
33 dfs2(i)
34 scc.append(component)
35 return scc
36
37
38if __name__ == "__main__":

Callers 1

scc_kosaraju.pyFile · 0.85

Calls 3

dfs2Function · 0.85
dfsFunction · 0.70
appendMethod · 0.45

Tested by

no test coverage detected