Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Find any simple cycle.
- Choose two nodes (i,j) in the cycle.
- Greedily find the longest path from i to j, not going through remaining nodes in the cycle.
- If this path improves the length of the cycle, apply it.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement