breadth first search algorithm in artificial intelligence with example