How to update the graph datastructure dynamically - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to update the graph datastructure dynamically


I have created a graph datastructure to represent a physical floor layout in using hashtables and nodes (class).

And i am applying the Dijkstra algorithm to calculate the shortest path between any two nodes which is working fine.

This datastructure has got the obstacles defined before applying the algorithm thus the obstacles are static.

I have the following questions:
1. How do i dynamically update the graph datastructure to reflect the obstacles or changes.

2. Since the changes can happen at real time, what is the thought process that should go behind calculating the Shortest Path. Because, the path calculated may not be valid with the changed graph.

Should I recreate the graph datastructure again and again because the changes are happening at realtime.

Please help..I have no clue to proceed further.

Sign In or Register to comment.