- , . , , : , F(u, v, intermediate_list, no_of_vertices), u - ( ), v is intermediate_list - , , , , , , no_of_vertices - , , 2, v, . , , u, destination - v, no_of_vertices. F(u, v, {}, 2), F(u, v, {}, 3), ..., F(u, v, {}, V), , F , . , , .
: BFS: - , . , BFS, . v : (v, {v}, {v}), : (current_vertex, list_of_vertices_already_visited, current_path). , , e current_vertex, x list_of_vertices_already_visited, (x, list_of_vertices_already_visited + {x}, current_path -> x) , . , , .