write breadthFirstSearch() in graph.js