Question: Suppose we only care to compute a shortest-path from u to v (instead of from u to all the nodes). One way to speed up Dijkstra's algorithm might be to run the algorithm u and from v at the same time.
Let S_u be the current set of nodes whose distance to u is known, and let S_v be the same thing for v.
Show that when the two sets intersect, one will find a shortest path from u to v without examining the rest of the graph.
Add comments in code section. Code this program in java programming.