• Keine Ergebnisse gefunden

Foundations of Artificial Intelligence 26. Constraint Satisfaction Problems: Path Consistency Malte Helmert

N/A
N/A
Protected

Academic year: 2022

Aktie "Foundations of Artificial Intelligence 26. Constraint Satisfaction Problems: Path Consistency Malte Helmert"

Copied!
14
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Foundations of Artificial Intelligence

26. Constraint Satisfaction Problems: Path Consistency

Malte Helmert

University of Basel

April 19, 2021

(2)

Constraint Satisfaction Problems: Overview

Chapter overview: constraint satisfaction problems:

22.–23. Introduction 24.–26. Basic Algorithms

24. Backtracking 25. Arc Consistency 26. Path Consistency 27.–28. Problem Structure

(3)

Beyond Arc Consistency Path Consistency Summary

Beyond Arc Consistency

(4)

Beyond Arc Consistency: Path Consistency

idea of arc consistency:

For every assignment to a variable u

there must be a suitable assignment to every other variablev. If not: remove values ofu for which

no suitable “partner” assignment to v exists.

tighter unary constraintonu

This idea can be extended to three variables (path consistency):

For every joint assignment to variables u,v

there must be a suitable assignment to every third variablew. If not: remove pairs of values of u andv for which

no suitable “partner” assignment to w exists.

tighter binary constraintonu andv German: Pfadkonsistenz

(5)

Beyond Arc Consistency Path Consistency Summary

Beyond Arc Consistency: i -Consistency

general concept ofi-consistency fori ≥2:

For every joint assignment to variables v1, . . . ,vi−1

there must be a suitable assignment to every i-th variablevi. If not: remove value tuples of v1, . . . ,vi−1 for which

no suitable “partner” assignment for vi exists.

tighter (i−1)-ary constraintonv1, . . . ,vi−1

2-consistency = arc consistency 3-consistency = path consistency (*) We do not consider generali-consistency further as larger values thani = 3 are rarely used

and we restrict ourselves to binary constraints in this course.

(*)usual definitions of 3-consistency vs. path consistency differ

(*)

when ternary constraints are allowed

(6)

Path Consistency

(7)

Beyond Arc Consistency Path Consistency Summary

Path Consistency: Definition

Definition (path consistent)

LetC=hV,dom,(Ruv)i be a constraint network.

(a) Two different variablesu,v ∈V are path consistent with respect to a third variable w ∈V if

for all values du ∈dom(u),dv ∈dom(v) withhdu,dvi ∈Ruv

there is a value dw ∈dom(w) with hdu,dwi ∈Ruw and hdv,dwi ∈Rvw.

(b) The constraint network C ispath consistent if for any three variablesu,v,w,

the variables u andv are path consistent with respect tow.

(8)

Path Consistency: Remarks

remarks:

Even if the constraintRuv is trivial, path consistency can infer nontrivial constraints between u andv. name “path consistency”:

pathu →w →v leads to new information on u →v

w

u v

(9)

Beyond Arc Consistency Path Consistency Summary

Path Consistency: Example

red blue

v1

red blue

v2

red blue

v3

6= 6=

6=

arc consistent, but not path consistent

(10)

Processing Variable Triples: revise-3

analogous torevisefor arc consistency:

functionrevise-3(C,u,v,w):

hV,dom,(Ruv)i:=C for eachhdu,dvi ∈Ruv:

if there is nodw ∈dom(w) with hdu,dwi ∈Ruw andhdv,dwi ∈Rvw:

remove hdu,dvi fromRuv

input: constraint networkC and three variables u, v,w of C effect: u,v path consistent with respect tow.

All violating pairs are removed fromRuv.

time complexity: O(k3) wherek is maximal domain size

(11)

Beyond Arc Consistency Path Consistency Summary

Enforcing Path Consistency: PC-2

analogous toAC-3for arc consistency:

functionPC-2(C):

hV,dom,(Ruv)i:=C queue:=∅

for eachset of two variables{u,v}:

for each w ∈V \ {u,v}:

insert hu,v,wi into queue whilequeue6=∅:

remove any elementhu,v,wi fromqueue revise-3(C,u,v,w)

if Ruv changed in the call to revise-3:

for each w0∈V \ {u,v}:

insert hw0,u,vi into queue insert hw0,v,ui into queue

(12)

PC-2: Discussion

The comments for AC-3 hold analogously.

PC-2 enforces path consistency

proof idea: invariant of the whileloop:

if hu,v,wi∈/queue, then u,v path consistent with respect to w

time complexity O(n3k5) forn variables and maximal domain sizek (Why?)

(13)

Beyond Arc Consistency Path Consistency Summary

Summary

(14)

Summary

generalization of

arc consistency(considers pairsof variables) to path consistency(considers triplesof variables) andi-consistency (considersi-tuplesof variables) arc consistency tightens unary constraints

path consistency tightensbinary constraints i-consistency tightens(i−1)-aryconstraints higher levels of consistency more powerful but more expensive than arc consistency

Referenzen

ÄHNLICHE DOKUMENTE

We selected two sets of genetic covariance and heritability values to mimic the magnitude of parameters in global and local genetic correlation analyses.. In the first setting, we

First, we deconstruct consistency into individual guarantees relating the data type, the conflict reso- lution, and the ordering, and then reassemble them into a hierarchy

several wrong proofs surviving for over 10 years solved by Appel and Haken in 1976: 4 colors suffice Appel and Haken reduced the problem to 1936 cases, which were then checked

there is no restriction, and the constraint is typically not given explicitly in the constraint network description (although it formally always exists!).. Constraints R uv and R

We have already seen this algorithm: Backtracking corresponds to depth-first search Chapter 12 with the following state space: states: partial assignments initial state:

enforcing arc consistency of all variables with respect to the just assigned variable corresponds to forward checking.. We will next consider algorithms that enforce