Graphs/BFS traversal implementation