Breadth First Directed Paths Algorithm

The problem of finding the shortest path between two intersections on a road map may be modelled as a special case of the shortest path problem in graphs, where the vertices correspond to intersections and the edges correspond to road sections, each weighted by the length of the segment. In graph theory, the shortest path problem is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized.

Breadth First Directed Paths source code, pseudocode and analysis