graph search to solve the single-source shortest path problem