Depth first search of a graph.
Breadth first search.