graph - Shortest path that satisfies specific edge contraints -




suppose have graph weighted edges , want find shortest path, additional caveat, there additional constraints must satisfied based on other properties of previous edges. best example can think of flight or bus type. nodes cities , edges flights/routes, , example, edge weights price. want find cheapest ticket, can't take bus or plane leaves before current bus/plane arrives. in example, might have list of tuples (city1, city2, price, duration, departure) , goal find cheapest "feasible" route in order take edge e departure_time>culmative_time. cannot think of or efficient solution.

use dijkstra's algorithm. however, every time travel new vertex along edge, update cumulative time vertex.

any edge heading out of vertex no longer being offered (total time exceeds it's offered time), deleted.

any edge heading out of vertex not offered will offered in due time, add time required wait along time of travel next vertex, if edge found next cheapest edge.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -