Lably
Skip to content

Beam search

  • 2 min read
  • 4 chapters

Related on Lably

Through Computer science, Tree traversal and Large language model

Details

Beam search uses breadth-first search to build its search tree. At each level of the tree, it generates all successors of the states at the current level, sorting them in increasing order of heuristic cost. However, it only stores a predetermined number, β, of best states at each level (called the beam width). Only those states are expanded next. The greater the beam width, the fewer states are pruned. With an infinite beam width, no states are pruned and beam search is identical to best-first search. Conversely, a beam width of 1 corresponds to a hill-climbing algorithm. The beam width bounds the memory required to perform the search. Since a goal state could potentially be pruned, beam search sacrifices completeness (the guarantee that an algorithm will terminate with a solution, if one exists). Beam search is not optimal (that is, there is no guarantee that it will find the best solution).

Sign in to keep reading

3 more chapters are free with a Lably account.

More in Computing and communication