Advertisement
tinyevil

Untitled

Apr 22nd, 2018
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. Find any simple cycle.
  2.  
  3. Choose two nodes (i,j) in the cycle.
  4. Greedily find the longest path from i to j, not going through remaining nodes in the cycle.
  5. If this path improves the length of the cycle, apply it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement