Skip to content

Commit 9c1a8d8

Browse files
committed
write about toposort in step 1 (adamant-pwn's suggestion)
1 parent 88eabab commit 9c1a8d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/graph/strongly-connected-components.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Thus, in summary, we discussed the following algorithm to find strongly connecte
6969

7070
The runtime complexity of the algorithm is $O(n + m)$, because depth first search is performed twice. Building the condensation graph is also $O(n+m).$
7171

72-
Finally, it is appropriate to mention [topological sort](topological-sort.md) here. In step 2, the algorithm finds strongly connected components in decreasing order of their exit times. Thus, it finds components - vertices of the condensation graph - in an order corresponding to a topological sort of the condensation graph.
72+
Finally, it is appropriate to mention [topological sort](topological-sort.md) here. In step 1, we find the vertices in the order of increasing exit time. If $G$ is acyclic, this corresponds to a (reversed) topological sort of $G$. In step 2, the algorithm finds strongly connected components in decreasing order of their exit times. Thus, it finds components - vertices of the condensation graph - in an order corresponding to a topological sort of the condensation graph.
7373

7474
## Implementation
7575
```{.cpp file=strongly_connected_components}

0 commit comments

Comments
 (0)