DFS directed graph and Kosaraj algorithm

I find it difficult to understand the Kosaraju algorithm for finding strongly related components of a directed graph. Here is what I have on my notebook (I am a student: D):

  • Start at an arbitrary vertex (name it # 1) and execute DFS. If you cannot continue, name the last vertex visited No. 2 and start another DFS (missing vertices are already marked), etc.
  • Move chart.
  • DFS, starting from each vertex in the reverse order, those vertices that end after each DFS belong to the same SCC.

I have this example:

And after the first step, starting with E, the labels are:

  • E
  • G
  • K
  • J
  • I
  • N
  • F
  • FROM
  • D
  • IN
  • A

, : DFS / ? , ( , ), № 1 E () № 2 G, № 3 J, K. , , , DFS, , E, G ( №2), .

- DFS , ? DFS !

+4
1

. . Wikipedia:

:

  • G - , S - .
  • S :
    • v S. , v. , u, u S.
  • , .
  • S :
    • v S. , v . , v; G S. , (BFS) .

, - , DFS.

, backtracking - , .

, - .

, E, , , F, G, F, H, K, I, J, I, K, H, F , , E, .

+1

Source: https://habr.com/ru/post/1525335/


All Articles