I'm solving a programming problem involving finding the shortest path between a vertex and the rest of the graph. Currently, I'm using Dijkstra's algorithm to achieve that.
However, the problem involves calling Dijkstra's multiple times with only slight modification each time (changing an edge's weight) and write the output after that.
I'm concerned about doing this with the plain algorithm itself. The graph could get really large and so do the number of modifications need to be made.
I have no idea what I could do. I've thought of Python's cache decorator but I'm using C++ (only C++ or Pascal was allowed) and I'm not sure if cache even help with this.
This is a paper assignment. There're no online judge or large sample inputs and the constraint isn't really clear about the maximum number of vertices, edges, modifications nor the memory and time limit. However, it's likely that the memory limit will be 1GB and time limit will be 1s.
A*variant? Or something similar thats allows you to add biases to edge weights to "steer" the search direction. In any case this is a well researched part of graph theory so you are bound to find existing papers on this problem. (Not directly related but nice to see visualizing the A* algorithm`