shortest path in an unweighted graph
RU: кратчайший путь в невзвешенном графе
In an unweighted graph a path's length is its number of edges, so the shortest path is the one with the fewest edges. BFS solves it: keep a dist[] array and a parent[] map, then walk parent[] backward to rebuild the route.