Constraint Programming: In Pursuit of the Holy Grail Roman Barták Charles University, Prague

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Constraint Satisfaction Problems Russell and Norvig: Chapter
Constraint Satisfaction Problems
1 Today’s class Interleaving backtracking and consistency checking Variable-ordering heuristics Value-ordering heuristics Intelligent backtracking Marie.
Constraint Satisfaction Problems Russell and Norvig: Parts of Chapter 5 Slides adapted from: robotics.stanford.edu/~latombe/cs121/2004/home.htm Prof: Dekang.
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.
ICS-271:Notes 5: 1 Lecture 5: Constraint Satisfaction Problems ICS 271 Fall 2008.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
Constraint Satisfaction problems (CSP)
On the Boundary of Planning and Scheduling: A Study Roman Barták Charles University, Prague
Review: Constraint Satisfaction Problems How is a CSP defined? How do we solve CSPs?
Programming with Constraints Jia-Huai You. Subject of Study Constraint Programming (CP) studies the computational models, languages, and systems for solving.
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.
Constraint Satisfaction Problems
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.
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 Problems
Constraint Satisfaction Problems
Constraint Programming: What is behind? Roman Barták Charles University, Prague
1 Constraint Programming: An Introduction Adapted by Cristian OLIVA from Peter Stuckey (1998) Ho Chi Minh City.
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,
CONSTRAINT PROGRAMMING Computer Science Seminar April 9 th, 2004 Kerem Kacel.
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.
Searching by Constraint CMSC Artificial Intelligence January 24, 2008.
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.
Chapter 5 Constraint Satisfaction Problems
Roman Barták Visopt B.V. (NL) / Charles University (CZ) IP&S in complex and dynamic areas Visopt Experience.
Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
Principles of Intelligent Systems Constraint Satisfaction + Local Search Written by Dr John Thornton School of IT, Griffith University Gold Coast.
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
Arc Consistency CPSC 322 – CSP 3 Textbook § 4.5 February 2, 2011.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
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.
Constraint Satisfaction Problems Russell and Norvig: Chapter 3, Section 3.7 Chapter 4, Pages CS121 – Winter 2003.
Constraint Programming for the Diameter Constrained Minimum Spanning Tree Problem Thiago F. Noronha Celso C. Ribeiro Andréa C. Santos.
Roman Barták (Charles University in Prague, Czech Republic) ACAT 2010.
PSU CS 370 – Introduction to Artificial Intelligence 1 Constraint Satisfaction Problems.
1 Constraint Satisfaction Problems (CSP). Announcements Second Test Wednesday, April 27.
CSCI 5240 Combinatorial Search and Optimization with Constraints
CSCI 5240 Combinatorial Search and Optimization with Constraints
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSCI 5240 Combinatorial Search and Optimization with Constraints
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Constraint Satisfaction Problems Lecture # 14, 15 & 16
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Constraint Satisfaction Problems
Artificial Intelligence
Constraint Programming: What is behind?
Constraint Satisfaction Problems
Constraint Satisfaction Problems. A Quick Overview
CS 8520: Artificial Intelligence
Constraint Satisfaction Problems
Presentation transcript:

Constraint Programming: In Pursuit of the Holy Grail Roman Barták Charles University, Prague

© Roman Barták, 1999 Talk Schedule Basic notions Historical context Constraint technology –constraint satisfaction –constraints optimisation –over-constrained problems Applications Summary –Advantages & Limitations Trends Resources

© Roman Barták, 1999 What is CP? CP = Constraint Programming –stating constraints about the problem variables –finding solution satisfying all the constraints constraint = relation among several unknowns Example: A+B=C, X>Y, N=length(S) … Features: –express partial informationX>2 –heterogeneousN=length(S) –non-directionalX=Y+2: X  Y+2  Y  X-2 –declarative manner“ –additiveX>2,X 2 –rarely independentA+B=5, A-B=1

© Roman Barták, 1999 The Origins Artificial Intelligence –Scene Labelling (Waltz) Interactive Graphics –Sketchpad (Sutherland) –ThingLab (Borning) Logic Programming –unification --> constraint solving Operations Research –NP-hard combinatorial problems

© Roman Barták, 1999 Scene Labelling first constraint satisfaction problem Task: recognise objects in 3D scene by interpreting lines in 2D drawings Waltz labelling algorithm –legal labels for junctions only –the edge has the same label at both ends

© Roman Barták, 1999 Interactive Graphics Sketchpad (Sutherland) ThingLab (Borning) –allow to draw and manipulate constrained geometric figures in the computer display

© Roman Barták, 1999 Solving Technology Constraint Satisfaction –finite domains -> combinatorial problems –95% of all industrial applications Constraints Solving –infinite or more complex domains –methods automatic differentiation, Taylor series, Newton method –many mathematicians deal with whether certain constraints are satisfiable (Fermat’s Last Theorem)

© Roman Barták, 1999 Constraint Satisfaction Problem Consist of: –a set of variables X={x 1,…,x n } –variables’ domains D i (finite set of possible values) –a set of constraints Example: X::{1,2}, Y::{1,2}, Z::{1,2} X = Y, X  Z, Y > Z Solution of CSP –assignment of value from its domain to every variable satisfying all the constraints Example: X=2, Y=2, Z=1

© Roman Barták, 1999 Systematic Search Methods exploring the solution space complete and sound efficiency issues Backtracking (BT) Generate & Test (GT) exploring individual assignments exploring subspace X Z Y

© Roman Barták, 1999 GT & BT - Example Problem: X::{1,2}, Y::{1,2}, Z::{1,2} X = Y, X  Z, Y > Z generate & test backtracking Systematic Search Methods

© Roman Barták, 1999 Consistency Techniques removing inconsistent values from variables’ domains graph representation of the CSP –binary and unary constraints only (no problem!) –nodes = variables –edges = constraints node consistency (NC) arc consistency (AC) path consistency (PC) (strong) k-consistency A B C A>5 ABAB A<C B=C

© Roman Barták, 1999 Arc Consistency (AC) the most widely used consistency technique (good simplification/performance ratio) deals with individual binary constraints repeated revisions of arcs AC-3, AC-4, Directional AC Consistency Techniques abcabc abcabc X Y abcabc Z

© Roman Barták, 1999 AC - Example Problem: X::{1,2}, Y::{1,2}, Z::{1,2} X = Y, X  Z, Y > Z Consistency Techniques X Y Z X Y Z

© Roman Barták, 1999 Is AC enough? empty domain => no solution cardinality of all domains is 1 => solution Problem: X::{1,2}, Y::{1,2}, Z::{1,2} X  Y, X  Z, Y  Z In general, consistency techniques are incomplete! Consistency Techniques X Y Z

© Roman Barták, 1999 Constraint Propagation systematic search only => no efficient consistency only => no complete Result: combination of search (backtracking) with consistency techniques methods: –look back (restoring from conflicts) –look ahead (preventing conflicts) look back Labelling order look ahead

© Roman Barták, 1999 Look Ahead - Example Problem: X::{1,2}, Y::{1,2}, Z::{1,2} X = Y, X  Z, Y > Z generate & test - 7 steps backtracking - 5 steps propagation - 2 steps Constraint Propagation

© Roman Barták, 1999 Stochastic and Heuristic Methods GT + smart generator of complete valuations local search - chooses best neighbouring configuration –hill climbing neighbourhood = value of one variable changed –min-conflicts neighbourhood = value of selected conflicting variable changed avoid local minimum => noise heuristics –random-walk sometimes picks next configuration randomly –tabu search few last configurations are forbidden for next step does not guarantee completeness

© Roman Barták, 1999 Connectionist approach Artificial Neural Networks –processors (cells) = on state means “value is assigned to the variable” –connections = inhibitory links between incompatible pairs GENET starts from random configuration re-computes states using neighbouring cells till stable configuration found (equilibrium) learns violated constraints by strengthening weights Incomplete (oscillation) X Y 1 2 Z variables values

© Roman Barták, 1999 Constraint Optimisation looking for best solution quality of solution measured by application dependent objective function Constraint Satisfaction Optimisation Problem –CSP –objective function: solution -> numerical value Note: solution = complete labelling satisfying all the constraints Branch & Bound (B&B) –the most widely used optimisation algorithm

© Roman Barták, 1999 Over-Constrained Problems What solution should be returned when no solution exists? impossible satisfaction of all constraints because of inconsistency Example: X=5, X=4 Solving methods –Partial CSP (PCSP) weakening original CSP –Constraint Hierarchies preferential constraints

© Roman Barták, 1999 Dressing Problem shirt: {red, white} footwear: {cordovans, sneakers} trousers: {blue, denim, grey} shirt x trousers: red-grey, white-blue, white-denim footwear x trousers: sneakers-denim, cordovans-grey shirt x footwear: white-cordovans Over-Constrained Problems red white blue denim grey cordovans sneakers shirt trousers footwear

© Roman Barták, 1999 Partial CSP weakening a problem: –enlarging the domain of variable –enlarging the domain of constraint  –removing a variable –removing a constraint one solution white - denim - sneakers Over-Constrained Problems enlarged constraint’s domain red white blue denim grey cordovans sneakers shirt trousers footwear

© Roman Barták, 1999 Constraint Hierarchies constraints with preferences solution respects the hierarchy –weaker constraints do not cause dissatisfaction of stronger constraint shirt x required footwear x strong shirt x weak two solutions red - grey - cordovans white - denim - sneakers Over-Constrained Problems red white blue denim grey cordovans sneakers shirt trousers footwear

© Roman Barták, 1999 Applications assignment problems –stand allocation for airports –berth allocation to ships –personnel assignment rosters for nurses crew assignment to flights network management and configuration –planning of cabling of telecommunication networks –optimal placement of base stations in wireless networks molecular biology –DNA sequencing analogue and digital circuit design

© Roman Barták, 1999 Scheduling Problems the most successful application area production scheduling (InSol Ltd.) well-activity scheduling (Saga Petroleum) forest treatment scheduling planning production of jets (Dassault Aviation)

© Roman Barták, 1999 Advantages declarative nature –focus on describing the problem to be solved, not on specifying how to solve it co-operative problem solving –unified framework for integration of variety of special- purpose algorithms semantic foundation –amazingly clean and elegant languages –roots in logic programming applications –proven success

© Roman Barták, 1999 Limitations NP-hard problems & tracktability unpredictable behaviour model stability too high-level (new constraints, solvers, heuristics) too low-level (modelling) too local non-incremental (rescheduling) weak solver collaboration

© Roman Barták, 1999 Trends modelling –global constraints (all_different) –modelling languages (Numerica, VisOpt) understanding search –visualisation, performance debugging hybrid algorithms solver collaboration parallelism multi-agent technology

© Roman Barták, 1999 Quotations “Constraint programming represents one of the closest approaches computer science has yet made to the Holy Grail of programming: the user states the problem, the computer solves it.” Eugene C. Freuder, Constraints, April 1997 “Were you to ask me which programming paradigm is likely to gain most in commercial significance over the next 5 years I’d have to pick Constraint Logic Programming, even though it’s perhaps currently one of the least known and understood.” Dick Pountain, BYTE, February 1995

© Roman Barták, 1999 Resources Conferences –Principles and Practice of Constraint Programming (CP) –The Practical Application of Constraint Technologies and Logic Programming (PACLP) Journal –Constraints (Kluwer Academic Publishers) Internet –Constraints Archive –Guide to Constraint Programming