GraphsExplained
Bidirectional BFS
Search from both ends at once and stop when they meet.
Time
O(b^(d/2))
Extra space
O(b^(d/2))
Use it for
Shortest path with a known target.
Search from both ends at once and stop when they meet.
Time
O(b^(d/2))
Extra space
O(b^(d/2))
Use it for
Shortest path with a known target.