Advertisement
tinyevil

Untitled

Mar 29th, 2018
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. 1. Convert to the DAG by merging together nodes in the same strongly connected component in a supernode.
  2. 2. If there are two or more leaf supernodes, output any one node from two different leaf supernodes.
  3. 3. Otherwise, remove the leaf supernode from the graph and repeat (2)
  4. 4. Otherwise, there is no such pair.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement