in reply to Short Circuiting DFS Graph Traversal
I am not sure I correctly understod the problem, but it seems Dijkstra's algorithm with all edges set to one should work.
In Section
Seekers of Perl Wisdom
in reply to Short Circuiting DFS Graph Traversal