Constraint Satisfaction Problem

Constraint Satisfaction
Problem
BY SYED HISAR ABBAS RIZVI
Definition:
Constraint satisfaction problems (CSPs) are mathematical problems
defined as a set of objects whose state must satisfy a number of
constraints or limitations. CSPs represent the entities in a problem as
a homogeneous collection of finite constraints over variables, which
is solved by constraint satisfaction methods. CSPs are the subject of
intense research in both artificial intelligence and operations
research, since the regularity in their formulation provides a
common basis to analyze and solve problems of many seemingly
unrelated families.
Examples
:
Simple problems that can be modeled as a constraint satisfaction problem include
1.
Eight queens puzzle
2.
Map coloring problem
3.
Sudoku, Crosswords, Futoshiki, Kakuro (Cross Sums), Numbrix, Hidato and many other logic puzzles
"Real life" examples include automated planning and resource allocation. An example for puzzle solution
is using a constraint model as a Sudoku solving algorithm.
Eight queens puzzle
The eight queens puzzle is the problem of
placing eight chess queens on an 8×8
chessboard so that no two queens threaten
each other. Thus, a solution requires that no two
queens share the same row, column, or
diagonal.
Specifying Constraint Problems
A constraint satisfaction problem (CSP) consists of
a set of variables,
a domain for each variable, and
a set of constraints.
Task that can be Performed
1.
Determine whether or not there is a model.
2.
Find a model.
3.
Find all of the models or enumerate the models.
4.
Count the number of models.
5.
Find the best model, given a measure of how good models are.
6.
Determine whether some statement holds in all models.
Solving a CSP
Backtracking search
Forward checking
Arc consistency
Backtracking
Backtracking is a general algorithm for finding all (or some) solutions to some computational
problems, notably constraint satisfaction problems, that incrementally builds candidates to the
solutions, and abandons each partial candidate c ("backtracks") as soon as it determines that c
cannot possibly be completed to a valid solution.
Backtracking example
Backtracking example
Backtracking example
Backtracking example
Real-world CSPs
Assignment problems
◦ e.g., who teaches what class
Timetabling problems
◦
e.g., which class is offered when and where?
Transportation scheduling
Factory scheduling
Improving Backtracking Efficiency
General-purpose methods can give huge gains in speed:
◦ Which variable should be assigned next?
◦ In what order should its values be tried?
◦ Can we detect inevitable failure early?
4 Feb 2004
CS 3243 - CONSTRAINT SATISFACTION
14