ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

min weight cycle in undirected graph
Posted by Aleksandar Ilic 24 Oct 2004 18:51
Can someone tell me how to find minimal weight cycle in undirected graph in O(n^3). I know for directed graph using modified Floyd, but I spend more than 2 hours on this and nothing (in O (n^4) with deleting every edge and Dijkstra)?

Help me!
Re: min weight cycle in undirected graph
Posted by Alex[LSD] 25 Oct 2004 21:21
I still don't know how to proove my solution.
I will just kinda lead you to the idea I m using.
What do we get after we run Dijkstra? We don't just get shortest paths to every vertex - we get a TREE of shortest paths... When you add an edge to a tree you get what???