Bidirectional BFS

Find a route between two places using the fewest steps. Search from both ends, as if two friends set off to meet each other.

Expand one complete layer at a time, alternating sides. Join the two parent chains at the meeting point to obtain a shortest path.

With adjacency lists, traversal takes O(V + E) time for V vertices and E edges.