Compute shortest path between a node and every other node in the graph