---
library: "bootstrap"
slug: "BeamSearch"
name: "BeamSearch"
ref: "BeamSearch#3457"
hash: "sema:BeamSearch#mh:SHA-256:345791c047f0e97dbef89d2d16e6cd67634768cebe523cef44e54a6eacec622b"
type: "Strategy"
layer: "Mind"
version: "0.11.0"
root: "a6a3d1ff0f982ee30430c5b42f3784c8ec901fd68482cfc1bc30899c1e5e48c5"
license: null
url: "https://semahash.org/vocabularies/bootstrap/patterns/BeamSearch"
---

# BeamSearch

Width-limited heuristic search

Mind · Strategy

## Mechanism

A heuristic search algorithm that explores a graph by expanding the most promising [SolverNode](https://semahash.org/vocabularies/bootstrap/patterns/SolverNode.md)s in a limited set (the beam). It manages a [Queue](https://semahash.org/vocabularies/bootstrap/patterns/Queue.md) of fixed size 'k'. At each step, it generates all successors of all nodes in the beam, [Rank](https://semahash.org/vocabularies/bootstrap/patterns/Rank.md)s them, and [Select](https://semahash.org/vocabularies/bootstrap/patterns/Select.md)s the top 'k' for the next iteration.

## Invariants

- Breadth Constraint: Active nodes never exceed Beam Width.
- Optimality: The K nodes selected are the highest ranked.

## Parameters

- beam_width: type=Integer, range=[1, 100], description=Number of parallel paths to keep

## Where this came from

—

## Builds on

- [Select](https://semahash.org/vocabularies/bootstrap/patterns/Select.md) (references)
- [Rank](https://semahash.org/vocabularies/bootstrap/patterns/Rank.md) (references)
- [Queue](https://semahash.org/vocabularies/bootstrap/patterns/Queue.md) (references)
- [SolverNode](https://semahash.org/vocabularies/bootstrap/patterns/SolverNode.md) (references)

## Identity

- Library: bootstrap 0.11.0 (root a6a3d1ff0f98)
- Ref: BeamSearch#3457
- Hash: sema:BeamSearch#mh:SHA-256:345791c047f0e97dbef89d2d16e6cd67634768cebe523cef44e54a6eacec622b

## Links

- Page: https://semahash.org/vocabularies/bootstrap/patterns/BeamSearch
- JSON: https://semahash.org/vocabularies/bootstrap/patterns/BeamSearch.json
- Library: https://semahash.org/vocabularies/bootstrap
- Library index: https://semahash.org/vocabularies/bootstrap/index.json
