Glossary
Beam Search Algorithm
Fundamentals
Models
Techniques
Last updated on January 30, 202410 min read
Beam Search Algorithm

The Beam Search algorithm is a powerful tool in the arsenal of heuristic search strategies that offers a pragmatic balance between the exhaustive rigor of breadth-first search and the nimble agility of greedy algorithms.

The Beam Search algorithm is a powerful tool in the arsenal of heuristic search strategies that offers a pragmatic balance between the exhaustive rigor of breadth-first search and the nimble agility of greedy algorithms. By focusing on the most promising paths and pruning away the chaff, Beam Search stands out as a beacon of hope for those wrestling with vast search spaces.

Section 1: What is the Beam Search Algorithm?

The Beam Search algorithm is a heuristic search algorithm that stands out for its unique approach to exploring a graph. Rather than expanding all nodes, it selects and expands the most promising node within a limited set—much like casting a focused beam of light into a room and only observing objects within that beam. This method is an evolution of the breadth-first search, but with a twist: it operates under a limited memory capacity. Here's how it works:

The Beam Search is a variation of A* that places a limit on the size of the OPEN set. If you’re unfamiliar with A*, don’t worry. We can illustrate Beam Search rather simply using graphs. The pseudocode is written in the image below.