Instructor: Dr. Malek Mouhoub
Department of Computer Science
University of Regina
CS 820
1
7. Constraint-Based Reasoning
7. Constraint-Based Reasoning
7.1 Introduction
7.2 Systematic Search for CSPs
7.3 Constraint Propagation
7.4 Heuristics for CSPs
7.5 Iterative (non systematic) Algorithms for CSPs
7.6 Tree-structured CSPs
7.7 Constraint-Based Systems
CS 820
2
7.1 Introduction
7.1 Introduction
“Constraint programming represents one of the closest approaches computer science has yet made to the holy grail of programming : the user states the problem, the computer solves it.”
Eugene C. Freuder, Constraints, April 1997
CS 820
3
7.1 Introduction
Constraint satisfaction problems (CSPs)
Standard search problem: state is a “black box”—any old data structure that supports goal test, eval, successor
CSP:
state is defined by variables Vi with values from domain Di goal test is a set of constraints specifying allowable combinations of values for subsets of variables
Simple example of a formal representation language
Allows useful general-purpose algorithms with more power than standard search algorithms
CS 820
4
7.1 Introduction
Constraint Satisfaction Problem (CSP)
• A Constraint Satisfaction Problem (CSP) consist of:
– a set of variables X
= {x1 , . . . , xn },
– for each variable xi , a finite set Di of possible values (its domain),
– and a set of constraints restricting the values that the variables can simultaneously take. • A solution to a CSP is an assignment of a value from its domain to every variable, in such a way that every constraint is satisfied. We may want to find:
– just one solution, with no preference as to which one,
– all solutions,
– an optimal, or at least a good solution, given some objective function defined in terms of some or all of the variables.
• A CSP is often represented as a (hyper)graph.
CS 820
5
7.1 Introduction