every solution of the whole problem has to satisfy every part of it
partial solutions for small parts may be easy to find
already seen
a variable is node-consistent if every value of its domain satisfies all unary constraints on that variable
formally, if the domain of the variable x is Dx:
∀ a ∈ Dx ∀ C=〈〈x〉,R〉 . 〈a〉 ∈ R
change the problem so that:
if a variable is not node-consistent,
remove from its domain all values that do not satisfy some unary constraint
Dx' = Dx \ { a | ∃ C . C=〈〈x〉,R〉 and 〈a〉 ∉ R }
does this change satisfy the two conditions?
something similar is now done on binary constraints
then, on groups of constraints
binary constraints = constraints on two variables
example problem:
no unary constraints ⇒ node consistent
any value that can be excluded?
x=2 implies that y is larger than 2
x=3 implies that y is larger than 3
but maximal allowed value for y is 2
x=2 and x=3 are not possible
these values are not part of any solution
x can only be 0 or 1
quite obvious
write reason explicitely, so it can be generalized
x=2 is not part of any solution because:
conclusion: x=2 is not part of any solution
representation of values
different than the primal graph
solution: value for each variable
satisfy constraints: linked by edges
viewing it from the side of x:
only x = 0 and x = 1 are arc-consistent
x = 2 is not linked to any value of y
⇒ is not part of any solution
can be removed from the domain of x
same for x = 3
enough?
other constraints may involve x
example:
originally: z = 2 possible, with x = 3
value x = 3 removed ⇒ z = 2 impossible
again, z may be involved in other constraints…
generalizing what done so far:
useful for?…
does value removal simplify the problem?
2 and 3 removed from the domain of x
example: backtracking
two choices less on x
fewer choices ⇒ simpler to solve
let C=〈〈x,y〉,R〉 be a binary constraint
let Dx and Dy be the domains of x and y
variable x is arc-consistent on a binary constraint if for every value a in the domain of x there exists a value b in the domain of y such that the pair a,b satisfieds the constraint
formally:
∀ a ∈ Dx ∃ b ∈ Dy . 〈a,b〉 ∈ R
is a change in the domain of x
removal of values not satisfying arc-consistency
Dx' = Dx \ { a | ∀ b ∈ Dy . 〈a,b〉 ∉ R }
removal from the domain of x of all values not satisfying arc-consistency with C
propagation = removal of values from the domain
may the domain become empty?
yes:
for no value of x there exists a value for y such that they satisfy the constraint
propagation makes Dx empty
the domain of even a single variable is empty
⇒
the problem has no solution
why?
every solution includes a value for x
no value for x may satisfy the binary constraint on x
empty domain → unsatisfiable
not the converse:
all variables are arc-consistent:
if x = 1 then y = 0 and z = 0
looking only at this variable, this assigment is consistent
the whole problem is inconsistent
A problem is arc-consistent if every variable and every binary constraint is arc-consistent.
propagate constraint = restore arc-consistency for a variable and a binary constraint
can be done for the whole problem
for x in (variables)
for c in (binary constraints on x)
restrict domain of x to ensure arc consistency with c
enough?
for x in (variables)
for c in (binary constraints on x)
restrict domain of x to ensure arc consistency with c
restrict domain of x may make another variable y no longer arc-consistent
every value of z has a corresponding value for x
z is arc consistent
some values of x have no correspondance in y
remove them
z was arc consistent with x
it no longer is
removal of values 2 and 3 for x
⇒
z=1 and z=2 no longer correspond to values in x
z no longer is arc consistent with x
z no longer arc consistent
restore consistency by removing values 1 and 2
finished?
x is not arc consistent with z
x=0 do not correspond to any value for z
remove x=0
propagation restrict the problem to a single solution
problem now trivial: single solution z=0, x=1, y=2
third case: values removed = fewer possibilities = easier problem
values may be removed, never added
remove value ⇒ re-check consistency of other variables
do not remove ⇒ no need to re-check
at some point, either:
for x in (variables)
for c in (binary constraints on x)
restrict domain of x to ensure arc consistency with c
may not obtain arc-consistency
why: x,c only considered once
x may become arc consistent with y
then, values for y are removed
x no longer arc consistent
for x in (variables)
for c in (binary constraints on x)
restrict domain of x to ensure arc consistency with c
some variables may be still not arc-consistent
⇒ repeat
how many times?
for x in (variables)
for c in (binary constraints on x)
restrict domain of x to ensure arc consistency with c
some domain changed ⇒ repeat all
maximum number of iterations = one value removed each time
maximum number of iteration = sum of size of domains
unsatisfiable
how long does propagation runs?
one variable at time:
but actually…
checking each variable at time
order x,y,z and again
only three variable
same with 100 variables: 2 removals every scan of 100 variables
for each constraint C=〈〈x,y〉,R〉:
ensures the arc consistency of both x and y at the same time
principle:
ensure the arc consistency on x,y
⇓
remove values from the domain of x and y
⇓
other constraints on x and y may become arc inconsistent
store the list of constraints that may be arc inconsistent
do not check the others
stores a set of pairs of variables
these may be arc inconsistent
omitted: actually, also 〈x,z〉 etc.