Table constraint
Also known as Extensional constraint, GAC on allowed tuples
constraint constraint-search
A table constraint lists the allowed tuples of values for its variables. Each run scans the whole table, keeps the tuples whose values are all still in their domains, and collects the values of those tuples per variable. Each variable then keeps only its collected values, and the constraint fails when no tuple is left. The result is complete: every value left belongs to an allowed tuple whose other values are all still possible. It keeps no reduced table between runs, so use it for small relations that are easier to list than to compute, such as KenKen cages or the allowed colour pairs of two regions.
Pseudocode
algorithm Table(x₁, …, x_k, T, D)input: variables x₁, …, x_k, allowed tuples T, domains Doutput: D with every value outside a possible tuple removed, or failureS_i ← ∅ for each i in 1, …, kfor each t in T do ▷ the full table on every runif t_i ∈ D(x_i) for every i thenfor i in 1, …, k doS_i ← S_i ∪ {t_i}for i in 1, …, k doD(x_i) ← D(x_i) ∩ S_iif D(x_i) = ∅ thenreturn failurereturn DIn the crates
constraint-searchComplete propagation of a constraint given by its allowed tuples, in one scan of the tuples.
Lineage
Comes from
builds on Constraint propagation to a fixpoint
Led to
Nothing on this site.