graph - shortest path with dynamic edge cost (algorithm) -


i'm looking algorithm can find shortest path between 2 nodes in undirected graph cost dynamic. dynamic, mean cost on edge dependent on next (future) step. example, in graph that:

dynamic edge cost in shortest path problem

i'm looking shortest path "a" "e" cost of "a" "b" depends on next step. if go c 7 , if go d 9.

my question is: there algorithm solves problem?

reduce problem 'regular' shortest path problem

create dummy vertices b1,b2 (instead of b), , edges:

(a,b1,7), (b1,c,6), (a,b2,9), (b2,d,5) 

the rest of edges , vertices remain were.

now, run regular shortest path algorithm (dijkstra / bellman ford) source target.

(repeat process 'conditional' weight edges).


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -