WPI Worcester Polytechnic Institute

Computer Science Department
------------------------------------------

Constraint Satisfaction

Background/Description

Constraint satisfaction problems consist of variables, possible values (a domain) for each variables, and constraints between the pairs of variables. The goal is to assign values to each variable so that none of the constraints are violated. There are many variants on this problem. In some cases, constraints may "relaxed" if no solution can be found otherwise, in other cases, the number of variables may change depending on previous choices. The latter case is referred to as Dynamic Constraint Satisfaction and is the problem addressed by this project.

References

Books and Papers

Mackworth, A. K. Constraint Satisfaction. I. Shapiro, S. C. (ed.), Encyclopedia of Artificial Intelligence, Vol. I, 2nd Edition, John Wiley & Sons, New York, 1990

This paper gave an overview of Constraint Satisfaction along with some examples. This was used in creating the overview section of the presentation. The crossword puzzle example comes from this paper.

Mittal S., Falkenhainer B., Dynamic Constraint Satisfaction Problems, Proc. 8th Nat. Conf. on AI, AAAI-90, 1990, pp. 25-32.

This paper provided the algorithm used in this project. The paper described Dynamic Constraint Satisfaction and the different types of constraints involved. It also provided rules for one of the two applications used to test the program (the car configuration task). One thing I did not like about the paper is that the sample run for the car configuration task did not seem to use the heuristics that they said it did.

Yoder E. J., Witczak, M.W., "Principles of Pavement Design," John Wiley and Sons, pp. 504-518.

This textbook was used to create the rules for the pavement design task used to test the program. This book described different types of material used for the different layers and the thicknesses required.

Web References:

These were used for background information only. Other References:

James W. Burge (Civil Engineering Domain Expert) helped with the pavement design rules.

Problem

The problem addressed by this project is Dynamic Constraint Satisfaction. In this system, values will be assigned to variables in order to not violate constraints. In some cases, variables will not be required by the system. This approach could be used for many design applications. The two used in this project were a car configuration task with rules provided by the Mittal and Faulkenhainer paper and a pavement design task. The car configuration task assigns values to variables describing a car (package, frame, engine, air conditioning, etc.). The pavement design task determines the layers of paving material, the material type, and the depth of each layer. This is influenced by the volume of traffic expected on the road and two cost factors: the distance materials must be transported (this primarily affects the cost of sand and gravel) and production cost (this affects how much asphalt should be used).

Prototype Specification

The system built for this project will be designed so that it can be used for any design problem that involves assigning values to variables based on constraints.

Inputs:

Variable input file containing variables expressed in the following format:

(variablename (value1 value2 ... valuen) initial) where the last field indicates if it is an initial variable or not.

Activity constraint file (activity constraints define which variables may or may not be active):

( IF (variable1 = value) RTYPE variable2) or ((variable1) RTYPE variable2) where RTYPE has the following values:

RV - required variable
ARV - always require variable (regardless of value of variable 1)
RN - require not - don't use variable2
ARN - always require not - don't use variable2, no matter what variable 1 value is

Compatibility constraint file:

( IF (variable1 = value) THEN (variable2 = value)) (NOT will be used to signify not equal)

User Inputs:

The user is allowed to run the program in either brief (only the initial variables and final solution are printed) or verbose (all variable assignments and rule choices are printed) mode. The user is also given the option of entering values for the initial variables.

Algorithm:

The algorithm used will be based on the one in [Mittal, Faulkenhainer 1990]. Results from the algorithm vary depending on what heurisics are used to choose variables and their values. Initially, the heuristics used will be "smallest domain" for variable choice and "first value" for variable values. This will not produce very intersting results, so the program will also give the user the option of selecting required values for variables. The program will then produce a solution, if possible, to conform to those additional constraints.

Output:

The output of the program will consist of a list of the initial variables and their initial values and a list of the solution variables and their final values.

Solution

The dynamic constraint satisfaction program has been written. It consists of the following parts: A sample run for the car configuration task and a sample run for the pavement design task is available. These runs show the program in both verbose and brief output modes.

Program Assumptions and Limitations

The program does not allow NOT rules for the activity constraints. The paper does not list this as a requirement (and it was not in the original problem specification for this project) but it could be potentially useful. Also, only AND rules are allowed. If something is true for several variables, multiple rules must be written.

User Manual

The program is run in ibcl as follows:

ibcl
(load "dcsp")
(dcsp)

The user then follows the instructions given for specifying the mode (brief or verbose) and any initial variable values as desired.

Configuration files are required to be named vars.cfg, act_cons.cfg, and comp_cons.cfg.

Project Presentation

My presentation slides are all on-line.

Rational for Problem Choice

My thesis area is Knowledge Elicitation, with an emphasis on using KE for design problems. Constraint satisfaction is a major part of design so doing a project on constraint satisfaction should give me more exposure to design problems.

[Return to the WPI Homepage] [Return to the CS Homepage] [Return to Janet's Home Page]