Constraint propagation to a fixpoint
Also known as Propagation engine, AC-3-style propagation
constraint constraint-search
The propagation engine removes the values that the constraints rule out, until no constraint can remove more: the fixpoint. Each constraint is a propagator that prunes the domains of its scope. At the root every propagator runs once; after that, a changed domain queues only the propagators that watch its variable, each at most once and first in, first out, and a propagator that changes its own scope runs again. A propagator that would empty a domain stops the run with a conflict, and a trail records every change so that search can undo it on backtrack. Use it under backtracking search, so that each choice prunes the other domains before the next one.
Pseudocode
algorithm Propagate(D, Q)input: domains D with a trail, queue Q of propagatorsoutput: the domains at the fixpoint, or failure▷ at the root Q holds every propagator; after a search choice, the watchers of the changed variableswhile Q ≠ ∅ dop ← pop-front(Q)if propagate(p, D) = failure then ▷ p would empty a domainclear(Q)return failurefor each variable x that changed since the last wake dofor each propagator q in watchers(x) doif q ∉ Q thenpush-back(Q, q) ▷ p too, when it changed its own scopereturn Dprocedure remove(D, x, v)push(TRAIL, ⟨x, D(x)⟩) ▷ search pops the trail to undo a choiceD(x) ← D(x) ∖ {v}mark x as changedIn the crates
constraint-searchRuns every propagator whose scope changed until none removes a value; the trail undoes the changes on backtrack.
Lineage
Comes from
Nothing on this site.
Led to
All-different by bipartite matching builds on it
Backtracking search with propagation builds on it
Bounds propagation for linear constraints builds on it
Cost-ordered inference rules builds on it
Nonogram line solving builds on it
Table constraint builds on it
Papers
- Consistency in networks of relations Alan K. Mackworth · 1977· Artificial Intelligence