Implemented BFS variant and compared