We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
I guess it can be solved using A* search algorithm, Dijkstra
Find Office to all nodes shortest distance and store it in a dictionary.
Find shortest path from home to office and store all edges in a set.
If deleted edge is not in shortest path, return stored shortest path length O(1)
if it is in shortest paththen use A* algorithm using Office to Node shortest path as Heurestic for A* Worst case complexity of dijkstra but several times better than dijkstra...
Going to the Office
You are viewing a single comment's thread. Return to all comments →
I guess it can be solved using A* search algorithm, Dijkstra
Find Office to all nodes shortest distance and store it in a dictionary.
Find shortest path from home to office and store all edges in a set.
If deleted edge is not in shortest path, return stored shortest path length O(1)
if it is in shortest paththen use A* algorithm using Office to Node shortest path as Heurestic for A* Worst case complexity of dijkstra but several times better than dijkstra...