find shortest-path to nodes in a graph