I have an acyclic edge-weighted graph and have used Dijkstra's Algorithm with topological sort to find any shortest path to every other node from a root $s$. This is performed in time proportional to $V + E$, where $V$ is the number of vertices and $E$ the number of edges. I have $V= N^2$ vertices in my graph. Now suppose I remove $N$ vertices (for now lets assume at random, in reality there is a pattern). If I want to find shortest paths for my new graph, is there any information from the first computation that I can cache to speed things up?
1 Answers
A simple approach
Given that you have a DAG, and the only change you will make is to delete vertices, there is a crude but simple to implement algorithm you could use. In addition to computing the distance from $s$ to every vertex, also compute the shortest paths tree.
Now, when you want to delete a vertex $v$, mark the entire subtree rooted at $v$ (in the shortest path tree). Delete this from the shortest path tree, and process each of the nodes in that subtree to re-calculate their distance from $s$. You can process those vertices in topological sorted order, and compute the updated distance for vertex $x$ by the standard formula $d(x) = \min \{1+d(w) : (w,x) \in E\}$. The running time will be proportional to the size of the subtree you deleted. Whether this is efficient in practice will depend on the structure of the graph and the nodes that you delete.
More sophisticated solutions
This kind of problem has been studied extensively in the literature. The keyword you want to use is "dynamic shortest paths". Here dynamic refers to the fact that the graph can change. In your case, you want to support vertex deletions. So, I suggest you spend some quality time with the research literature to review the known algorithms for dynamic shortest paths with vertex deletions. Alternatively, look for algorithms for dynamic shortest paths with edge deletions (since when you delete a vertex you're probably going to delete all edges incident on that vertex as well).
See, e.g., Retrieving the shortest path of a dynamic graph and How to approach Dynamic graph related problems and https://cstheory.stackexchange.com/q/17135/5038 and https://cstheory.stackexchange.com/q/11855/5038 for some entry points into the literature. Those algorithms apply to arbitrary graphs, but it might be possible to exploit the fact that your graph is actually a DAG to get even better performance.