Created Breadth-first search to find paths in a graph