© J. Christopher Beck 20081 Lecture 13: Modeling in Constraint Programming.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

DCS Lecture how to solve it Patrick Prosser. Put a different number in each circle (1 to 8) such that adjacent circles cannot take consecutive numbers.
Constraint Programming Peter van Beek University of Waterloo.
University of Toronto Mechanical & Industrial Engineering An Introduction to Constraint Programming J. Christopher Beck Dept. of Mechanical & Industrial.
Constraint Satisfaction Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
Constraint Satisfaction Problems Russell and Norvig: Parts of Chapter 5 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
Lecture 11 Last Time: Local Search, Constraint Satisfaction Problems Today: More on CSPs.
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 CMSC 471 Fall 2002 Class #6 – Wednesday, September 18.
1 Constraint Satisfaction Problems. 2 Intro Example: 8-Queens Generate-and-test: 8 8 combinations.
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
Lecture 6: Job Shop Scheduling Introduction
© J. Christopher Beck Lecture 17: Tabu Search.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
Constraint Processing and Programming Introductory Exemple Javier Larrosa.
Lecture 10: Integer Programming & Branch-and-Bound
© J. Christopher Beck Lecture 12: Constraint Programming 2.
© J. Christopher Beck Lecture 15: CP Search.
Solving Problems with Constraints Karen E. Petrie.
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
Constraint Satisfaction Problems
Constraint Satisfaction
© J. Christopher Beck Lecture 11: Constraint Programming 1.
Constraint Satisfaction Problem Solving Chapter 5.
Chapter 5 Outline Formal definition of CSP CSP Examples
Distributed Scheduling. What is Distributed Scheduling? Scheduling: –A resource allocation problem –Often very complex set of constraints –Tied directly.
Constraint Satisfaction Not all problems are solved by a sequential series of steps. How do we solve other types of problems?
Constraint Satisfaction Problems
Constraint Satisfaction Problems
Constraint Programming for Supply Chain Management J. Christopher Beck Cork Constraint Computation Centre (4C) SCM Information Day, Nov.
Constraint Satisfaction Definition. A constraint is a formula of the form: (x = y) (x  y) (x = red) (x  red) Where x and y are variables that can take.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
Constraint Satisfaction Read Chapter 5. Model Finite set of variables: X1,…Xn Variable Xi has values in domain Di. Constraints C1…Cm. A constraint specifies.
Chapter 5 Section 1 – 3 1.  Constraint Satisfaction Problems (CSP)  Backtracking search for CSPs  Local search for CSPs 2.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
Artificial Intelligence CS482, CS682, MW 1 – 2:15, SEM 201, MS 227 Prerequisites: 302, 365 Instructor: Sushil Louis,
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
1 Chapter 5 Constraint Satisfaction Problems. 2 Outlines  Constraint Satisfaction Problems  Backtracking Search for CSPs  Local Search for CSP  The.
Chapter 5 Constraint Satisfaction Problems
Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
Chapter 2) CSP solving-An overview Overview of CSP solving techniques: problem reduction, search and solution synthesis Analyses of the characteristics.
An Introduction to Artificial Intelligence Lecture 5: Constraint Satisfaction Problems Ramin Halavati In which we see how treating.
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
Put a different number in each circle (1 to 8) such that adjacent circles cannot take consecutive numbers.
G51IAI Introduction to Artificial Intelligence
Solving BCSP using GA and PBIL Constraint Satisfaction Problem Group Sana Benhamida Andrea Roli Belgasem Ali Problem leader J.V.Hemert Jorge Tavares Group.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
BIL 472 SADI EVREN SEKER Constraint Satisfaction.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
1 CSC 384 Lecture Slides (c) , C. Boutilier and P. Poupart CSC384: Lecture 16  Last time Searching a Graphplan for a plan, and relaxed plan heuristics.
© J. Christopher Beck Lecture 16: Local Search.
Constraint Satisfaction Problems/Programming ZUI 2012/2013.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
Cse 150, Fall 2012Gary Cottrell: Many slides borrowed from David Kriegman! Constraint Satisfaction Problems Introduction to Artificial Intelligence CSE.
CS 561, Session 8 1 This time: constraint satisfaction - Constraint Satisfaction Problems (CSP) - Backtracking search for CSPs - Local search for CSPs.
Constraint Satisfaction Problems (CSPs)
Lecture 11: Tree Search © J. Christopher Beck 2008.
Constraint Propagation
Artificial Intelligence
Constraint satisfaction problems
Constraint Satisfaction
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

© J. Christopher Beck Lecture 13: Modeling in Constraint Programming

© J. Christopher Beck Outline Introduction The Crystal Maze Heuristics, Propagation, B&B Modeling in CP

© J. Christopher Beck Readings P Ch 5.5, D.2, D.3 B.M. Smith, “Modelling”, The Handbook of Constraint Programming, 2006.

© J. Christopher Beck Crystal Maze Place the numbers 1 through 8 in the nodes such that: Each number appears exactly once ? ? ? ? ? ? ?? –No connected nodes have consecutive numbers You have 5 minutes!

© J. Christopher Beck Modeling Each node  a variable {1, …, 8}  values in the domain of each variable No consecutive numbers  a constraint (v i, v j )  |v i – v j | > 1 All values used  all-different constraint

© J. Christopher Beck Heuristic Search ? ? ? ? ? ? ?? 18 {1, 2, 3, 4, 5, 6, 7, 8}

© J. Christopher Beck Inference/Propagation ? ? ? ? ? ? ?? 18 {1, 2, 3, 4, 5, 6, 7, 8}

© J. Christopher Beck Inference/Propagation ? ? ? ? ? ? ?? 18 {3, 4, 5, 6} {3, 4, 5, 6, 7}{2, 3, 4, 5, 6}

© J. Christopher Beck Generic CP Algorithm Assert Commitment Propagators Start Success Solution? Make Heuristic Decision Backtrack Technique Failure Nothing to retract? Dead-end?

© J. Christopher Beck With CP You Are … Guaranteed to find a solution if one exists If not you can prove there is no solution But you need to have enough time! On average, for many problems you can find a solution within a reasonable time CP is commercially successful for scheduling and other applications Questions?

© J. Christopher Beck The Core of CP Modeling How to represent the problem Heuristic search How to branch How much effort to find a good branch Inference/propagation How much effort Backtracking

© J. Christopher Beck Constraint Satisfaction Problem (CSP) Given: V, a set of variables {v 0, v 1, …, v n } D, a set of domains {D 0, D 1, …, D n } C, a set of constraints {c 0, c 1, …, c m } Each constraint, c i, has a scope c i (v 0, v 2, v 4, v 117, …), the variables that it constrains

© J. Christopher Beck Constraint Satisfaction Problem (CSP) A constraint, c i, is a mapping from the elements of the Cartesian product of the domains of the variables in its scope to {T,F} c i (v 0, v 2, v 4, v 117, …) maps: (D 0 X D 2 X D 4 X D 117 X … )  {T,F} A constraint is satisfied if the assignment of the variables in its scope are mapped to T

© J. Christopher Beck Constraint Satisfaction Problem (CSP) In a solution to a CSP: each variable is assigned a value from its domain: v i = d i, d i є D i each constraint is satisfied

© J. Christopher Beck Variables & Constraints Variables can be anything colors, times, countries, … often integer valued or binary Constraints are not limited to linear constraints extensional: list of acceptable value- combinations intensional: mathematical expression

© J. Christopher Beck Examples V = {v 1, v 2, …, v n } D i = {1, 2, …, n} all-diff(v 1, v 2, …, v n ) each of the variables must take on a different value v 1 > v 2 + v 4 v 4 = v 5 * v 6

© J. Christopher Beck n-Queens Problem Place n-Queens on the chess board so that no queen can attack any other

© J. Christopher Beck n-Queens Problem Variables? Constraints?

© J. Christopher Beck n-Queens Problem How about a different model?

© J. Christopher Beck Why Do We Care About Modeling? You need to represent your problem! As in MIP/LP different models are harder or easier to solve We will return to CP modeling (in a big way) in a few weeks