43
14. Constraint Satisfaction Problems CS227 Spring 2011

14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP

14.

Constraint Satisfaction Problems

CS227Spring 2011

Page 2: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP

Outline

• Example of a Constraint Satisfaction Problem (CSP)• Representing a CSP• Solving a CSP

– Backtracking searchBacktracking search– Problem structure and decomposition

• Constraint logic programming• Summary• Summary

Page 3: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 4: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 5: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 6: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 7: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 8: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 9: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 10: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP

Outline

• Example of a Constraint Satisfaction Problem (CSP)• Representing a CSP• Solving a CSP

– Backtracking searchBacktracking search– Problem structure and decomposition

• Constraint logic programming• Summary• Summary

Page 11: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 12: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 13: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 14: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 15: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 16: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 17: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 18: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 19: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 20: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 21: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 22: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 23: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 24: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 25: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 26: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 27: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 28: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 29: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 30: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 31: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 32: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP

Outline

• Example of a Constraint Satisfaction Problem (CSP)• Representing a CSP• Solving a CSP

– Backtracking searchBacktracking search– Problem structure and decomposition

• Constraint logic programming• Summary• Summary

Page 33: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 34: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 35: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 36: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 37: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 38: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP

Outline

• Example of a Constraint Satisfaction Problem (CSP)• Representing a CSP• Solving a CSP

– Backtracking searchBacktracking search– Problem structure and decomposition

• Constraint logic programming• Summary• Summary

Page 39: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP

Constraint Logic Programmingg g g

• A constraint logic program is a logic program that contains constraints in the body of clauses

A(X,Y) :-X+Y>0, B(X)B(X), C(Y)

Constraints are stored in a constraint store and evaluated using a CSP technique.

Page 40: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP

Example Applicationp pp

• Meeting scheduling video

Page 41: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP

Meeting Scheduling Constraintsg g

• The meeting room needs to be able to hold at least n people• The meeting room needs to have a projector (or sound equipment or

similar)• The appointment may be recurring and need to be at the same pp y g

time/location each week• I want at least 1 hour between appointments• If we are teleconferencing with our European office meetings needIf we are teleconferencing with our European office, meetings need

to be scheduled at an appropriate time• Bob will only attend appointments if Gary is not present• I will only attend a maximum of 3 appointments in a given day• I will only attend a maximum of 3 appointments in a given day• I need to meet before a deadline• I prefer meetings near my residence/office

Page 42: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP
Page 43: 14. Constraint Satisfaction Problems - Stanford University · 2011-05-13 · Outline • Example of a Constraint Satisfaction Problem (CSP) • Representing a CSP • Solving a CSP

Readingg

• Chapter on Constraint Satisfaction Problems in Russell and Norvig – Chapter 5 in 2nd edition– Chapter 6 in 3rd edition