Forward checking (source code)

= Forward checking

<Forward checking> in a <constraint satisfaction problem> updates the domains of unassigned variables after assigning one variable. Remove any remaining value immediately incompatible with the new assignment; if a domain becomes empty, backtrack. For $X\ne Y$ with both domains $\{1,2\}$, assigning $X=1$ removes one from the domain of $Y$. Basic <forward checking> only enforces constraints involving the latest assigned value; it does not generally propagate every interaction among still-unassigned variables. Stronger <constraint propagation> can therefore detect failures earlier at additional computational cost.