This is not a shortest path problem.