Custom BFS Algorithms