Consistency Enforcing and Constraint. Propagation: Path consistency and. i-consistency. i-consistency. Path. Consistency.

Similar documents
Constraint Satisfaction Problems. Constraint Satisfaction Problems. Constraint networks. 1 Constraint Networks. 1 Constraint Networks

Class 2 Constraint Networks

Constraint (Logic) Programming

Set 5: Constraint Satisfaction Problems

Set 5: Constraint Satisfaction Problems

Set 5: Constraint Satisfaction Problems

Set 5: Constraint Satisfaction Problems Chapter 6 R&N

Summary. Acyclic Networks Join Tree Clustering. Tree Decomposition Methods. Acyclic Network. Tree Based Clustering. Tree Decomposition.

Constraint Satisfaction Problems

Acyclic Network. Tree Based Clustering. Tree Decomposition Methods

Acyclic Network. Tree Based Clustering. Tree Decomposition Methods

Unifying and extending hybrid tractable classes of CSPs

Constraint Satisfaction Problems

Section 1.8. Simplifying Expressions

GM1.1 Consolidation Worksheet Answers

Consistency and Set Intersection

Given the following information about rectangle ABCD what triangle criterion will you use to prove ADC BCD.

CS 771 Artificial Intelligence. Constraint Satisfaction Problem

Constraint Satisfaction. AI Slides (5e) c Lin

Class2: Constraint Networks Rina Dechter

Set Intersection and Consistency in Constraint Networks

CONSTRAINT SATISFACTION

CONSTRAINT SATISFACTION

Constraint Satisfaction Problems Part 2

Constraint Satisfaction Problems. Chapter 6

Constraint Optimisation Problems. Constraint Optimisation. Cost Networks. Branch and Bound. Dynamic Programming

DIT411/TIN175, Artificial Intelligence. Peter Ljunglöf. 30 January, 2018

PART II: Local Consistency & Constraint Propagation

CMU-Q Lecture 7: Searching in solution space Constraint Satisfaction Problems (CSPs) Teacher: Gianni A. Di Caro

Lecture 9 Arc Consistency

1 Inference for Boolean theories

Outline. Best-first search

Constraint Networks. Constraint networks. Definition. Normalized. Constraint Networks. Deduction. Constraint. Networks and Graphs. Solving.

Lecture Orientations, Directed Cuts and Submodular Flows

Constraint Satisfaction Problems

Outline. Best-first search

2. Modeling AEA 2018/2019. Based on Algorithm Engineering: Bridging the Gap Between Algorithm Theory and Practice - ch. 2

Foundations of Artificial Intelligence

Lecture 6: Constraint Satisfaction Problems (CSPs)

Arc Consistency and Domain Splitting in CSPs

3. According to universal addressing, what is the address of vertex d? 4. According to universal addressing, what is the address of vertex f?

2-C3OP: An Improved Version of 2-Consistency

Global Constraints. Combinatorial Problem Solving (CPS) Enric Rodríguez-Carbonell (based on materials by Javier Larrosa) February 22, 2019

COMP90051 Statistical Machine Learning

Graph Algorithms. Tours in Graphs. Graph Algorithms

Practice problems. 1. Given a = 3i 2j and b = 2i + j. Write c = i + j in terms of a and b.

Temporal Dynamic Controllability Revisited

Linear Time Unit Propagation, Horn-SAT and 2-SAT

60-265: Winter ANSWERS Exercise 4 Combinational Circuit Design

Recognizing Interval Bigraphs by Forbidden Patterns

ELEC 876: Software Reengineering

Lecture 13. Reading: Weiss, Ch. 9, Ch 8 CSE 100, UCSD: LEC 13. Page 1 of 29

Circuit analysis summary

Constraint Satisfaction Problems

Lecture 18. Questions? Monday, February 20 CS 430 Artificial Intelligence - Lecture 18 1

10/11/2017. Constraint Satisfaction Problems II. Review: CSP Representations. Heuristic 1: Most constrained variable

Constraint Tightness and Looseness versus Local and Global Consistency

Constraint Satisfaction Problems. slides from: Padhraic Smyth, Bryan Low, S. Russell and P. Norvig, Jean-Claude Latombe

Path Consistency on Triangulated Constraint Graphs*

Digital Design. Chapter 4. Principles Of. Simplification of Boolean Functions

Faster Constraint Satisfaction Algorithms for Temporal Reasoning' (*)

Chapter 6 Constraint Satisfaction Problems

Binary Encodings of Non-binary Constraint Satisfaction Problems: Algorithms and Experimental Results

2.1 Binary Logic and Gates

Math 21a Tangent Lines and Planes Fall, What do we know about the gradient f? Tangent Lines to Curves in the Plane.

Constraint Satisfaction Problems

Digital Logic Lecture 7 Gate Level Minimization

Solving Functional Constraints by Variable Substitution arxiv: v1 [cs.ai] 16 Jun 2010

Graphs: basic concepts and algorithms

Reading: Chapter 6 (3 rd ed.); Chapter 5 (2 nd ed.) For next week: Thursday: Chapter 8

General Methods and Search Algorithms

Chapter 2: Properties of Angles and Triangles

Hw 4 Due Feb 22. D(fg) x y z (

Bounded, Closed, and Compact Sets

UNIT 4 Branch and Bound

Trees. 3. (Minimally Connected) G is connected and deleting any of its edges gives rise to a disconnected graph.

Compiler Optimization Techniques

A Generic Scheme for Integrating Strong Local Consistencies into Constraint Solvers

What you will learn today

Combining Tree Partitioning, Precedence, and Incomparability Constraints

Backtracking Search (CSPs)

2 A topological interlude

Range and Roots: Two Common Patterns for Specifying and Propagating Counting and Occurrence Constraints

Direct Addressing Hash table: Collision resolution how handle collisions Hash Functions:

Reasoning About Uncertainty

Constraint Programming

CS 4100/5100: Foundations of AI

Heap sort. Carlos Moreno uwaterloo.ca EIT

A Fast Arc Consistency Algorithm for n-ary Constraints

Exemples of LCP. (b,3) (c,3) (d,4) 38 d

Heap-on-Top Priority Queues. March Abstract. We introduce the heap-on-top (hot) priority queue data structure that combines the

Lower Bound on Comparison-based Sorting

UNIVERSITI TEKNOLOGI MALAYSIA SSE 1893 ENGINEERING MATHEMATICS TUTORIAL 5

Constraint Satisfaction

Class2: Constraint Networks Rina Dechter

Constraint Satisfaction Problems

Section 3.1: Nonseparable Graphs Cut vertex of a connected graph G: A vertex x G such that G x is not connected. Theorem 3.1, p. 57: Every connected

CATIA V5 Parametric Surface Modeling

Local Consistency in Weighted CSPs and Inference in Max-SAT

Computer Science /21/2000

Transcription:

Summary

Basic Concepts x, y, z,r x,y, R y,z, R x,z Arc : every consistent value of x can be extended to y every consistent couple of values for x, y can be extended to z

: Example Example ( ) x, y, z, D = {1, 2} R x,y = {(1, 1)(2, 2)}, R x,z = {(1, 1)(1, 2)(2, 1)}, R y,z = {(1, 1)(2, 2)}

: Denition Denition ( for x, y relative to z) Couple of variables x, y a third variable z s R x,y, R x,z, R y,z (if a constraint does not exists all values are possible) x, y is path consistent w.r.t. z i: < a, b > R x,y a D x y D y c D z < a, c > R x,z < b, c > R y,z Graphically: a triangle in the matching diagram

Why is important importance of path If path does not hold for x = a, y = b relative to z then < a, b > can not be part of any solution If we x a, b we can not nd any value for z But we need to assign z the solution must satisfy all constraints

for problems for R R path consistent i for every couple of variables x, y every other variable z x, y path consistent relative to z for R x,y relative to z R x,y is path consistent relative to z every couple in R x,y is path consistent relative to z

path for R If R is not path consistent exists a couple of variables x = a, y = b that can not be extended to z x = a, y = b can not be part of any solution but we can not remove a, b from their respective domains!

path : Example Example ( ) Variables: x, y, z Domains: D = {1, 2} s R x,y = {(1, 1)(1, 2)(2, 1)}, R x,z = {(1, 1)(2, 1)(2, 2)}, R y,z = {(1, 2)(2, 1)(2, 2)} x = 1, y = 1 can not be extended to any value of z but we have solutions with x = 1 y = 1 Removing x = 1 (or y = 1) could make other solutions disappear

path for R Given x = a, y = b not path consistent relative to z we eliminate < a, b > from R x,y R x,y now is path consistent with repsect to z we did not remove solutions: a, b could not be in any solution a D x b D y can still be used for other solutions Simpler problem: do not need to check z to realise a, b not a solution

path : Revise-3 Revise-3 proc. Algorithm 1 Revise-3((x, y),z) Require: A three variable subnetwork over x, y, z, R x,y, R y,z, R x,z Ensure: Revised R x,y path consistent relative to z for all < a, b > R x,y do if c D z (a, c) R x,z (b, c) R y,z then delete a, b from R x,y end if end for Equivalent to R xy R xy π xy (R xz D z R zy )

Revise-3: Example Example (Revise-3) Variables: x, y, z Domains: D = {1, 2} s x! = y, y! = z, z! = x Run Revise-3((x, y), z)

Inconsistent problem Inconsistent Problem If a revise makes a relation (R x,y ) empty the problem is inconsistent We have to assign x y Every possible assignment will not satisfy R x,y node/arc remove values empty domain from domains in path remove values empty relation from relations in

Loosing PC-1 Removing values from R x,y We can loose path wherever it depends on R x,y between couple <x,z> y between couple <y,z> x

Algorithm PC-1 Require: R =< X, D, C > Ensure: A path consistent network equivalent to R repeat for all k 1 to n do for all i, j 1 to n j k i k i < j do Revise((x i, x j ),x k ); end for end for until no constraint is changed

PC-1: Example Example ( ) Variables: x 1, x 2, x 3 Domains: D = {1, 2} s x 1! = x 3, x 2! = x 3

Creating new constraints New constraints We can create a new constraint between x y when they share a constraint with another variable z We can not have a constraint when two nodes are not connected We could have constraint creation even if variables are connected but not directly connected: multiple constraint creation.

Example Example (New constraints) x, y, z; R xz Can we create a new constraint bewteen x, y? x, y, z, w; R xz, R zw, R wy Can we create a new constraint bewteen x, y?

PC-1 Computational Complexity Comp. Complexity O(n 5 k 5 ) Revise for each triplets is O(k 3 ) Each cycle we revise at most O(n 3 ) triplets Number of cycles is at most O(n 2 k 2 ) Because at each cycle we remove at least one element from one constraint, number of elements in all constraints is O(n 2 k 2 )

Improvements for PC-1 Improve PC-1: PC-2 Can do better than PC-1 (similarly to AC-1) We can focus on triplets that might have changed (simlilarly to AC-3) If R x,y is changed we re-process all triplets involving x, y x, y, z with z any other variable

Algorithm PC-2 Require: R =< X, D, C > Ensure: A path consistent network equivalent to R Q {< i, k, j > 1 i < j n 1 k n k i k j} while Q { } do pop < i, k, j > from Q Revise((x i, x j ),x k ); if R xi,x j changed then Q Q {< l, i, j >, < l, j, i > 1 l n l i l j} end if end while

PC-2 Computational Complexity Comp. Complexity O(n 3 k 5 ) Revise for each triplets is O(k 3 ) Number of times we process the queue is at most O(n 3 k 2 ) Because we can put back an element at most O(k 2 )

PC-2: Example Example ( ) Variables: x 1, x 2, x 3, x 4 Domains: D = {1, 2} s x 1 x 2, x 2 x 3, x 3 x 4, x 4 x 1

: alternative denition R xi,x j is path consistent relative to a path of length m if we can nd a sequence of other m 2 values such that all constraints along the path i, i 1,, i m 1, j are satisied. if we consider complete graphs the two denitions are the same if we consider only real path denitions are dierent

In Inconsistencies when forcing When forcing arc or path we can make a domain or a constraint empty, then the problem is inconsistent. The opposite is not always true... but it is true in some cases For this class of problems arc/path ensures of the problem: tractable cases Tractable because they are polynomial

Not tractable problem: example arc/path consistent problem that is inconsistent Variables: x 1, x 2, x 3, x 4 Domain: D = {0, 1, 2} s x 1 x 2, x 1 x 3, x 1 x 4, x 2 x 3, x 2 x 4, x 3 x 4 For every value of every variable (e.g., 0) there is always a dierent value for another variable (e.g., 2) (arc consistent) For every couple of values of two variables (e.g., 0,1) there is always another value of another variable (e.g., 2) But we can not nd 4 values that are all dierent in the domain {0, 1, 2}

Arc Why we have local but global in Consider a tree. If each node is arc consistent with its children then the problem is arc consistent The problem is also globally consistent This is because siblings will never introduce in Cycles are the problem

Complete case for Arc completeness for arc An arc ( node) consistent problem is globally consistent i no empty domain only binary constraints primal graph contains no cycle Solution algorithm for this type of problems Enforce arc Recall: no constraint addition still acyclic If no domain is empty Choose a node Choose a value for the node extend it to all its children Propagate the choise value propagation Otherwise the problem is inconsistent

Complete case for completeness for path A path ( arc node) consistent problem is consistent i no empty relation or empty domain only binary constraints only two values in the domain Even if primal graph has cycles

: general concept Basic ideas arc consider sub-network of size 2 path consider sub-network of size 3 generalisation of this concept for sub-network of size i 1

Given relation R S a variable y S X, S = i 1, y S R S is i-consistent relative to y i for every tuple t R S there is a value a y D y such that (t, a) is consistent

for network i-consistent R R is i-consistent i: for any consistent instantiation of i 1 distinct variables there is a value of the ith values such that the i values satisfy all constraints among them

example Example 4-Queens problem The 4-Queen problem is 2-consistent The 4-Queen problem is not 3-consistent The 4-Queen problem is not 4-consistent

strong for network strong i-consistent R R is strong i-consistent i: R is j-consistent for any j i If R is strongly n-consistent then it is globally consistent For a globally consistent network we can extend any consistent partial instantiation to a complete instantiation without dead end

strong example Example all 5 equals Variables X con X >= 5; Domain: D = {0, 1} s: allequals on all subset of exactly 5 variables This problem is 6-consistent but not 5-consistent

global strong i-consistent R R is strong i-consistent i: R is j-consistent for any j i If R is strongly n-consistent then it is globally consistent

enforcing adding constraints to enforce To enforce we might need to add constraints of i 1 variables These constraints record forbidden combinations or no-good Therefore binary network might become non-binary Example: 4-Queens

: Revise-i Revise-i proc. Algorithm 2 Revise-i((x 1, x 2,, x i 1 ),x i ) Require: A network R, a constraint R S, which might be universal Ensure: A constraint R S (S = x 1, x 2,, x i 1 ) which is i- consistent relative to x i for all instantiations ā i 1 R S do if a i D i (ā i 1, a i ) is consistent then delete ā i 1 from R S end if end for

Complexity of Revise-i Revise-i complexity Complexity of Revise-i for only binary constraints is O(k i ) With general constraint we have O(2k i ) We might need to check 2 i constraints If e bounds the constraints then O(ek i )

i- Algorithm for networks Require: R =< X, D, C > Ensure: An i-consistent network equivalent to R repeat for all S X of size i 1 do for all x i do Revise-i((S),x i ); end for end for until no constraint is changed

3- - 3- vs. On a binary network 3- = - If we have ternary constraints then not the same Example: x, y, z R x,y,z = (0, 0, 0) will do nothing: no binary constraint 3-: at least add the constraint R x,y = < x, 0 >< y, 0 >