Path Consistency & Global Consistency Properties

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Foundations of Constraint Processing Temporal Constraints Networks 1Topic Foundations of Constraint Processing CSCE421/821, Spring
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
Wednesday, January 29, 2003CSCE Spring 2003 B.Y. Choueiry Constraint Consistency Chapter 3.
Foundations of Constraint Processing More on Constraint Consistency 1 Foundations of Constraint Processing CSCE421/821, Spring
Foundations of Constraint Processing, Fall 2005 October 21, 2005CSPs and Relational DBs1 Foundations of Constraint Processing CSCE421/821, Fall 2005:
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Foundations of Constraint Processing, Fall 2005 Sep 22, 2005Consistency: Properties & Algorithms 1 Foundations of Constraint Processing CSCE421/821, Fall.
An Approximation of Generalized Arc-Consistency for Temporal CSPs Lin Xu and Berthe Y. Choueiry Constraint Systems Laboratory Department of Computer Science.
Foundations of Constraint Processing, Fall 2005 November 16, 2005nFCi1 Foundations of Constraint Processing CSCE421/821, Fall 2005:
Foundations of Constraint Processing, Fall 2004 Oct 5, 2004Consistency: Properties & Algorithms 1 Foundations of Constraint Processing CSCE421/821, Fall.
A New Efficient Algorithm for Solving the Simple Temporal Problem Lin Xu & Berthe Y. Choueiry Constraint Systems Laboratory University of Nebraska-Lincoln.
Jean-Charles REGIN Michel RUEHER ILOG Sophia Antipolis Université de Nice – Sophia Antipolis A global constraint combining.
1.A finer version of PPC. 2.Cheaper than PPC and F-W. 3.Guarantees the minimal network. 4.Automatically decomposes the graph into its bi-connected components:
M. HardojoFriday, February 14, 2003 Directional Consistency Dechter, Chapter 4 1.Section 4.4: Width vs. Local Consistency Width-1 problems: DAC Width-2.
Chao Chen Wednesday, February 26, Temporal Constraint Networks Chapter 12 Chao Chen CSCE Advanced Constraint Processing.
Consistency Methods for Temporal Reasoning Lin XU Constraint Systems Laboratory Advisor: Dr. B.Y. Choueiry April, 2003 Supported by a grant from NASA-Nebraska,
Advanced Constraint Processing, Fall 2009 An Efficient Consistency Algorithm for the Temporal Constraint Satisfaction Problem Berthe Y. Choueiry & Lin.
Constraint Satisfaction Problems
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
Chapter 5 Section 1 – 3 1.  Constraint Satisfaction Problems (CSP)  Backtracking search for CSPs  Local search for CSPs 2.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
Wednesday, January 29, 2003CSCE Spring 2003 B.Y. Choueiry Directional Consistency Chapter 4.
Path Consistency for 1- General CSPs 2- STPs Peter Schlette Wesley Botham CSCE990 Advanced CP, Fall 2009.
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
Chapter Relations and Their Properties
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
Foundations of Constraint Processing, Spring 2009 February 20, 2009 Basic Consistency Methods 1 Foundations of Constraint Processing CSCE421/821, Spring.
Problem Solving with Constraints CSPs and Relational DBs1 Problem Solving with Constraints CSCE496/896, Fall
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Structure-Based Methods Foundations of Constraint Processing
Consistency Methods for Temporal Reasoning
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Lecture 7 Constraint Satisfaction Problems
Basic Consistency Methods Foundations of Constraint Processing
Empirical Comparison of Preprocessing and Lookahead Techniques for Binary Constraint Satisfaction Problems Zheying Jane Yang & Berthe Y. Choueiry Constraint.
Rationale & Strategies Foundations of Constraint Processing
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Structure-Based Methods Foundations of Constraint Processing
CSPs and Relational DBs
Foundations of Constraint Processing
Consistency Algorithms Foundations of Constraint Processing
More on Constraint Consistency
Problem Solving with Constraints
Structure-Based Methods Foundations of Constraint Processing
Foundations of Constraint Processing All questions to Piazza
Rationale & Strategies Foundations of Constraint Processing
More on Constraint Consistency
Lookahead Schemas Foundations of Constraint Processing
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Problem Solving With Constraints
Constraint satisfaction problems
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Rationale & Strategies Foundations of Constraint Processing
Foundations of Constraint Processing All questions to Piazza
Consistency Algorithms Foundations of Constraint Processing
Problem Solving with Constraints
Problem Solving with Constraints
CS 8520: Artificial Intelligence
Intelligent Backtracking Algorithms: A Theoretical Evaluation
Constraint Satisfaction Problems
Constraint satisfaction problems
Consistency algorithms
Presentation transcript:

Path Consistency & Global Consistency Properties Problem Solving with Constraints CSCE421/821, Fall 2016 www.cse.unl.edu/~choueiry/F16-421-821 All questions: Piazza Berthe Y. Choueiry (Shu-we-ri) Avery Hall, Room 360 Tel: +1(402)472-5444

Lecture Sources Required reading Recommended Algorithms for Constraint Satisfaction Problems, Mackworth and Freuder AIJ'85 Sections 3.1, 3.2, 3.3. Chapter 3. Constraint Processing. Dechter Recommended Sections 3.4—3.10. Chapter 3. Constraint Processing. Dechter Networks of Constraints: Fundamental Properties and Application to Picture Processing, Montanari, Information Sciences 74 Bartak: Consistency Techniques (link) Path Consistency on Triangulated Constraint Graphs, Bliek & Sam-Haroud IJCAI'99

Outline Motivation Path consistency and its complexity Global consistency properties Minimality Decomposability When PC guarantees global consistency

AC is not enough Example borrowed from Dechter Arc-consistent? Satisfiable?  seek higher levels of consistency V V 1 1 b a a b = = V V V V 2 2 3 3 a b a b b a a b =

Outline Motivation Path consistency and its complexity Global consistency properties Minimality Decomposability When PC guarantees global consistency

Consistency of a path A path (V0, V1, V2, …, Vm) of length m is consistent iff for any value xDV0 and for any value yDVm that are consistent (i.e., PV0 Vm(x, y))  a sequence of values z1, z2, … , zm-1 in the domains of variables V1, V2, …, Vm-1, such that all constraints between them (along the path, not across it) are satisfied (i.e., PV0 V1(x, z1)  PV1 V2(z1, z2)  …  PVm-1 Vm(zm-1, zm) ) for all x  DV0 for all y  DVm V0 Vm Vm-1 V2 V1

Note  The same variable can appear more than once in the path  Every time, it may have a different value  Constraints considered: PV0,Vm and those along the path Universal constraints can be included in path All other constraints are neglected for all x  DV0 for all y  DVm V0 Vm Vm-1 V2 V1

Example: consistency of a path  Check path length = 2, 3, 4, 5, 6, .... {a, b, c} V2 V3 V1 V4 V7 V5 V6 All mutex constraints            

Path consistency: definition  A path of length m is path consistent  A CSP is path consistent Property of a CSP Definition: A CSP is path consistent (PC) iff every path is consistent (i.e., any length of path) Question: should we enumerate every path of any length? Answer: No, only length 2, thanks to [Mackworth AIJ'77]

Tools for PC-1 Two operators Constraint composition: ( • ) R13 = R12 • R23 Constraint intersection: (  ) R13 R13, old  R13, induced

Path consistency (PC-1) Achieved by composition and intersection (of binary relations expressed as matrices) over all paths of length two. Procedure PC-1: 1 Begin 2 Yn  R 3 repeat 4 begin 5 Y0  Yn 6 For k  1 until n do 7 For i  1 until n do 8 For j  1 until n do 9 Ylij  Yl-1ij  Yl-1ik • Yl-1kk • Yl-1kj 10 end 11 until Yn = Y0 12 Y  Yn 10 end

Properties of PC-1 Discrete CSPs [Montanari'74] PC-1 terminates PC-1 results in a path consistent CSP PC-1 terminates. It is complete, sound (for finding PC network) PC-2: Improves PC-1 similar to how AC3 improves AC-1 Complexity of PC-1..

Basic Consistency Methods Complexity of PC-1 Procedure PC-1: 1 Begin 2 Yn  R 3 repeat 4 begin 5 Y0  Yn 6 For k  1 until n do 7 For i  1 until n do 8 For j  1 until n do 9 Ylij  Yl-1ij  Yl-1ik • Yl-1kk • Yl-1kj 10 end 11 until Yn = Y0 12 Y  Yn 10 end Line 9: a3 Lines 6–10: n3. a3 Line 3: at most n2 relations x a2 elements PC-1 is O(a5n5) PC-2 is O(a5n3) and (a3n3) PC-1, PC-2 are specified using constraint composition Basic Consistency Methods

Enforcing Path Consistency (PC) General case: Complete graph Theorem: In a complete graph, if every path of length 2 is consistent, the network is path consistent [Mackworth AIJ'77]  PC-1: two operations, composition and intersection  Proof by induction.

Some improvements Mohr & Henderson (AIJ 86) Han & Lee (AIJ 88) PC-2 O(a5n3)  PC-3 O(a3n3) Open question: PC-3 optimal? Han & Lee (AIJ 88) PC-3 is incorrect PC-4 O(a3n3) space and time Singh (ICTAI 95) PC-5 uses ideas of AC-6 (support bookkeeping) Also: PC8: iterates over domains, not constraints [Chmeiss & Jégou 1998] PC2001: an improvement over PC8, not tested [Bessière et al. 2005] Note: PC is seldom used in practical applications unless in presence of special type of constraints (e.g., bounded difference) Project!

Path consistency as inference of binary constraints B < C A < B A < C Path consistency corresponds to inferring a new constraint (alternatively, tightening an existing constraint) between every two variables given the constraints that link them to a third variable  Considers all subgraphs of 3 variables  3-consistency B < C

Path consistency as inference of binary constraints Another example: V4 V3 a b V2 V1  =

Question Adapted from Dechter Given three variables Vi, Vk, and Vj and the constraints CVi,Vk, CVi,Vj, and CVk,Vj, write the effect of PC as a sequence of operations in relational algebra. B B B C A A < B A + 3 > C A < C B < C A < B A < B A A B < C B < C C C -3 < A –C < 0 A + 3 > C Solution: CVi,Vj  CVi,Vj  ij(CVi,Vk CVk,Vj)

Partial Path Consistency Formal definition: Same as PC except that Universal constraints cannot be included Defined over cycles Algorithm: Same as PC-i except that We triangulate the graph We run the closure loops over the triangles only O(n3) (Correction: Careful for articulation points in graph) Theorem: In a triangulated graph, if every path of length 2 is consistent, the network is partial path consistent [Bliek & Sam-Haroud ‘99]  PPC (partially path consistent)

PPC versus PC Arbitrary binary constraints Algorithm Graph Filtering Complete Tight, not necessarily minimal PPC Triangulated Weaker filtering than PC-2 PC property is strictly stronger than PPC property Open question: Can PC detect insatisfiability when PPC does not? Yes! Example found by Chris Reeson [TBP]

Constraint propagation courtesy of Dechter After Arc-consistency: After Path-consistency: Are these CSPs the same? Which one is more explicit? Are they equivalent? The more propagation, the more explicit the constraints the more search is directed towards a solution 1 2 3 1 2 3 ( 0, 1 )  ( 0, 1 ) 

PC can detect unsatisfiability Arc-consistent? Path-consistent? V1 a b    V2 V3 a b  a b a b   a b V4

Warning: Does 3-consistency guarantee 2-consistency? B {red, blue} {red, blue}   A C { red } { red } Question: Is this CSP 3-consistent? is it 2-consistent? Lesson: 3-consistency does not guarantee 2-consistency

PC is not enough Arc-consistent? Path-consistent? Satisfiable? {a, b, c} V2 V3 V1 V4 V7 V5 V6 All mutex constraints Arc-consistent? Path-consistent? Satisfiable?  we should seek (even) higher levels of consistency k-consistency, k = 1, 2, 3, …. …following lecture                 

Outline Motivation Path consistency and its complexity Global consistency properties Minimality Decomposability When PC guarantees global consistency

Minimality PC tightens the binary constraints The tightest possible binary constraints yield the minimal network Minimal network a.k.a. central problem Given two values for two variables, if they are consistent, then they appear in at least one solution. Note: Minimal  path consistent The definition of minimal CSP is concerned with binary CSPs, but it need not be

Minimal CSP Minimal network a.k.a. central problem Given two values for two variables, if they are consistent, then they appear in at least one solution. Informally In a minimal CSP the remainder of the CSP does not add any further constraint to the direct constraint CVi, Vj between the two variables Vi and Vj [Mackworth AIJ'77] A minimal CSP is perfectly explicit: as far as the pair Vi and Vj is concerned, the rest of the network does not add any further constraints to the direct constraint CVi, Vj [Montanari'74] The binary constraints are explicit as possible. [Montanari'74]

Decomposability Decomposable  Minimal  Path Consistent     Any combination of values for k variables that satisfy the constraints between them can be extended to a solution. Decomposability generalizes minimality Minimality: any consistent combination of values for any 2 variables is extendable to a solution Decomposability: any consistent combination of values for any k variables is extendable to a solution Decomposable  Minimal  Path Consistent     Strong n-consistent  n-consistent  Solvable

Terminology Minimal Globally consistent Decomposable strongly n-consistent

Outline Motivation Path consistency and its complexity Global consistency properties Minimality Decomposability When PC guarantees global consistency

PC approximates.. In general: Decomposability  minimality  path consistent PC is used to approximate minimality (which is the central problem) When is the approximation the real thing? Special cases: When composition distributes over intersection, [Montanari'74] PC-1 on the completed graph guarantees minimality and decomposability When constraints are convex [Bliek & Sam-Haroud 99] PPC on the triangulated graph guarantees minimality and decomposability (and the existing edges are as tight as possible)

PPC versus PC Algorithm Graph Filtering/property Arbitrary Constraints Complete Tight, not necessarily minimal PPC Triangulated Weaker filtering than PC-2 Composition distributes over intersection Minimal & Decomposable

PC: Special Case Distributivity property Outer loop in PC-1 (PC-3) can be ignored Exploiting special conditions in temporal reasoning Temporal constraints in the Simple Temporal Problem (STP): composition & intersection Composition distributes over intersection PC-1 is a generalization of the Floyd-Warshall algorithm (all pairs shortest path) Convex constraints PPC

Distributivity property Intersection,  Composition, • In PC-1, two operations: RAB • (RBC  R'BC) = (RAB • RBC)  (RAB • R’BC) When ( • ) distributes over (  ), then [Montanari'74] PC-1 guarantees that CSP is minimal and decomposable The outer loop of PC-1 can be removed B RAB R’BC RBC A C

Condition does not always hold Constraint composition does not always distribute over constraint intersection R12= R23= R’23= ⋅( ∩ ) = ⋅ = ( ⋅ ) ∩ ( ⋅ )= ∩ = 1 1 0 0 0 0 1 0 1 0 0 0 1 1 0 0 0 0 1 0 1 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 1 1 0 0 0 0 1 0 1 1 0 0 1 0 0 0 1 0 0 0

Temporal Reasoning constraints of bounded difference Variables: X, Y, Z, etc. Constraints: a  Y-X  b, i.e. Y-X = [a, b] = I Composition: I 1 • I2 = [a1, b1] • [a2, b2] = [a1+ a2, b1+b2] Interpretation: intervals indicate distances composition is triangle inequality. Intersection: I1  I2 = [max(a1, a2), min(b1, b2)] Distributivity: I1 • (I2  I3) = (I1 • I2)  (I1 • I3) Proof: left as an exercise

Example: Temporal Reasoning Composition of intervals + : R’13 = R12 + R23 = [4, 12] R01 + R13 = [2,5] + [3, 5] = [5, 10] R01 + R'13 = [2,5] + [4, 12] = [6, 17] Intersection of intervals: R13  R'13 = [4, 12]  [3, 5] = [4, 5] R01 + (R13  R'13) = (R01 + R13)  (R01 + R'13) R01 + (R13  R'13) = [2, 5] + [4, 5] = [6, 10] (R01 + R13)  (R01 + R'13) = [5, 10]  [6,17] = [6, 10] Here, path consistency guarantees minimality and decomposability R’13 R13 =[3,5] R23=[1,8] R12=[3,4] V1 V3 V2 V0 R01=[2,5]

Composition Distributes over  PC-1 generalizes Floyd-Warshall algorithm (all-pairs shortest path), where composition is ‘scalar addition’ and intersection is ‘scalar minimal’ PC-1 generalizes Warshall algorithm (transitive closure) Composition is logical OR Intersection is logical AND

Convex constraints: temporal reasoning (again!) Thanks to Xu Lin (2002) Constraints of bounded difference are convex We triangulate the graph (good heuristics exist) Apply PPC: restrict propagations in PC to triangles of the graph (and not in the complete graph) According to [Bliek & Sam-Haroud 99] PPC becomes equivalent to PC, thus it guarantees minimality and decomposability

Summary Alert: Do not confuse a consistency property with the algorithms for reinforcing it Local consistency methods Remove inconsistent values (node, arc consistency) Remove Inconsistent tuples (path consistency) Get us closer to the solution Reduce the ‘size’ of the problem & thrashing during search Are ‘cheap’ (i.e., polynomial time) Global consistency properties are the goal we aim at Sometimes (special constraints, graphs, etc) local consistency guarantees global consistency E.g., Distributivity property in PC, row-convex constraints, special networks Sometimes enforcing local consistency can be made cheaper than in the general case E.g., functional constraints for AC, triangulated graphs for PC