partial breadth first search BFS