From charlesreid1


The notion of "reachability" boils down to answering the question whether a vertex u can be reached from a source vertex s.

To answer this question, use a depth first search. See Graphs/DFS.

The notion of the shortest path from a vertex s to a vertex u is answered with breadth first search. See Graphs/BFS.