Graph Theory37 sections · 1633 units
Open in Course

Space Complexity Summary

(Memory usage)

Space complexity for SCC algorithms is O(V+E)O(V + E). Kosaraju: Visited array (O(V)O(V)), finish time stack (O(V)O(V)), transpose adjacency list (O(E)O(E)), and second visited array (O(V)O(V)). Total: O(V+E)O(V + E). Tarjan: Arrays for discdisc, lowlow, on_stackon\_stack (each O(V)O(V)), stack for current path (O(V)O(V)), and adjacency list (O(E)O(E)).

Total: O(V+E)O(V + E). Condensation graph: Worst case O(E)O(E) edges if no edges collapse (e.g., DAG with no SCCs of size >1> 1).