An Overview of Some Simple Constraints and Their ...

7 downloads 0 Views 169KB Size Report
To find the initial matching we can use the blossom-shrink algorithm by Edmonds ... relation on the vertices of the original graph, we are able to shrink blossoms.
An Overview of Some Simple Constraints and Their Filtering Algorithms Tony Tan, Martin Henz

Abstract

School of Computing, National University of Singapore 3 Science Drive 2, Singapore 117543

Constraint Satisfaction Problems (CSPs) are problems that involve nding values for some problem varibles subject to some accepted combinations. There are more and more real-life applications found based on these problems. Thus, the complexity of solving CSP is of high interest to many people. One common way to nd a solution of a CSP is to build a search tree based on the constraints. However, solving CSPs is generally NP-complete and many researchers are doing some work to improve the eciency of solving a CSP. One approach is a look-ahead approach. This approach is to remove certain values of the variables that are not instantiated and cannot lead to a solution with respect to a current partial instantiation. Filtering algorithm is one example. Filtering algorithm will remove once and for all certain inconsistencies that would have been discovered in our search tree several times otherwise. Here we study the characteristic of ltering algorithm. Along with that we study some CSPs and provide their ltering algorithms.

1 Introduction Constraint Satisfaction Problems (CSPs) form a simple formal frame to represent and solve some problems in Articial Intelligence. The problem of the existence of solutions in a CSP is NP-complete. Therefore, researchers have developed some methods to improve the complexity of some CSP. One of the way is through ltering algorithm. In this UROP report we will see some CSPs and their ltering algorithms. The report is divided into several sections. Second section is about notations and denitions that we are going to use throughout the report. In third section we provide a basic fact about the complexity of ltering algorithm. We give the descriptions of some CSPs in 4th section of which complexities we discuss in section 5. Then we give our conclusion in section 6.

2 Notations

A nite CSP (Constraint Satisfaction Problem) P = (X D C ) is dened on a set of variables X = fx1 : : : xng, a set of nite domains D = fDx1  : : : Dxn g where Dxi  Z is the set of possible values for variable xi and a set of constraints among some variables C = fC1 : : : Ckg. A constraint Ci is dened on a set of variables fxi1  : : : xik g by a subset of the cartesian product Dxi1  : : :  Dxik . An assignment of values to variables is a function : X 7! Z, and (xi ) 2 Dxi , where (xi ) = v denotes

value v is assigned to variable xi . A solution to a constraint C is an assignment of values to all variables dened in the constraint C which satises the constraint C. A solution to a nite CSP P = (X D C ) is an assignment  to all variables which satises all constraints, i.e. for all constraint Ci 2 C , dened on some set of variables fxij  : : : xik g, ((xij ) : : : (xik )) 2 Ci . We will denote by:  DX the union of domains of variables of X  X (i:e:DX = xi X Dxi ). 0

0

0

1

2

0

 XC the set of variables on which a constraint C is dened.  X (v ) the set of variables that take the value v in the assignment .  @(A ) the set of variables S that take their values from A in the assignment , where A is a set of integers (i:e:@(A ) = v A X (v ) ). Denition 1 Given a CSP P = (X D C). Let xi 2 X Dxi  Dxi is said completely-ltered if 8d 2 Dxi , 9 a solution to the CSP in which xi is assigned with value d and 8d 2 (Dxi ; Dxi ), @ any solution to the CSP in which xi is assigned with value d. The algorithm to get completely-ltered Dxi  8xi 2 X is called 2

0

0

0

0

filtering algorithm.

Denition 2 3] A CSP P = (X D C ) is arc-consistent i: 8xi 2 X , 8ai 2 D(xi), 8C 2 C constraining a set of variables XC , 8xj  : : : xk 2 XC , 9aj  : : : ak such that C(aj  : : : ai  : : : ak ) holds.

3 Preliminaries

Given a nite CSP P = (X D C ), one straight-forward ltering algorithm is to check one by one the values of each domain whether they belong to a particular solution or not. The algorithm is given as follow:

Algorithm GreedyFiltering(P = (X  D C)) f for all xi 2 X do for all d 2 Dx do FindSolution(P = (X  fDx  : : : fd g : : : Dx g C )) // Replace Dxi by fdg in D if there is a solution then mark d 2 Dx Delete all values d 2 Dx for all xi 2 X that are unmarked g Note that here we assume that FindSolution is able to solve P according to the constraints imposed and i

1

n

i

i

regarless of the domain given.(There are many problems that cannot be solved polynomially in general, but for some conditions of the domains the problems can be solved polynomially. One example is the problem to nd Hamiltonian Circuit which is NP-complete, but given a dense graph it can be solved polynomially.) From this algorithm we can conclude that if P in general has polynomial complexity, thenPits ltering algorithm also has polynomial complexity, i.e. O(N) the complexity of P , where N = xi X jDxi j. Obviously, given Dxi  Dxi for some xi we can also verify whether Dxi is completely-ltered in polynomial time. If we take its contrapositive, we will get as following: Given Dxi  Dxi , if its ltering algorithm is NP-hard but not in NP, i.e. its verication of Dxi is not in P, then P itself is NP-complete. Next, we will show that if P itself is NP-complete, then its ltering algorithm is NP-hard but does not belong to NP. Let say we have two following methods: 1. boolean VerifyFiltering(Dxi  xi P = (X D C )) return true if Dxi  Dxi is completely-ltered return false otherwise. 0

2

0

0

0

0

0

2

2. boolean AllSolution(Dxi  xi P = (X D C )) return true if 8d 2 Dxi  Dxi  9 a solution  in which (xi ) = d return false if 9d 2 Dxi , that @ any solution  to P in which (xi ) = d These two methods are actually of equivalent complexity, i.e. reducible to each other. 0

0

0

boolean VerifyFiltering(Dx  xi  P = (X  D C)) f boolean p = true for 8z 2 Dx ; Dx do p := p && :AllSolution(fz g xi P = (X  D C)) if (p == false) return false return AllSolution(Dx  xi  P = (X  D C)) g boolean AllSolution(Dx  xi  P = (X  D C)) f return VerifyFiltering(Dx  xi  P = (X  fDx  : : : Dx  : : : Dx g C )) ==Replace in D Dxi by Dxi g Then, we show that AllSolution is at least as hard as to nd the solution of P . Algorithm FindSolution(P = (X  D C)) f for 8xi 2 X do for 8d 2 Dx do if (AllSolution(fd g xi P = (X  D C))) f Replace in D Dx byfd g break g return Dx  : : :  Dx g So we can conclude: Given a nite CSP P = (X D C ). P is NP-complete if and only if its ltering 0

0

i

i

i

0

0

i

i

0

0

i

0

1

i

n

i

i

1

n

algorithm is NP-hard but does not belong to NP.

4 Some Problems on CSP Unary Resource Problem(URP)

A nite URP (Unary Resource Problem) UR = (X D) is a nite CSP with each variable xi 2 X has its own length xi :t and the constraints to satisfy are the Non ; Overlap constraints among the variables. The assignment of a value v to a variable xi with length xi:t in an assignment  is said to satisfy the non-overlap constraint i j@(fv : : : v + xi:t ; 1g )j = 1. Hence, we can say that a solution to a URP is an assignment of values to all variables in X which each assignment satises the non-overlap constraints among variables in X. This problem actually comes from the single-machine problem, where we are to nd a feasible schedule to do our jobs(variables) and we have only one machine to do it. We will give the algorithm for the case where we are given the total precedence constraint for the variables. We denote this problem by URP(

Suggest Documents