Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CSP is node consistent if for every vari- A constraint C on the variables x, y with
able x every unary constraint on x coincides the domains X and Y (so C X Y ) is
with the domain of x. arc consistent if
Examples a Xb Y (a, b) C,
Assume C contains no unary constraints. b Y a X (a, b) C.
N natural numbers, A CSP is arc consistent if all its binary
Z integers. constraints are.
!C, x1 0, . . ., xn 0 ; x1 N , . . ., xn N $ Examples
is node consistent. &x < y ; x [2..6], y [3..7]'
!C, x1 0, . . ., xn 0 ; is arc consistent.
x1 N , . . ., xn1 N , xn Z$ &x < y ; x [2..7], y [3..7]'
is not node consistent. is not arc consistent.
2 3
Status of Arc Consistency Proof Rules for Arc Consistency
Dy! Dy
C
Dx
4 5
Derivation: Example
Characterization of Arc Consistency 1 2 3
H O S E S
A T
Note A CSP is arc consistent iff it is closed 4
H I
5
K E
6 7
L A S E R
TENCY rules 1 and 2. E L
HOSES HOSES a : 2
LASER b : 1 a LASER a : 2
1 SAILS a : 1 SAILS 2
SHEET a : 1 SHEET e : 2
STEER a : 1 STEER e : 2
b
c, e
HEEL c:1 HOSES b : 2
HIKE LASER b : 2
4 KEEL c:1 SAILS j : 2 3
KNOT c:1 d SHEET j : 2
LINE d:1 STEER
f
6 7
Hyper-arc Consistency Characterization of
Hyper-arc Consistency
A constraint C on the variables x1, . . ., xn
with the domains D1, . . ., Dn is hyper-arc HYPER-ARC CONSISTENCY
consistent if &C ; x1 D1, . . ., xn Dn'
i [1..n]a Di d C a = d[xi]. &C ; . . ., xi Di% , . . .'
CSP is hyper-arc consistent if all its C a constraint on the variables x1, . . ., xn,
constraints are. i [1..n],
Examples Di% := {a Di | d C a = d[xi]}.
!x y = z ; x = 1, y {0, 1}, z {0, 1}$
is hyper-arc consistent. Note A CSP is hyper-arc consistent iff it is
!x y = z ; x {0, 1}, y {0, 1}, z = 1$ closed under the applications of the HYPER-
is not hyper-arc consistent. ARC CONSISTENCY rule.
8 9
12 13
< >
<
Note A normalized CSP is path consistent iff x [0..4] y [1..5]
for each subsequence x, y, z of its variables
T , is path consistent. Indeed
Cx,y Cx,z Cy,z
Cx,y = {(a, b) | a < b, a [0..4], b [1..5]},
Cx,z Cx,y Cy,z ,
Cx,z = {(a, c) | a < c, a [0..4], c [6..10]},
T C .
Cy,z Cx,y x,z
Cy,z = {(b, c) | b < c, b [1..5], c [6..10]},
and all 3 conditions are satisfied.
Intuition
y
Cx,y Cy,z
x Cx,z z
14 15
Path Consistency: Example 2
Characterization of Path Consistency
&x < y, y < z, x < z;
x [0..4], y [1..5], z [5..10]'
PATH CONSISTENCY 1
z [5..10]
Cx,y , Cx,z , Cy,z
< < % ,C ,C
Cx,y x,z y,z
<
% := C T
x [0..4] y [1..5] where Cx,y x,y Cx,z Cy,z ,
PATH CONSISTENCY 3
Cx,y , Cx,z , Cy,z
%
Cx,y , Cx,z , Cy,z
% := C T
where Cy,z y,z Cx,y Cx,z .
Note A normalized CSP is path consistent iff
it is closed under the applications of the PATH
CONSISTENCY rules 1, 2 and 3.
16 17
18 19
Examples Characterization of
Directional Path Consistency
Reconsider
&x < y, y < z, x < z;
Note A normalized CSP P is directionally
x [0..4], y [1..5], z [5..10]'
path consistent w.r.t. iff P is closed un-
Then der the applications of the PATH CONSIS-
Cx,y = {(a, b) | a < b, a [0..4], b [1..5]}, TENCY rule 1.
Instantiations Example
x [0..4] y [1..5]
C: a constraint on x1, . . ., xk .
Instantiation {(x1, d1), . . ., (xk , dk )} I | {x, y} = {(x, 0), (y, 5)}.
satisfies C if (d1, . . ., dk ) C. It satisfies x < y.
I: instantiation with a domain X, Y X. I | {x, z} = {(x, 0), (z, 6)}.
I | Y : restriction of I to Y . It satisfies x < z.
Instantiation I with domain X is consis- I | {y, z} = {(y, 5), (z, 6)}.
tent if for every constraint C of P on some It satisfies y < z.
Y with Y X I | Y satisfies C. So I is a 3-consistent instantiation. It is a
Consistent instantiation is k-consistent if solution to this CSP.
its domain consists of k variables.
An instantiation is a solution to P if it is
consistent and defined on all variables of P.
22 23
k-Consistency k-Consistency, ctd
!=
Note
x1 [0..1] x2 [0..1]
x3 {a}
...
xk {a}
24 25
26 27
Examples Width of a Graph
x y
SEND + MORE = MONEY puzzle.
Complete graph with 8 nodes, so its width
z
u
= 7.
v
x y
z
u
v
28 29
Examples, ctd
Consistency via Strong k-Consistency
x
y
u
Theorem Given: a CSP such that
z
u v z y x
Proof. (Sketch)
-width: 0 1 0 1 4
Assume n variables.
Two examples of the -widths of the nodes
Reorder the variables so that the resulting
Here width = 2. -width is k 1.
Prove by induction that
there exists consistent instantiation with
domain {x1},
for every j [1..n 1] each consistent in-
stantiation with domain {x1, . . ., xj } can
be extended to a consistent instantiation
with domain {x1, . . ., xj+1}.
30 31
Useful Corollaries Relational Consistency
Corollary 1
Ultimate notion of local consistency
Given: P and a linear ordering such that
all domains are non-empty, Given: P and a subsequence C of its con-
P is straints.
node consistent, P | C:
directionally arc consistent w.r.t. , remove from P all constraints not in C,
the -width of the graph associated with P delete all domain expressions involving vari-
is 1. ables not present in any constraint in C.
Then P is consistent. P is relationally (i, m)-consistent if for
Corollary 2 every sequence C of m constraints and X Var (C)
of size i:
Given: P and a linear ordering such that
every consistent instantiation with the do-
all domains are non-empty, main X can be extended to a solution to
P is P | C.
directionally arc consistent w.r.t. ,
directionally path consistent w.r.t. ,
the -width of the graph associated with it
is 2.
Then P is consistent.
32 33
36 37
Objectives
38