Re: shortest path with constraints that some nodes can not be on the same pth



It's just an idea. Can't you just remove all the vertices that can't be
together and try to find the shortest path without them, then include
one and remove all the others, and then change the vertex that is
included. That would be O(n) so i think you wouldn't be turning your
algorithm in exponential one that way.

example
you have v1, v2, v3, v4, v5, v6
v2, v3 and v5 can't be together and you have to find the shortest path
from v1 to v6.
You remove from your graph v2, v3 and v5 and try to calculate the
shortest path, if there's one. Then you add v2 to your graph and
calculate it again, then you remove v2 and add v3 and calculate the
shortest path and then do the same thing with v5. Now you can compare
the paths and keep the one that's the smallest one.

You can find the shortest path with that dijkstra algorithm, you
probably know that already.

.



Relevant Pages

  • Re: dijkstra algorithm
    ... can anybody give me the c-code of dijkstra algorithm which is a ... method of finding the shortest path in a graph ...
    (comp.lang.c)
  • Re: Finding the Best Path
    ... On 29 ene, 10:20, David Damerell ... method for finding the shortest path between two points. ... Are you saying that using the Dijkstra algorithm the resulting path ...
    (rec.games.roguelike.development)
  • Re: Finding the Best Path
    ... On 29 ene, 13:36, David Damerell ... Are you saying that using the Dijkstra algorithm the resulting path ... shortest path with the "lowest cost". ...
    (rec.games.roguelike.development)
  • Re: Finding the Best Path
    ... Are you saying that using the Dijkstra algorithm the resulting path ... shortest path with the "lowest cost". ... They have different costs only if you give different cost to diagonal ... the problem is the archer. ...
    (rec.games.roguelike.development)
  • Re: dijkstra algorithm
    ... can anybody give me the c-code of dijkstra algorithm which is a ... method of finding the shortest path in a graph ...
    (comp.lang.c)