*Guide to Constraint
Programming*
*©
Roman Barták, 1998*
**Up**

The Partial Constraint Satisfaction (PCSP) scheme of Freuder and Wallace is an interesting extension of CSP, which allows the relaxation and optimization of problems via weakening the original CSP.

A theory of **Partial
Constraint Satisfaction Problems** (PCSPs) has been developed to
weaken systems of constraints which have no solutions
(over-constrained systems), or for which finding a solution would
take too long. Instead of searching for a solution to a complex
problem, it is considered searching for a simpler problem which we
know we can solve.

The notion of a partial CSP is formalized by considering three components:

<(P,U), (PS,<=), (M,(N,S))>

where

- P is a
*constraint satisfaction problem*(CSP), U is a*set of 'universes'*i.e. a set of potential values for each of the variables in P, - (PS,<=) is a
*problem space*with PS a set of problems and <= a*partial order*over problems, - M is a
*distance function*over the problem space, and (N,S) are*necessary and sufficient bounds*on the distance between the given problem P and some solvable member of the problem space PS.

A **solution** to a PCSP is
a problem P' from the problem space and its solution, where the
distance between P and P' is less than N. If the distance between P
and P' is minimal, then this solution is optimal.

A problem space PS is a partially-ordered set of CSPs where the order <= is defined as follows (sols(P)denotes the set of solutions to a CSP calledP):P<=_{1}P_{2}iff sols(P_{1}) is a superset of sols(P_{2})Note that the ordering is over problems, but defined in terms of solutions.

The problem space for a PCSP must contain the original problem P, which can provide the maximal element in the order. The obvious problem space to explore when trying to weaken a problem is the collection of all problems Q such that Q<=P, but it may be useful to consider only some of these Qs, i.e., those problems which have been weakened in a particular way.

There are four ways to weaken a CSP:

- enlarging the domain of a variable (e.g., buy new shoes; see above example),
- enlarging the domain of a constraint (e.g., certain shoes do, after all, go with a certain shirt),
- removing a variable (e.g., decide not to wear shoes at all),
- removing a constraint (e.g., ignore clashes between shoes and shirts).
Freuder shows that all cases can be considered in terms of case 2 above, i.e.,

- the domain of the variable is defined by an unary constraint, so enlarge the domain of this constraint,
- ---
- remove all constraints on the variable (see 4),
- enlarge a constraint until it equals to the Cartesian product of domains of all involved variables.

Different distance functions are possible, but the obvious one is derived from the partial order on the problems space.

- M(P,P') equals the number of solutions not shared by P and P' (when P'<=P then the distance function measures how many solutions have been added by the relaxation of P)
- M(P,P') equals the number of constrain values not shared by P and P'.

Example in PCSP

Consider the problem of choosing matching clothes from the introductory section to over-constrained problems.S::{r,w}, F::{c,s}. T::{b,d,g}C_{ST}::{(r,g),(w,b),(w,d)} C_{FT}::{(s,d),(c,g)} C_{SF}::{(w,c)}.We will only augment constraints with pairs whose elements are in the domain of variables concerned. Here are examples of such weakened problems (additional pairs are in bold):

C

_{ST}::{(r,g),(w,b),(w,d)}C

_{FT}::{(s,d),(c,g)}C

_{SF}::{(w,c),(w,s)}C

_{ST}::{(r,g),(w,b),(w,d),(w,g)}C

_{FT}::{(s,d),(c,g),(s,b)}C

_{SF}::{(w,c),(w,s)}C

_{ST}::{(r,g),(w,b),(w,d),(r,b)}C

_{FT}::{(s,d),(c,g),(c,d)}C

_{SF}::{(w,c),(r,s)}C

_{ST}::{(r,g),(w,b),(w,d),(w,g),(r,b)}C

_{FT}::{(s,d),(c,g),(s,b),(c,d)}C

_{SF}::{(w,c),(w,s),(r,s)}Assuming a simple distance function, namely that we prefer solutions involving the smallest total number of augmentations, we discover there are five equally good solutions, each with just one of the constraints receiving one extra pair of values. One solution is

(S,F,T)=(w,s,d), the other four solutions are (w,c,b), (w,c,d), (w,c,g), (r,c,g) including some involving augmentations not listed above.

**Up**
*Designed and
maintained by **Roman
Barták*