Skip to content
Surf Wiki
Save to docs
technology/algorithms

From Surf Wiki (app.surf) — the open knowledge base

Bidirectional search

Optimized search algorithm


Summary

Optimized search algorithm

Bidirectional search is a graph search algorithm that finds a shortest path from an initial vertex to a goal vertex in a directed graph. It runs two simultaneous searches: one forward from the initial state, and one backward from the goal, stopping when the two meet. The reason for this approach is that in many cases it is faster: for instance, in a simplified model of search problem complexity in which both searches expand a tree with branching factor b, and the distance from start to goal is d, each of the two searches has complexity O(b**d/2) (in Big O notation), and the sum of these two search times is much less than the O(b**d) complexity that would result from a single search from the beginning to the goal.

Andrew Goldberg and others explained the correct termination conditions for the bidirectional version of Dijkstra’s Algorithm.

As in A* search, bi-directional search can be guided by a heuristic estimate of the remaining distance to the goal (in the forward tree) or from the start (in the backward tree).

Ira Pohl was the first one to design and implement a bi-directional heuristic search algorithm. Search trees emanating from the start and goal nodes failed to meet in the middle of the solution space. The BHFFA algorithm of de Champeaux fixed this defect.

A solution found by the uni-directional A* algorithm using an admissible heuristic has a shortest path length; the same property holds for the BHFFA2 bidirectional heuristic version described by de Champeaux . BHFFA2 has, among others, more careful termination conditions than BHFFA.

Description

A Bidirectional Heuristic Search is a state space search from some state s to another state t, searching from s to t and from t to s simultaneously. It returns a valid list of operators that if applied to s will give us t.

While it may seem as though the operators have to be invertible for the reverse search, it is only necessary to be able to find, given any node n, the set of parent nodes of n such that there exists some valid operator from each of the parent nodes to n. This has often been likened to a one-way street in the route-finding domain: it is not necessary to be able to travel down both directions, but it is necessary when standing at the end of the street to determine the beginning of the street as a possible route.

Similarly, for those edges that have inverse arcs (i.e. arcs going in both directions) it is not necessary that each direction be of equal cost. The reverse search will always use the inverse cost (i.e. the cost of the arc in the forward direction). More formally, if n is a node with parent p, then k_1(p,n) = k_2(n,p), defined as being the cost from p to n.

Terminology and notation

; b : the branching factor of a search tree ; k(n,m) : the cost associated with moving from node n to node m ; g(n) : the cost from the root to the node n ; h(n) : the heuristic estimate of the distance between the node n and the goal ; s : the start state ; t : the goal state (sometimes g , not to be confused with the function) ; d : the current search direction. By convention, d is equal to 1 for the forward direction and 2 for the backward direction ; d' : the opposite search direction (i.e. d' = 3 - d ) ; \mathrm{TREE}_d : the search tree in direction d. If d = 1 , the root is s , if d = 2 , the root is t ; \mathrm{OPEN}_d : the leaves of \mathrm{TREE}_d (sometimes referred to as \mathrm{FRINGE}_d ). It is from this set that a node is chosen for expansion. In bidirectional search, these are sometimes called the search 'frontiers' or 'wavefronts', referring to how they appear when a search is represented graphically. In this metaphor, a 'collision' occurs when, during the expansion phase, a node from one wavefront is found to have successors in the opposing wavefront. ; \mathrm{CLOSED}_d : the non-leaf nodes of \mathrm{TREE}_d . This set contains the nodes already visited by the search

References

References

  1. (2006-04-05). "Efficient point-to-point shortest path algorithms, COS423 handout". Princeton University.
  2. Pohl, Ira. (1971). "Bi-directional Search". Edinburgh University Press.
  3. (1977). "An improved bidirectional heuristic search algorithm". [[Journal of the ACM]].
  4. de Champeaux, Dennis. (1983). "Bidirectional heuristic search again". [[Journal of the ACM]].
  5. Kwa, James B.H.. (1989). "BS∗: An admissible bidirectional staged heuristic search algorithm". Elsevier BV.
  6. Kaindl, H.. (1997-12-01). "Bidirectional Heuristic Search Reconsidered". AI Access Foundation.
  7. (2004). "A case study of revisiting best-first vs. depth-first search".
Wikipedia Source

This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page.

Want to explore this topic further?

Ask Mako anything about Bidirectional search — get instant answers, deeper analysis, and related topics.

Research with Mako

Free with your Surf account

Content sourced from Wikipedia, available under CC BY-SA 4.0.

This content may have been generated or modified by AI. CloudSurf Software LLC is not responsible for the accuracy, completeness, or reliability of AI-generated content. Always verify important information from primary sources.

Report