Breadth first search using an adjcacency list implementation of a graph