Add findBestRoots function to BFS class.