Principles of Intelligent Systems Constraint Satisfaction + Local Search Written by Dr John Thornton School of IT, Griffith University Gold Coast.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Patrick Prosser. An Example, Exam Timetabling Someone timetables the exams We have a number of courses to examine how many? Dept.
Constraint Satisfaction Problems Russell and Norvig: Chapter
Constraint Satisfaction Problems
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.
This lecture topic (two lectures) Chapter 6.1 – 6.4, except 6.3.3
1 Finite Constraint Domains. 2 u Constraint satisfaction problems (CSP) u A backtracking solver u Node and arc consistency u Bounds consistency u Generalized.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
Constraint Processing and Programming Introductory Exemple Javier Larrosa.
Constraint Satisfaction Problems. Constraint satisfaction problems (CSPs) Standard search problem: – State is a “black box” – any data structure that.
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Research Information Session Associate Professor John Thornton Gold Coast BIT Honours Degree Convenor
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Constraint Satisfaction
Constraint Satisfaction Problems Russell and Norvig: Chapter 3, Section 3.7 Chapter 4, Pages Slides adapted from: robotics.stanford.edu/~latombe/cs121/2003/home.htm.
Artificial Intelligence
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 2 Ryan Kinworthy CSCE Advanced Constraint Processing.
Constraint Satisfaction Problems
Constraint Satisfaction Problems
ISC 4322/6300 – GAM 4322 Artificial Intelligence Lecture 4 Constraint Satisfaction Problems Instructor: Alireza Tavakkoli September 17, 2009 University.
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.
CP Summer School Modelling for Constraint Programming Barbara Smith 1.Definitions, Viewpoints, Constraints 2.Implied Constraints, Optimization,
Relaxation and Hybrid constraint processing Different relaxation techniques Some popular hybrid techniques.
Constraint Satisfaction Problems Chapter 6. Review Agent, Environment, State Agent as search problem Uninformed search strategies Informed (heuristic.
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.
Constraint Satisfaction Russell & Norvig Ch. 5. Overview Constraint satisfaction offers a powerful problem- solving paradigm –View a problem as a set.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
Chapter 5 Constraint Satisfaction Problems
Hard Problems Sanghyun Park Fall 2002 CSE, POSTECH.
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.
Tommy Messelis * Stefaan Haspeslagh Patrick De Causmaecker *
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.
Backtracking & Brute Force Optimization Intro2CS – weeks
Computing & Information Sciences Kansas State University Friday, 08 Sep 2006CIS 490 / 730: Artificial Intelligence Lecture 7 of 42 Friday, 08 September.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
Lecture 5: 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.
Where are the hard problems?. Remember Graph Colouring? Remember 3Col?
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
Constraint Satisfaction Problems
1 Hojjat Ghaderi [Courtesy of Fahiem Bacchus], University of Toronto, Fall 2006 CSC384: Intro to Artificial Intelligence Backtracking Search I ● Announcements.
Hard Problems Some problems are hard to solve.  No polynomial time algorithm is known.  E.g., NP-hard problems such as machine scheduling, bin packing,
Cse 150, Fall 2012Gary Cottrell: Many slides borrowed from David Kriegman! Constraint Satisfaction Problems Introduction to Artificial Intelligence CSE.
Constraint Satisfaction Problems Lecture # 14, 15 & 16
Title: Suggestion Strategies for Constraint- Based Matchmaker Agents
CS 188: Artificial Intelligence
Computer Science cpsc322, Lecture 14
Chapter 3: Finite Constraint Domains
Running example The 4-houses puzzle:
Artificial Intelligence
Constraint satisfaction problems
Constraint Satisfaction Problems. A Quick Overview
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Constraint satisfaction problems
Constraint Satisfaction Problems (CSP)
Presentation transcript:

Principles of Intelligent Systems Constraint Satisfaction + Local Search Written by Dr John Thornton School of IT, Griffith University Gold Coast

Outline q The Constraint Satisfaction Paradigm q Variables, Domains and Constraints q Example Problem Domains q Constraint Satisfaction Algorithms ê Local Search Algorithms q Summary

The Constraint Satisfaction Paradigm q Knowledge represented by constraints ê What is allowed or disallowed. q Transforms broad range of problems into a computable form q Standard representation means general purpose algorithms can be used ê solvers ‘know’ how to solve problems ê issue becomes how to model a problem

Variables, Domains and Constraints q A Constraint Satisfaction Problem (CSP) is: ê a set of variables each with ê a set of domain of values, and ê a set of constraints that define which combinations of variable values are allowed ê the task is to find a domain value for each variable such that all constraints are simultaneously satisfied

Problem Domains q N-Queens q Satisfiability Problems q Binary Constraint Satisfaction q Nurse Rostering q University Timetabling

Local Search Algorithms q Getting ‘stuck’ q Variable and Constraint-based Search q Random Walk q Tabu Search ê NOVELTY and RNOVELTY q Constraint Weighting

Satisfiability Problems q Conjunctive Normal Form: Example {  x  y  z}  {x  y   z}  {  x  y}  {  y  z} q To Solve: ê All clauses evaluate true ê e.g.: x = false, y = true, z = true q As a CSP: ê Each clause is a constraint, each literal is a variable with a {true, false} domain

Predicate to Conjunctive Form q Predicate:  (X) (dog (X)  animal (X))  Clause: (  dog(X)  animal(X)) q Clause is false only if  dog(X) is false and animal(X) is false, i.e. if X is a dog and X is not an animal - in other words if X is a dog then X is an animal

Binary Constraint Satisfaction q Two variable constraint representation q Non-binary to binary transformation q Phase transition: p 2crit = 1 - m -2/p1(n - 1) where p 1 = constraint density p 2 = constraint tightness m = uniform domain size n = number of variables

Nurse Scheduling

Binary Constraint Representation Variable 1 Variable

Random Walk Local Search q if randomly generated probability < p: ê Take best cost local move q else: ê Take randomly selected local move

Tabu Search q if cost(best local move) < best cost yet: ê Take best local move q else ê Take best cost local move from the set of domain values that have not been used in the last n moves

The Eight Queens Problem Variable Constraint Domain

Constraint Satisfaction Algorithms q Backtracking ê Algorithm ê 8-Queens Example ê 8-Queens Performance q Local Search ê Algorithm ê 8-Queens Example ê 8-Queens Performance

Summary q Constraint Satisfaction ê practical knowledge representation ê allows general purpose approaches q Algorithms ê Backtracking ê Local Search

Backtracking Algorithm V = list of all variables v i (i = 1 to n) U = empty TryVariable() select next v i from V and move to U for each domain value d i of v i if d i satisfies all constraints with U Value(v i ) = d i if(V is empty) SaveSolution() else TryVariable() move v i from U back to V

Basic Local Search Algorithm assign a domain value d i to each variable v i while no solution and not stuck and not timed out bestCost   ;bestList   ; for each variable v i | Cost(Value(v i )) > 0 for each domain value d i of v i if Cost(d i ) < bestCost bestCost  Cost(d i ); bestList  d i ; else if Cost(d i ) = bestCost bestList  bestList  d i Take a randomly selected move from bestList

Backtracking Performance

Local Search Performance

Local Search Diagram

Eight Queens using Backtracking Try Queen 1 Try Queen 2Try Queen 3Try Queen 4Try Queen 5 Stuck! Undo move for Queen 5 Try next value for Queen 5 Still Stuck Undo move for Queen 5 no move left Backtrack and undo last move for Queen 4 Try next value for Queen 4 Try Queen 5Try Queen 6 Try Queen 7 Stuck Again Undo move for Queen 7 and so on...

Place 8 Queens randomly on the board Eight Queens using Local Search Pick a Queen: Calculate cost of each move Take least cost move then try another Queen Answer Found

Variable/Constraint-based Search q Variable-based search: ê Randomly select variable in constraint violation ê Try all domain values for that variable q Constraint-based search: ê Randomly select a violated constraint ê Try all domain values for all variables in the constraint that improve the constraint

NOVELTY q select best and second best cost moves that improve a violated constraint q if best cost move not most recent or p >= random value ê select best cost move q else ê select second best cost move

RNOVELTY q Same as NOVELTY except when best cost move is also most recent, then : q if second best cost - best cost <= c or p < random value ê select second best cost move q else ê select best cost move

Constraint Weighting q Add weight to all constraints violated at a local minimum: graph colouring example q Use these weights to calculate cost of subsequent moves q Adding weights changes shape of cost surface: “fills in” the minimum

Constraint Weighting Example q Graph Colouring a green b green c red d green c ab = 2w c ac = 0 c cd = 0 c bd = w c bc = 0 a green b red c red d green c ab = 0 c ac = 0 c cd = 0 c bd = 0 c bc = w a green b green c red d red c ab = w c ac = 0 c cd = w c bd = 0 c bc = 0 (a) Local minimum, cost 2w (b) After Weighting, cost 3w (c) Final solution, cost w