Comments on Mohr and Henderson's Path Consistency

Similar documents
Path Consistency Revisited. Moninder Singh. University of Pennsylvania. Philadelphia, PA

Efficient Path Consistency Algorithms for Constraint Satisfaction Problems

Arc Consistency for Dynamic CSPs

A New Algorithm for Singleton Arc Consistency

Rajiv Chopra, Rohini Srihari and Anthony Ralston. labeling problem. However, these are dicult to

Path Consistency on Triangulated Constraint Graphs*

An Efficient Arc Consistency Algorithm for a Class of CSP Problems

Why AC-3 is Almost Always Better than AC-4 for Establishing Arc Consistency in CSPs*

2-C3OP: An Improved Version of 2-Consistency

/463 Algorithms - Fall 2013 Solution to Assignment 3

Constraint Satisfaction Problems (CSPs)

MUSE CSP: An Extension to the Constraint Satisfaction Problem

Chapter 3 Dynamic programming

Tree Decomposition with Applications to Constraint Processing

Recitation 3 Problems

Making AC-3 an Optimal Algorithm

VALCSP solver : a combination of Multi-Level Dynamic Variable Ordering with Constraint Weighting

Implementation of Arc Consistency

Class2: Constraint Networks Rina Dechter

Efficient Algorithms for Functional Constraints

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

Module 10. Network Simplex Method:

y i = S i ΠS y i + S i ΠN\S

Other approaches. Marco Kuhlmann & Guido Tack Lecture 11

Approximation Algorithms for Temporal Reasoning

Parallel algorithms for generating combinatorial objects on linear processor arrays with reconfigurable bus systems*

Efficient Parallel Binary Search on Sorted Arrays

and 6.855J. The Successive Shortest Path Algorithm and the Capacity Scaling Algorithm for the Minimum Cost Flow Problem

1. (a) O(log n) algorithm for finding the logical AND of n bits with n processors

Search. Krzysztof Kuchcinski. Department of Computer Science Lund Institute of Technology Sweden.

An efficient consistency algorithm for the Temporal Constraint Satisfaction Problem

Class 2 Constraint Networks

Set 5: Constraint Satisfaction Problems

Set 5: Constraint Satisfaction Problems

Methods and Models for Combinatorial Optimization Exact methods for the Traveling Salesman Problem

Perception of a Quadrilaleral

Winning Positions in Simplicial Nim

Domain Dependence in Parallel Constraint Satisfaction

Set 5: Constraint Satisfaction Problems Chapter 6 R&N

Algebraic Properties of CSP Model Operators? Y.C. Law and J.H.M. Lee. The Chinese University of Hong Kong.

CSL 730: Parallel Programming. Algorithms

Mathematics. 2.1 Introduction: Graphs as Matrices Adjacency Matrix: Undirected Graphs, Directed Graphs, Weighted Graphs CHAPTER 2

6.034 Quiz 1, Spring 2004 Solutions

Faster Constraint Satisfaction Algorithms for Temporal Reasoning' (*)

Optimal and Suboptimal Singleton Arc Consistency Algorithms

CSE 373 Analysis of Algorithms, Fall Homework #3 Solutions Due Monday, October 18, 2003

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

Constructive Search Algorithms

Artificial Intelligence

A COMPARISON OF ATMS AND CSP TECHNIQUES

Parallel Asynchronous Connected Components in a Mesh

A Parameterized Local Consistency for Redundant Modeling in Weighted CSPs

Branch & Bound (B&B) and Constraint Satisfaction Problems (CSPs)

Consistency Techniques for Numeric CSPs

Algorithms and Complexity. Exercise session 3+4

CS 1110, LAB 12: SEQUENCE ALGORITHMS First Name: Last Name: NetID:

Lesson 06 Arrays. MIT 11053, Fundamentals of Programming By: S. Sabraz Nawaz Senior Lecturer in MIT Department of MIT FMC, SEUSL

12 Edit distance. Summer Term 2011

Set 5: Constraint Satisfaction Problems

A Note on the Complexity of a Simple Transportation Problem

The PRAM model. A. V. Gerbessiotis CIS 485/Spring 1999 Handout 2 Week 2

Department of Computer Science Purdue University, West Lafayette

Learning Objectives. c D. Poole and A. Mackworth 2010 Artificial Intelligence, Lecture 3.5, Page 1

Module 16: Data Flow Analysis in Presence of Procedure Calls Lecture 32: Iteration. The Lecture Contains: Iteration Space.

Hypercubes. (Chapter Nine)

Dynamic Programming. Outline and Reading. Computing Fibonacci

A FILTERING TECHNIQUE TO ACHIEVE 2-CONSISTENCY IN CONSTRAINT SATISFACTION PROBLEMS. Marlene Arangú, Miguel A. Salido and Federico Barber

Lecture 5: Matrices. Dheeraj Kumar Singh 07CS1004 Teacher: Prof. Niloy Ganguly Department of Computer Science and Engineering IIT Kharagpur

Constraint Satisfaction Problems

Privacy Preserving Collaborative Filtering

Some Applications of Graph Bandwidth to Constraint Satisfaction Problems

Transportation problem

Material handling and Transportation in Logistics. Paolo Detti Dipartimento di Ingegneria dell Informazione e Scienze Matematiche Università di Siena

Chapter 10. Fundamental Network Algorithms. M. E. J. Newman. May 6, M. E. J. Newman Chapter 10 May 6, / 33

1 Inference for Boolean theories

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

Dyck-Eulerian digraphs

Reasoning about Qualitative Temporal Information

The Service-Time Restricted Capacitated Arc Routing Problem

Chapter 3: Search. c D. Poole, A. Mackworth 2010, W. Menzel 2015 Artificial Intelligence, Chapter 3, Page 1

A Greedy Approach to Establish Singleton Arc Consistency

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

Path Consistency by Dual Consistency

Planning: Wrap up CSP Planning Logic: Intro

hen Space Assef Chmeiss and hilippe Jbgou LIM - URA CNRS 1787

Improved algorithm for the symmetry number problem on trees 1

Inconsistency and Redundancy Do Not Imply Irrelevance

A macro- generator for ALGOL

Lecture 13: Chain Matrix Multiplication

Admin. Quick search recap. Constraint Satisfaction Problems (CSPs)! Intro Example: 8-Queens. Where should I put the queens in columns 3 and 4?

A TIGHT BOUND ON THE LENGTH OF ODD CYCLES IN THE INCOMPATIBILITY GRAPH OF A NON-C1P MATRIX

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

Transaction Accessibility and Integrity Issues in Heterogeneous Distributed Database Systems

Solving problems on graph algorithms

Lecture 2: NP-Completeness

A strong local consistency for constraint satisfaction

Comments about assign 1. Quick search recap. Constraint Satisfaction Problems (CSPs) Search uninformed BFS, DFS, IDS. Adversarial search

John W. Sheppard and William R. Simpson

Algorithms: COMP3121/3821/9101/9801

Maximal Tractable Fragments of the Region Connection Calculus: A Complete Analysis

Transcription:

Purdue University Purdue e-pubs Computer Science Technical Reports Department of Computer Science 1988 Comments on Mohr and Henderson's Path Consistency Ching-Chih Han Chia-Hoang Lee Report Number: 88-733 Han, Ching-Chih and Lee, Chia-Hoang, "Comments on Mohr and Henderson's Path Consistency" (1988). Computer Science Technical Reports. Paper 632. http://docs.lib.purdue.edu/cstech/632 This document has been made available through Purdue e-pubs, a service of the Purdue University Libraries. Please contact epubs@purdue.edu for additional information.

COMMENTS ON MOHR AND HENDERSON'S PATH CONSISTENCY ALGORITHM Ching-Chili Han Chia-Hoang Lee CSD 1R 733 January 1988

Comments on Mohr and Henderson's Path Consistency Algorithm Ching-Chih Han and Chia-Hoang Lee Department of Computer Science Purdue University West Lafayette, m 47907 ABSTRACT Mohr and Henderson have presented new algorithms for arc and path consistency in [1]. Though the underlying ideas of their algorithms are correct, the path consistency algorithm PC-3 is in error. In this paper we point out the errors in this algorithm and give a correct one. The time complexity and space complexity of the revised algorithm are also analyzed. 1. Introduction In a recently published paper by Mohr and Henderson (M-H), new algorithms for arc and path consistency were presented. We show that the algorithm for path consistency is in error and give a refined solution. The idea of the arc consistency algorithm introduced by Mackworth [2] is based on the notion of support. Mohr and Henderson further made this support evident by using some data sliuctures to record the relevant supporting information. They use a counter for each arc-label pair [(ij),b] to indicate the number of labels at node j that support (are consistent with) the label b at node i. In addition, for each label c at node j, the member (i,b) of set Sjc is the label b at node i that is supponed by label c at node j. They also use a table, M, to keep track of which labels have been deleted from which nodes, and a list, List, to control the propagation of constraints. This idea has also been applied to the path consistency algorithm PC-3 stralghtforwardly. However, the path consistency algorithm is not completely correct. In section 2, we will point out the errors and give a counterexample. In section 3, we will give a correct path consistency algorithm PC-4. Note that a fonnal treatment of the concept of path consistency was first provided by Montanari [4]. This work is supported by Lhe Nauonal Sciencc FoundaUOll under the grant IRI-87020S3.

- 2-2. A Counterexample to Algorithm PC-3 Arc consistency algorilhms check the binary relation between each pair of nodes and delete any inconsistent labels from the admissible labeling set of each node. However, in path consistency algorithms, we cannot delete labels from the admissible labeling set of a node since we are considering the relations between two nodes instead of the labelings at a single node. To show that the algorithm PC-3 is not completely correct. let us examine the following example depicted in Figure 1. (Counter[(iJ).b.c] should be Counter[(iJ).k.b.c] on lines 26 and 27 of algorithm PC-3 in [I]) We wlll follow [2] and use matrix fonns to represent binary relations. N ={l.2.3} A ={b.c} E ={(1.2).(1.3).(2.3)} A, ={b.c} A 2 ={b.c} A 3 ={b.c} R 1 2 = b c b c [: ~] R 13 = R2j = b c b C b c [~ ~] b c [~ ~] T Rij = R ji Note that matrix Rij is the relation between i and j whose rows correspond to the possible labels for node i and columns to the possible labels for node j. (In algorithm PC-3 Rij(b,c) is represented by R (i,h,i,c).) For the entries of Rij. we use 1 to represent true and 0 to represent false. It is easy to see that (e, b, b) is the only solution of the above constraint satisfaction problem. However, after the first iteration of the for loop from line 2 to line 19 (see [I]). the data structures will be as follows:

-3- M[l,b] = 1, M[2,b] = 1, All other M's are zero, A, = (cj, A2 = (cj, A, ~ (b, cj, All S's are empty, List ~ ((1, b), (2, b)}. The two b's are removed from the sets A 1 and A 2 because there are no labels at node 3 that can support the relation R(1, b, 2, b). But we know that (c, b, b) is the solution of the constraint satisfaction problem. If set A2 does not contain label b, then (e, b, b) cannot be a final solution of the constraint satisfaction problem. The error comes from the deletion of label b from set A2 at line 17. Even though there is no label at node 3 that supports the binary relation R(1, b, 2, b), label b should not be deleted from set A2, since it may satisfy the constraints with other labels at node 1. We should, instead, just delete the binary relation R(1, b, 2, bj, i.e., set R(1, b, 2, b) equal to false. After algorithm PC-3 is finished, the final result will be: Al = () A 2 ~ (cj A, = (cj This is not a correct result since from it we can not find the solution (e, h, b) of the constraint satisfaction problem. We will give a revised path consistency algorithm, PC~4. in the next section and analyze its time and space complexities. 3. Revised Algorithm PC-4 Figure 2 is the revised algorithm PC-4 for path consistency. In algorithm PC-4, M is a table with index [i, b, j, c] (in fact M is a boolean matrix). Set Sibjc contains members of the form (k, d), where the binary relations Rik(b,d) and Rki(d,b) are supported by the binary relation Rij(b,c). We also use counters with indices of the form rei, b, i,e), k]. Counter[(i, b, i, cj, k] is the number of adolissible pairs (i, b) (k, d) that support the binary relation Rij(b,c), where d is any admissible label at node k. Note that Counter[(i, b, i, c), k] is essentially always equal to Counter[(i, c, i, bj, k]. If both of them equal to 0, then there is no admissible label at node k that can support the binary relation Rij(b,c). Hence, Rij(b,c) must be set to 0 (false). Step 1 1 M:=O; Sibj,:=Empty_set; List:=Empty; Counter:=O; 2 for (i,j) e E do

-4-3 for k = I, n do 4 for b E Ai do 5 for C E A j such that Rjj(b, c)=l do 6 begin 7 Total:= 0; 8 fordeakdo 9 if R",(b, d) = I and Rk/d, e)=1 Iben 10 begin 11 Total := Total + I; 12 Append(Sibkd, (j, c»; 13 Append(Sj'kd, (i, b»; 14 end; IS if Total = 0 Iben 16 begin 17 M[i, b, j, e]:=i; MU, e, i, b]:=i; 18 Ri/b, e):=o; Rji(e, b):=o; 19 end else 20 begin 21 Counter[(i, b, j, c), k] :~ Total; 22 Counter[(j, e, i, b), k] := Total; 23 end; 24 end; 25 initialize List witb [(i,bj,e)lm[i,bj,e]=mu,e,i,b]~1 and i<;;j; Step 2 26 while List not Empty do 27 begin 28 choose (k, d, I, e) from List and remove it from List; 29 for (j, c) e Skdl, do 30 begin 31 Counter[(k,dJ,e),n:~Counter[(k,dJ,e),n-l; 32 Counter[(j,e,k,d),n:=Counter[(j,e,k,d),n-l; 33 remove (j,e) from Skdl,; 34 remove (k,d) from Sj,,,; 35 if Counter[(k, d, j, c), n=o Ihen 36 if M[k, d, j, e]=o Ihen 37 begin 38 M[k, d, j, e]:~i; MU, e, k, d):=i; 39 Append(List, (k, d, j, c»);

- 5-40 Rki<d, c) :~ 0; Rjk(e, d) :~ 0; 41 end; 42 end; 43 for V, c) E SHd do 44 begin 45 Counter[(I,eJ,e),kj :=Counter[(I,eJ,e),k]-1; 46 Counter[v,e,l,e),k]:=Counter[V,e,I,e),k]-1; 47 remove v,e) from Skkd; 48 remove (I,e) from Sj'kd; 49 if Counter[(I, e, j, c), k]=o tben 50 if M[I, e, j, e]=o tben 51 begin 52 M[I, e, j, e]:~1; Mfj, e, I, e]:=1; 53 Append(List, (I, e, j, c)); 54 R'j(e, c) :~ 0; Rj/(e, e) := 0; 55 end; 56 end; 57 end Figure 2. Algorithm PC-4 The complexity analysis of the algorithm PC-4 is similar to that of the algorithm PC-3. The maximum number of times line 11 to line 13 will be executed is on the order of n 3 a 3 since lei is of order n 2 and lail = IAjl = IAkl 5: a (and k is from 1 to n in the for loop). For step 2, there are two ways to analyze its time complexity. First, since there are at most O(n 3 a 2 ) counters and each has a maximum value of a, line 31 to 34 and line 45 to 48 can be executed at most order O(n 3 a 3 ) times. (Remember that the index of Counter is of the form [(i, b. j, c), k]. There are O(n 3 ) different i's, j's, and k's and Oea 2 ) different b's and e's.) Second, the while loop is executed at most n 2 a 2 times since each edge can be put into List at most once for each different pair of labelings of its two ends. The for loop is bounded by the size of SkdIe which is of order na. So the total time for step 2 is O(n 3 a 3 ). Therefore, the time complexity of the whole algorithm is O(n 3 a 3 ). The space complexity of PC-4 is: Number of counters::;; O(n 3 a 2 ), Sum of the size of the different sets Sibjc ::;; na x L!Ajl x!ajl ::;; n 3 a 3 (Since each set Sibjc is of size na.) (i,j)enxn

- 6- So the space complexity of the whole algorithm is O(n 3 a 3 ). same time and space complexity as PC-3. Note that PC-4 has the 4. Conclusion Mohr and Henderson made an important observation which leads to the refinement of the arc and path consistency algorithms. However, they misuse labels at each node for the binary relations between a pair of nodes in the context of path consistency. In fact, one cannot delete the labels from the admissible labeling set of a node if there is any path inconsistency. Instead, one should remove the inconsistent relations by setting the relations to zero. This is the main error in the algorithm PC-3, and we have fixed it in the algorithm PC-4. Furthermore. the time complexity and space complexity of PC-4 are both O(n 3 a 3 ). 5. Acknowledgements The authors would like to thank the anonymous referees for their constructive remarks. REFERENCES 1. R. Mohr and T.C. Henderson, Arc and Path Consistency Revisited. Artificial Intelligence 28 (1986) 225-233. 2. Alan K. Mackworth, Consistency in Networks of Relations, Artificial Intelligence 8 (1977) 99-118. 3. Alan K. Mackworth and Eugene C. Freuder, The Complexity of Some Polynomial Network Consistency Algorithms for Constraint Satisfaction Problems, Artificial Intelligence 25 (1985) 65-74. 4. V. Montanari, Networks of Constraints: Fundamental Properties and Applications to Picture Processing, Inform. Sci. 7 (1974) 95-132.

- 7 - Figure 1. A counterexample to algorithm PC-3.