Re: A question about Dijkstra's algorithm

From: A. G. McDowell (mcdowella_at_nospam.uk)
Date: 01/19/04


Date: Mon, 19 Jan 2004 06:11:06 +0000

In article <d5fb3df3.0401180930.72d789dc@posting.google.com>, Bilal
Sallakh <afkar@mail2world.com> writes
>Given a directed acyclic graph with all edges have negative weights.
>
>Can we modify dijkstra's shortest path algorithm to find the shortest
>path in such a
>
>graph?
>
>That is equivilant to:
>Can we modify dijkstra's shortest path algorithm to find the longest
>path in a direct
>
>acyclic graph with all edges have positive weights?
>
>I know that in both cases a linear algorithm suffices where we "relax"
>the edges of
>
>the vertices taken into topological order -The so called Bellman
>Algorithm. But I'm
>
>discussing Dijkstra's.
>
>
>Also I expect that no modification can be found.
>
>But our instructor insists that some modifications can make dijkstra's
>algoirthm work.
>
>He claims that he read that in an old reference.
>
>
>Regards.
The Algorithm Design Manual, by Skiena, claims (section 8.4) "If your
graph has edges with negative weights, you must use the more general but
less efficient Bellman-Ford algorithm" (see e.g. the massive MIT book -
if there are no -ve cycles this returns shortest path info otherwise it
tells you which nodes have -ve cycles through them).

-- 
A. G. McDowell


Relevant Pages

  • A question about Dijkstras algorithm
    ... Given a directed acyclic graph with all edges have negative weights. ... Can we modify dijkstra's shortest path algorithm to find the shortest ...
    (comp.theory)
  • Re: A question about Dijkstras algorithm
    ... > Can we modify dijkstra's shortest path algorithm to find the shortest ... > path in a direct acyclic graph with all edges have positive weights? ... In fact, findind the longest path in a graph is an NP-Complete problem, ...
    (comp.theory)
  • Re: Whats up with Oblivion? [Spoilers alert]
    ... used the shortest path algorithm without any mods. ... That's nuts. ... A basic technique for searching nodes is to use recursion. ...
    (comp.sys.ibm.pc.games.rpg)
  • Re: Whats up with Oblivion? [Spoilers alert]
    ... used the shortest path algorithm without any mods. ... That's nuts. ... I agree with your specific criticism that characters waltzing ...
    (comp.sys.ibm.pc.games.rpg)
  • Re: Whats up with Oblivion? [Spoilers alert]
    ... used the shortest path algorithm without any mods. ... That's nuts. ... Remember that the game is segmented into cells, ...
    (comp.sys.ibm.pc.games.rpg)