Bidirectional Search Algorithm

A fast and memory-efficient search technique

Introduction to Bidirectional Search

  • Bidirectional search algorithm is a technique used for real-time searching.
  • It involves running two different searches simultaneously: forward search and backward search.
  • The forward search starts from a start node and moves towards a goal node.
  • The backward search starts from the goal node and moves towards the start node.

Node Visitation in Bidirectional Search

  • In bidirectional search, the forward search and backward search visit different nodes.
  • Nodes visited in the forward search are marked as 'a', 'b', or 'c'.
  • Nodes visited in the backward search are marked as 'g', 'e', or 'f'.
  • An intersect point is reached when both searches visit the same node.

Example of Bidirectional Search

  • Let's consider a simple example of bidirectional search with the starting node 'a' and goal node 'g'.
  • The forward search visits nodes 'a', 'b', 'c', 'e', and 'f'.
  • The backward search visits nodes 'g', 'e', 'f', 'b', and 'd'.
  • The intersect point is node 'h'.
  • The complete bidirectional search path is 'a' -> 'b' -> 'd' -> 'h' -> 'g'.

Advantages and Disadvantages

  • Bidirectional search requires less memory and can find solutions faster.
  • However, implementation can be difficult due to managing two independent searches.
  • Additionally, the goal state must be known in advance.

Conclusion

  • Bidirectional search is a powerful algorithm for real-time searching.
  • It offers improved efficiency and can be used in various applications.
  • While implementation may be challenging, understanding the advantages and disadvantages can help in utilizing this technique effectively.