Planning & Search in Rust
Esc

Loading…

↑↓ move ↵ open Esc close
Colour theme
All algorithms

BFWS

Also known as Best-First Width Search, BFWS(⟨w#g, #g⟩)

search width-search

Best-First Width Search (BFWS) is a greedy best-first search that ranks states first by novelty w and then by goal count #g, the number of goal conditions a state does not satisfy. It computes novelty in a separate table for each value of #g, so a state that satisfies one more goal can count as new again. A state with novelty above k is not pruned: it gets the value k + 1 and waits behind all states of lower novelty. With duplicate detection, BFWS is complete on finite state spaces, but its plans are not optimal. Use it for planning tasks with conjunctive goals ("collect every key"), where IW alone would need a large width.

Pseudocode

algorithm BFWS(s₀, k)input: initial state s₀, width bound koutput: a plan to a goal state, or failureif goal(s₀) thenreturn empty planSEEN ← {s₀}OPEN ← {s₀}                        ▷ ordered by ⟨w, g⟩, then by generation orderw[s₀] ← novelty(s₀)while OPEN ≠ ∅ dos ← extract-min(OPEN)for each (a, s′) in successors(s) doif s′ ∈ SEEN thencontinueSEEN ← SEEN ∪ {s′}parent[s′] ← (s, a)w[s′] ← novelty(s′)if goal(s′) thenreturn plan-to(s′)insert(OPEN, s′, ⟨w[s′], unsatisfied-goals(s′)⟩)return failurefunction novelty(s)g ← unsatisfied-goals(s)w ← evaluate-and-insert(TABLE[g], features(s))   ▷ one table per value of gif w = nil thenw ← k + 1                        ▷ kept, but behind every lower noveltyreturn w

In the crates

  • width-search

    Best-first width search BFWS(⟨w_{#g}, #g⟩) with novelty computed per value of the goal count.

    bfws

Lineage

Comes from

builds on Novelty pruning

Led to

BFWS-f5 builds on it

Papers

  1. Best-First Width Search: Exploration and Exploitation in Classical Planning Nir Lipovetzky, Hector Geffner · 2017· Proceedings of the AAAI Conference on Artificial Intelligence introduces doi 10.1609/aaai.v31i1.11027