Re: Graph optimization
- From: "Suman" <skarpio@xxxxxxxxx>
- Date: 28 Feb 2006 02:49:50 -0800
Logan Shaw wrote:
[ ... ]
Although Dijkstra's
algorithm is going to be the best for finding the shortest path
between a single pair of points,
with non-negative edge weights. The OP didn't clarify that either.
Bellman-Ford otherwise (though negative weight cycles aren't allowed.)
[ snip more on Dijkstra ]
However, Dijkstra is of O(n^2), and running it for, say, all n nodes
gets the
complexity upto O(n^3), same as Floyd-Warshall, which does just just ;)
IMHO, a bit more elegantly. Caveat: negative edge weights are fine,
but not cycles.
.
- References:
- Graph optimization
- From: amol . panchabhai
- Re: Graph optimization
- From: Thad Smith
- Re: Graph optimization
- From: Logan Shaw
- Graph optimization
- Prev by Date: Anyone interested in being paid to find a solution to a commercial problem?
- Next by Date: Re: Assignmnet problem with rules
- Previous by thread: Re: Graph optimization
- Next by thread: Free Pascal - USB control
- Index(es):