Artificial Intelligence: Constraint Satisfaction Problems
Artificial Intelligence: Constraint Satisfaction Problems
Constraint Satisfaction
Problems
By Harshit Mogalapalli
Recall
• Search problems:
– A set of variables, X = {X 1 , X 2 , · · · X n }
Example:
{ WA=red, NT=green, Q=red, NSW=green,V=red, SA=blue,T=green }
Real-world CSPs
• Assignment problems, e.g., who teaches what class?
• Hardware configuration
• Transportation scheduling
• Factory scheduling
• Floor planning
Variables:
Each (open) square
Domains:
{1,2,…,9}
Constraints:
• Continuous variables:
– Common in operations research
• MRV: Choose the variable with the fewest legal values in its
domain
Variables: V = {A 1 , · · · , A 9 , B 1 , · · · , B 9 , · · · , I 1 · · · I9 }, |V | = 81.
Domain: D = {1, 2, ·· · , 9}, the filled squares have a single value.
Constraints: 27 constraints
• Alldiff(A 1 , A 2 , A 3 , A 4 , A 5 , A 6 , A 7 , A 8 , A 9 )
···
• Alldiff(A 1 , B 1 , C 1 , D 1 , E 1 , F 1 , G 1 , H 1 , I 1 )
···
• Alldiff(A 1 , A 2 , A 3 , B 1 , B 2 , B 3 , C 1 , C 2 , C 3 )
Constraint propagation
• F orward checking propagates information from assigned
to unassigned variables.
• Observe: