Thursday, 07 January 2016Edward Tsang (Copyright)1 Constraint Satisfaction for Decision Making Professor Edward Tsang University of Essex URL:

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.
G5BAIM Artificial Intelligence Methods
Constraint Satisfaction Problems Russell and Norvig: Chapter
Local Search Jim Little UBC CS 322 – CSP October 3, 2014 Textbook §4.8
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) Oct, 5, 2012.
Constraint Satisfaction Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001.
This lecture topic (two lectures) Chapter 6.1 – 6.4, except
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
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.
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
Multi-agent Oriented Constraint Satisfaction Authors: Jiming Liu, Han Jing and Y.Y. Tang Speaker: Lin Xu CSCE 976, May 1st 2002.
1 Optimisation Although Constraint Logic Programming is somehow focussed in constraint satisfaction (closer to a “logical” view), constraint optimisation.
Artificial Intelligence Constraint satisfaction Chapter 5, AIMA.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Constraint Satisfaction Problems
Constraint Satisfaction
Metaheuristics The idea: search the solution space directly. No math models, only a set of algorithmic steps, iterative method. Find a feasible solution.
Constraint Satisfaction Problems
Constraint Satisfaction Problems
1 Constraint Satisfaction Problems Slides by Prof WELLING.
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.
Edward Tsang Research Business applications of Artificial Intelligence Constraint satisfaction & optimization research –A branch of combinatorial optimisation.
Local Search CPSC 322 – CSP 5 Textbook §4.8 February 7, 2011.
Search Methods An Annotated Overview Edward Tsang.
1 Chapter 5 Advanced Search. 2 Chapter 5 Contents l Constraint satisfaction problems l Heuristic repair l The eight queens problem l Combinatorial optimization.
15 July 2005Edward Tsang (Copyright)1 Constraint Satisfaction and Optimization Professor Edward Tsang University of Essex URL:
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.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Constraint Satisfaction CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
CSC 8520 Spring Paula Matuszek Based on Hwee Tou Ng, aima.eecs.berkeley.edu/slides-ppt, which are based on Russell, aima.eecs.berkeley.edu/slides-pdf.
Searching by Constraint CMSC Artificial Intelligence January 24, 2008.
Hande ÇAKIN IES 503 TERM PROJECT CONSTRAINT SATISFACTION PROBLEMS.
Chapter 5: Constraint Satisfaction ICS 171 Fall 2006.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
CSC 8520 Spring Paula Matuszek CS 8520: Artificial Intelligence Search 3: Constraint Satisfaction Problems Paula Matuszek Spring, 2013.
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.
1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3 Grand Challenge:
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
Constraint Satisfaction Problems University of Berkeley, USA
Put a different number in each circle (1 to 8) such that adjacent circles cannot take consecutive numbers.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
Computation: Potentials and Limitations Edward Tsang.
Contents 1 Systematic Search Guided by Local Search with Conflict-based Heuristic in N-queen problem Hyoung rae Kim Debasis Mitra Ph.D Florida Institute.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
Constraint Propagation Artificial Intelligence CMSC January 22, 2002.
Lecture 5: Constraint Satisfaction Problems
CS 561, Session 8 1 This time: constraint satisfaction - Constraint Satisfaction Problems (CSP) - Backtracking search for CSPs - Local search for CSPs.
Local Search Algorithms
Computer Science cpsc322, Lecture 14
Computer Science cpsc322, Lecture 14
Chapter 3: Finite Constraint Domains
Constraint Satisfaction Problems
Guided Local Search – CP Meets OR
Constraints and Search
Constraint Satisfaction Problems. A Quick Overview
Local Search Algorithms
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Presentation transcript:

Thursday, 07 January 2016Edward Tsang (Copyright)1 Constraint Satisfaction for Decision Making Professor Edward Tsang University of Essex URL:

Thursday, 07 January 2016Edward Tsang (Copyright)2 Constraint Satisfaction A non-technical introduction

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 3 Sample Constraint Applications Resources Allocation –Staff rostering, timetabling –British Telecom’s work force scheduling –British Airway’s flight scheduling Transportation –ILOG Dispatcher for vehicle routing –Train and bus scheduling –Collective transportation Logistics –Satellite scheduling –Radio links assignment (military & mobiles) –Telephone Network routing –Airport / container port Industrial Scheduling –Just-in-time scheduling –Hardware configuration –Car sequencing

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 4 Car Sequencing Problem Options ABS CD …   Total: 120 Production: ABS area:  3/5 CD area:  2/3

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 5 Airline Applications Constraint satisfaction and optimization are behind many applications in airline operations; e.g. British Airways uses ECLiPSe (IC-Parc) for scheduling aircraft to serve their flights and ILOG Solver for aircraft stand allocation at airports.

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 6 Transportation Constraint satisfaction is one of the core technologies in transportation optimization. For example Guided Local Search was used in ILOG Solver’s vehicle routing package, Dispatcher. Cairo/Line schedule for collective transportation.

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 7 BT’s Workforce Scheduling BT has many jobs to be done in UK every day. It has to schedule a large number of teams to serve these jobs, subject to time, skill and other constraints. Saving of 0.5% could mean Millions of Pounds per year. Guided Local Search achieved the best results in one of BT’s challenge problems. Technicians Jobs

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 8 CP in Steel Industry IBM helped Korea’s biggest steel manufacturer to apply constraint technology to schedule its production to meet orders. This include the allocation of existing stocks to orders, subject to various constraints, such as size, quality and colour, in order to minimize waste and cost. OrdersSteel Slabs

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 9 What is Constraint Satisfaction? Constraint satisfaction is a decision problem –You are given a number of decisions to make –For each decision, you are given all the choices –Decisions constrain each other Your task is to make those decisions without violating any of the constraints Sometimes you want the “best” solution –If so, you have a (constrained) optimisation problem

PRCSLSF The Constraint Satisfaction Problem Constraint satisfaction is a decision problem Task: make decisions without violating constraints Sometimes you want the “best” solution October 2003Edward Tsang (Copyright) 10 Variables (Decisions) Domains (values available) Constraints On assignments x1x1 x2x2 x3x3 x4x4 X X X X

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 11 Why constraint satisfaction? It is a very general problem (seen everywhere) –Mainly logistics, scheduling, resources allocation Specialized methods available Now multi-million Pounds/Dollars business Scientific challenges: –Combinatorial explosion (fundamental problem) –Modelling (engineering problem)

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 12 Combinatorial Explosion of the Car Sequencing Problem Schedule 30 cars: –Search space: 30 factorial  leaf nodes Generously allow: –Explore one in every leaf nodes! –Examine nodes per second! Problem takes over 32 thousand years to solve!!! –10 32 ÷ ÷ ÷ 60 ÷ 60 ÷ 24 ÷ 365  31,710 How to contain combinatorial explosion?

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 13 Combinatorial Explosion in the Car Sequencing Problem 120 cars of four models, 30, 30, 20, 40 each Number of combinations (size of search space): 120! ÷ (30! x 30! x 20! x 40!)  Let one processes 10 5 combinations per second Let a clever algorithm evaluates only one in every combinations The problem will take seconds, or years to solve by brute force search – clearly infeasible

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 14 Use The Force Constraints brought the problem here Constraints guide us to solutions Experts will follow the lead by constraints See Guided Local Search later The Incentive Method was used in financial forecasting and bargaining Reference to Daoism (Taoism)

Thursday, 07 January 2016Edward Tsang (Copyright)15 Constraint Satisfaction A more technical account

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 16 Constraint Satisfaction: What is it all about? Many problems involve finding combinations of values to variables, e.g. –Telecom services scheduling –Deciding where to put warehouses Combinatorial problems are hard in nature How big a problem can one solve? Constraint research aims to extend our boundaries in these problems –It’s all about algorithms, efficiency, problem solving …

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 17 Combinatorial Explosion ABCD EFG H Put 1 penny in square 1 2 pennies in square 2 4 pennies in square 3, etc. Even the world’s richest man can’t afford it –10 19 p = £100,000,000 Billion

Thursday, 07 January 2016Edward Tsang (Copyright)18 Problem Formulation (Modelling) Is my problem a constraint satisfaction problem? If so, I can apply established techniques

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 19 What is constraint satisfaction? Given: Z: a set of variable (Decisions) D: mapping each variable x to a domain Dx (fixed choices) C: constraints restricting the values that variables can take simultaneously Task: Assign one value to each variable satisfying all the constraints

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) ABCD EFG H The 8-Queens Constraint Satisfaction Problem Task: to put 8 queens onto the board such that no queen attacks others No two queens appear in the same row, column and diagonal Sample Solution

Constraint Techniques Overview 1. Problem ReductionProblem Reduction –To reduce domain size –To add or tighten constraints –Aims: To reduce a problem to easier ones To detect dead-ends To achieve backtrack- free search 2. Search Systematic Search –LookaheadLookahead –Learning nogoods or backtrack intelligently at dead-endsLearning nogoods backtrack intelligently at dead-ends –Ordering heuristicsOrdering heuristics Aim: to exhaustively search space Stochastic methods –To repair solutions heuristically Aim: to find solutions fast, sacrificing completeness 3. (Solution Synthesis)Solution Synthesis Constraint satisfaction Constrained optimisation

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) ABCD EFG H Backtracking Search In The 8-Queens Problem Place one queen per row Place one queen at a time Examine each column Backtrack at dead-ends X Complete search, till solution found, or “no solution” is concluded

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) ABCD EFG H Forward Checking Search Problem reduction –a major technique Combined with search methods Reduce domain of future variables Detect dead-ends –To backtrack early X X X X X X X X X X X X X X X X X X X X X X X X X XX X X X X X X X X X X Dead-end detected after Queen 4 – no legal space for row 6, backtrack…

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 24 Constraint Optimization Constraint Satisfaction & Optimization –Some solutions are better than others Partial Constraint Satisfaction –Accept best solution when no solution is found Relevant techniques: –Complete: Branch & Bound –Incomplete: HC, SA, Tabu, NN, GA, GLS

Thursday, 07 January 2016Edward Tsang (Copyright)25 Problem Reduction for Constraint Satisfaction Motivations: 1. Reduce problem to easier problems 2. Detect unsatisfiability

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 26 Problem Reduction Overview Node-consistency (NC) Arc-consistency (AC) Path-consistency (PC) (strong) k-consistency(strong) k-consistency Directional Arc-consistency (DAC) Other Consistency Properties (not covered) –Directional PC, Adaptive consistency,...

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 27 Node-consistency Principle of NC: –If unary constraint C x exists for variable x –Remove any value v from D x if v does not satisfy C x E.g. D x : days of the week; C x : this job must be done in weekdays Simple pre-processing strategy Cheap to compute: O(n)

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 28 Maintaining AC, Example Variables: x, y, z Domains: {1, 2, 3, 4} Constraints: x < y ; y < z x1234 y1234 z1234 x not supported by y and not supported by x X y not supported by z and & not supported by y X X XX Re-check x as now (with gone) it has no support from y X

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 29 Example: AC but Unsatisfiable This problem is AC But unsatisfiable Can we detect unsatisfiability? X YZ {r, g}   

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 30 Path-consistency Principle: –Tightening constraints –By constraint composition Algorithms: PC-1, …, PC-4 Complexity manageable: O(a 3 n 3 ) Is effort justifiable?

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 31 Binary Constraint Representation A Binary constraint may be represented by a matrix, e.g.: D x = D y = D z = {1, 2, 3} C xy : X + Y must be even C xz : at least one of X and Z must be equal to 2 x yz {1, 2, 3} Even(X+Y) Even(Y+Z) X=2  Z=2

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 32 Constraint Composition Constraint C xy & C yz could tighten C xz C xz = C xz  C xy * C yz x yz {1, 2, 3} Even(X+Y) Even(Y+Z) X=2  Z=  * =  = =

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 33 PC Detecting Unsatisfiability Given ( ), which satisfies C x,y It has no compatible value in z Hence not PC x yz {r, g}   

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 34 Example: PC but Unsatisfiable Problem is PC But unsatisfiable Can we detect unsatisfiability?  Z {r, g, b}     X W Y

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 35 Problem Reduction, Summary Aim: reduce problem to one that is easier to solve, or detect dead-ends Concept is simple, procedures could be complex General Concept: k-consistency –NC  1-C, AC  2-C, PC  3-C for binary CSPs NC & AC potentially reduce domains PC potentially tightens binary constraints k-C for k>2 potentially tightens k-1 constraints

Thursday, 07 January 2016Edward Tsang (Copyright)36 Complete Search Algorithms for Constraint Satisfaction Lookahead Gather-information-while-searching

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 37 Complete Search Strategies Overview Preprocessing –Problem reduction; problem transformation General Search –Chronological backtrackingChronological backtracking Lookahead –Forward Checking, DAC- & AC-LookaheadForward CheckingDAC-AC-Lookahead Gather-information-while-searching –DDBT, Learning Nogoods, BackmarkingDDBTLearning NogoodsBackmarking Hybrids, e.g. FC-BM-CBJ

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 38 Pre-processing – before search begins Problem reduction –1-consistency is always worth achieving –How about 2-consistency? 3-consistency? Problem transformation –Should redundant constraints be added? With A < B, B < C, would adding A < C help? –Should the problem be decomposed into sub- problems? Some sub-problems may be tractable E.g. cycle-cutset

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) ABCD EFG H Backtracking Search In The 8-Queens Problem Place one queen per row Place one queen at a time Examine each column Backtrack at dead-ends X Complete search, till solution found, or “no solution” is concluded

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 40 Lookahead Algorithms Lookahead so as to detect failure asap Reduce remaining problem More reduction requires more computation Does marginal gain justify marginal cost? MAC-Lookahead is effective in general –Key: to record support in maintaining AC

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 41 Forward Checking Algorithm FC: –Label one variable at a time –After each label is committed to: examine every future variable y remove every value v y from D y such that is incompatible with –Backtrack if any future domain becomes empty Found to be quite effective in general

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) ABCD EFG H Forward Checking Search Problem reduction –a major technique Combined with search methods Reduce domain of future variables Detect dead-ends –To backtrack early X X X X X X X X X X X X X X X X X X X X X X X X X XX X X X X X X X X X X Dead-end detected after Queen 4 – no legal space for row 6, backtrack…

Thursday, 07 January 2016Edward Tsang (Copyright)43 Stochastic Search Stochastic Search An element of randomness and statistics Hill ClimbingHill Climbing: Min-conflict, GSAT *Min-conflictGSAT Metaheuristic SearchMetaheuristic Search: GENET, GLS *, GGA *GENETGLSGGA * Note: not in Tsang 1993

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 44 Why Stochastic Search? Schedule 30 jobs to 10 machines: –Search space: leaf nodes Generously allow: –Explore one in every leaf nodes! –Examine nodes per second! Problem takes 300 years to solve!!! How to contain combinatorial explosion?

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 45 Background: Local Search Ingredients: –Cost function –Neighbourhood function –[Optional] Strategy for visiting neighbours e.g. steepest ascent Problems: –local optimum –Plateau –When to stop? Ok with satisfiability But not optimization local max. global max. Cost function plateau neighbourhood Assume maximization problem

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 46 HC Example: 2-opting for TSP Candidate tour: a round trip route Neighbour: exchange two edges, change directions accordingly A B C E D A B C E D

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 47 List reversing  2-Opting List representation: –A list could represent cities in sequence 2-Opting can be seen as sub-list reversing –Easy to implement Breaking points

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 48 Min-conflict Heuristic Repair Start with a random complete assignment –May initialise with min-conflict heuristic Repeat until all constraints are satisfied or run out of resources: –Randomly pick a variable x that is in conflict –Pick value v in domain of x such that violates the least number of constraints break ties randomly

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) ABCD EFG H MC Heuristic Repair, Example Start with random assignments C2 attacks G6 D8 attacks E7 Randomly pick one, say, E7, to repair Count number of conflicts in each square Randomly pick a square with least attacks, say, B Repeat repair X X X Solution found

PRCSLSF Thursday, 07 January 2016Edward Tsang (Copyright) 50 Meta-heuristics Hill Climbing e.g. 2-Opt in TSP Changing hill climbing behaviour mainly to escape local optima Tabu Search GENETGENET, GLSGLS Simulated Annealing (GGA)GGA