Constraint-based problem solving n Model problem ä specify in terms of constraints on acceptable solutions ä define variables (denotations) and domains.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Hybrid BDD and All-SAT Method for Model Checking Orna Grumberg Joint work with Assaf Schuster and Avi Yadgar Technion – Israel Institute of Technology.
Artificial Intelligence 15. Constraint Satisfaction Problems
Fast optimal instruction scheduling for single-issue processors with arbitrary latencies Peter van Beek, University of Waterloo Kent Wilken, University.
Towards theoretical frameworks for comparing constraint satisfaction models and algorithms Peter van Beek, University of Waterloo CP 2001 · Paphos, Cyprus.
Non-Binary Constraint Satisfaction Toby Walsh Cork Constraint Computation Center.
Non-binary Constraints Toby Walsh
Constraint Programming Peter van Beek University of Waterloo.
Turing Machines January 2003 Part 2:. 2 TM Recap We have seen how an abstract TM can be built to implement any computable algorithm TM has components:
Tintu David Joy. Agenda Motivation Better Verification Through Symmetry-basic idea Structural Symmetry and Multiprocessor Systems Mur ϕ verification system.
Sep 16, 2013 Lirong Xia Computational social choice The easy-to-compute axiom.
Theory of NP-Completeness
Constraint Satisfaction Problems Russell and Norvig: Chapter
University of Toronto Mechanical & Industrial Engineering An Introduction to Constraint Programming J. Christopher Beck Dept. of Mechanical & Industrial.
Global Constraints Toby Walsh NICTA and University of New South Wales
Problems and Their Classes
Time Complexity P vs NP.
Sep 15, 2014 Lirong Xia Computational social choice The easy-to-compute axiom.
Tree Clustering for Constraint Networks 1 Chris Reeson Advanced Constraint Processing Fall 2009 By Rina Dechter & Judea Pearl Artificial Intelligence,
Distributed Constraint Satisfaction Problems M OHSEN A FSHARCHI.
13-Optimization Assoc.Prof.Dr. Ahmet Zafer Şenalp Mechanical Engineering Department Gebze Technical.
Parallel algorithms for expression evaluation Part1. Simultaneous substitution method (SimSub) Part2. A parallel pebble game.
Constraint Optimization We are interested in the general non-linear programming problem like the following Find x which optimizes f(x) subject to gi(x)
Constraint Satisfaction taking advantage of internal structure of states when paths don’t matter.
The Project Problem formulation (one page) Literature review –“Related work" section of final paper, –Go to writing center, –Present paper(s) to class.
Interactive Configuration
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
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:
Exploiting Symmetry in Planning Maria Fox Durham Planning Group University of Durham, UK.
Artificial Intelligence Constraint satisfaction problems Fall 2008 professor: Luigi Ceccaroni.
1 Backdoor Sets in SAT Instances Ryan Williams Carnegie Mellon University Joint work in IJCAI03 with: Carla Gomes and Bart Selman Cornell University.
Constraint Processing and Programming Introductory Exemple Javier Larrosa.
1 Optimisation Although Constraint Logic Programming is somehow focussed in constraint satisfaction (closer to a “logical” view), constraint optimisation.
Constraint Satisfaction Problems
1 Backdoors To Typical Case Complexity Ryan Williams Carnegie Mellon University Joint work with: Carla Gomes and Bart Selman Cornell University.
Constraint Systems Laboratory March 26, 2007Reeson–Undergraduate Thesis1 Using Constraint Processing to Model, Solve, and Support Interactive Solving of.
Distributed Scheduling. What is Distributed Scheduling? Scheduling: –A resource allocation problem –Often very complex set of constraints –Tied directly.
1 Combinatorial Problems in Cooperative Control: Complexity and Scalability Carla Gomes and Bart Selman Cornell University Muri Meeting March 2002.
Constraint Satisfaction Problems
Building “ Problem Solving Engines ” for Combinatorial Optimization Toshi Ibaraki Kwansei Gakuin University (+ M. Yagiura, K. Nonobe and students, Kyoto.
IBM Labs in Haifa © Copyright IBM SVRH: Non-local stochastic CSP solver with learning of high-level topography characteristics Yehuda Naveh Simulation.
An Introduction to Programming and Algorithms. Course Objectives A basic understanding of engineering problem solving process. A basic understanding of.
Introduction to Job Shop Scheduling Problem Qianjun Xu Oct. 30, 2001.
Constraint Satisfaction Problems (CSPs) CPSC 322 – CSP 1 Poole & Mackworth textbook: Sections § Lecturer: Alan Mackworth September 28, 2012.
Modelling for Constraint Programming Barbara Smith CP 2010 Doctoral Programme.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Conformant Probabilistic Planning via CSPs ICAPS-2003 Nathanael Hyafil & Fahiem Bacchus University of Toronto.
Chapter 5 Constraint Satisfaction Problems
Constraints and Search Toby Walsh Cork Constraint Computation Centre (4C) Logic & AR Summer School, 2002.
AI Lecture 17 Planning Noémie Elhadad (substituting for Prof. McKeown)
Accelerating Random Walks Wei Wei and Bart Selman.
272: Software Engineering Fall 2012 Instructor: Tevfik Bultan Lecture 9: Test Generation from Models.
Robust Planning using Constraint Satisfaction Techniques Daniel Buettner and Berthe Y. Choueiry Constraint Systems Laboratory Department of Computer Science.
Eliminating non- binary constraints Toby Walsh Cork Constraint Computation Center.
Dana Nau: Lecture slides for Automated Planning Licensed under the Creative Commons Attribution-NonCommercial-ShareAlike License:
Automatic Test Generation
Constraint Satisfaction Problems (CSPs) Introduction
Hybrid BDD and All-SAT Method for Model Checking
Integer Programming An integer linear program (ILP) is defined exactly as a linear program except that values of variables in a feasible solution have.
Planning as Search State Space Plan Space Algorihtm Progression
Constraint Satisfaction Problems (CSPs) Introduction
Chapter 6. Large Scale Optimization
Objective of This Course
Constraint Programming and Backtracking Search Algorithms
Constraint satisfaction problems
Constraint Satisfaction Problems
Constraint satisfaction problems
Chapter 6. Large Scale Optimization
Presentation transcript:

Constraint-based problem solving n Model problem ä specify in terms of constraints on acceptable solutions ä define variables (denotations) and domains ä define constraints in some language n Solve model ä define search space / choose algorithm –incremental assignment / backtracking search –complete assignments / stochastic search ä design/choose heuristics n Verify and analyze solution

n Model problem ä specify in terms of constraints on acceptable solutions ä define variables (denotations) and domains ä define constraints in some language n Solve model ä define search space / choose algorithm –incremental assignment / backtracking search –complete assignments / stochastic search ä design/choose heuristics n Verify and analyze solution Constraint-based problem solving Constraint Satisfaction Problem

Constraint satisfaction problem n A CSP is defined by ä a set of variables ä a domain of values for each variable ä a set of constraints between variables n A solution is ä an assignment of a value to each variable that satisfies the constraints

Example: Crossword puzzles

CSP, binary CSP, SAT, 3-SAT, ILP,... n Model and solve in one of these languages n Model in one language, translate into another to solve Options

Article of faith Constraints arise naturally in most areas of human endeavor. They are the natural medium of expression for formalizing regularities that underlie the computational and physical worlds and their mathematical abstractions. P. Van Hentenryck and V. Saraswat Constraint Programming: Strategic Directions

Reducibility NP-Complete 3-SAT ILP CSP binary CSP (0,1)-ILP

CSP, binary CSP, SAT, 3-SAT, ILP,... n Model and solve in one of these languages n Model in one language, translate into another to solve Options

Importance of the model In integer programming, formulating a good model is of crucial importance to solving the model. G. L. Nemhauser and L. A. Wolsey Handbook in OR & MS, 1989 Same for constraint programming. Folk Wisdom, CP practitioners

Measures for comparing models n How easy is it to –write down, –understand, –modify, debug, –communicate? n How computationally difficult is it to solve?

Constraint systems/languages

Abstractions n Capture commonly occurring constraints ä special propagation algorithms ä e.g. alldifferent, cardinality, cumulative,... n User-defined constraints ä full power of host language

CSP versus ILP n OO databases versus Relational databases n C++ versus C n C++ versus Fortran n C++ versus Assembly language

Computational difficulty? n What is a good model depends on algorithm n Choice of variables defines search space n Choice of constraints defines ä how search space can be reduced ä how search can be guided

Improving model efficiency Given a model: n Add/remove variables, values, constraints (keep the denotation of the variables) n Use/translate to a different representation (change the denotation of the variables)

Adding redundant constraints n Improve computational efficiency of model by adding right constraints ä symmetries removed ä dead-ends encountered earlier in search process n Three methods: ä add hand-crafted constraints during modeling ä apply a consistency algorithm before solving ä learn constraints while solving

Examples: n Adding hand-crafted constraints: ä crossword puzzles n Applying a consistency algorithm: ä dual representation

Adding redundant variables n Variables that are abstractions of other variables ä e.g, decision variables Suppose x has domain {1,…,10} Add Boolean variable to represent decisions (x < 5), (x 5) n Variables that represent constraints

Translations between models n Improve computational efficiency by completely changing the model ä change denotation of variables –e.g, convert from non-binary to binary ä aggregate variables –e.g, timetabling multiple sections of a course n Not much as has been done on either the theory or the practice side

Conversion to binary n Any CSP can be converted into one with only binary constraints n Two techniques known ä dual graph method (Dechter & Pearl, 1989) ä hidden variable method (Peirce, 1933; Dechter 1990) n Translations are polynomial if constraints are represented extensionally

( x 1 x 2 x 6 ) ( x 1 x 3 x 4 ) ( x 4 x 5 x 6 ) ( x 2 x 5 x 6 ) n Non-binary CSP: ä Boolean variables: x 1, …, x 6 ä constraints: one for each clause 3-SAT example C 1 (x 1, x 2, x 6 ) = {(0,0,1), (0,1,0), (0,1,1), (1,0,0), (1,0,1), (1,1,0), (1,1,1)} C 2 (x 1, x 3, x 4 ) =...

Dual graph representation y 1 = ( x 1, x 2, x 6 ) y 4 = ( x 2, x 5, x 6 ) y 2 = ( x 1, x 3, x 4 ) y 3 = ( x 4, x 5, x 6 ) x 2, x 6 x 5, x 6 x4x4 x6x6 x1x1

Hidden variable representation x1x1 x2x2 x3x3 x4x4 x5x5 x6x6 h1h1 h2h2 h3h3 h4h4

n Non-binary constraint: n Augmented constraint: n Binary constraints: Hidden variable representation C 1 (x 1, x 2, x 6 ) = {(0,0,1), (0,1,0), (0,1,1), (1,0,0), (1,0,1), (1,1,0), (1,1,1)} C 1 (x 1, x 2, x 6, h 1 ) = {(0,0,1,0), (0,1,0,1), (0,1,1,2), (1,0,0,3), (1,0,1,4), (1,1,0,5), (1,1,1,6)} R 1 (x 1, h 1 ) = {(0,0), (0,1), (0,2), (1,3), (1,4), (1,5), (1,6)} R 2 (x 2, h 1 ) = {(0,0), (1,1), (1,2), (0,3), (0,4), (1,5), (1,6)} R 3 (x 6, h 1 ) = {(1,0), (0,1), (1,2), (0,3), (1,4), (0,5), (1,6)}

x1 x1 x2x2 x3 x3 h1 h1 h2h2 h3 h3 Dual exponentially worse FC on non-binary: O(n) consistency checks FC on dual: O(2 n ) consistency checks x 1, x 1 x 2, x 1 x 2 x 3,..., x 1 … x n-1 x n

x1 x1 x2x2 x3 x3 h1 h1 h2h2 h3 h3 Dual exponentially better FC on non-binary: O(n2 n ) consistency checks FC on dual: O(n 2 ) consistency checks x 1 … x n-1, x 1 … x n-2 x n, …, x 2 … x n

n Worst case: n Best case: Bounds on performance FC(non-binary) FC + (hidden) d k FC + (hidden) FC (non-binary) d n

Crossword puzzles a aardvark aback abacus abaft abalone abandon... Mona Lisa monarch monarchy monarda... zymurgy zyrian zythum

Crossword puzzles

Model of random non-binary CSP n n variables ä each with domain size d n m constraints ä each with k variables, chosen at random ä each with t tuples, chosen at random

Order of magnitude curves (number of constraints) / (number of variables) (number of tuples in constraints) / (maximum tuples) n = 20 d = 2 k = 3 n = 20 d = 10 k = 3 n = 20 d = 10 k = 5 n = 20 d = 2 k = 5

Random 3-SAT

n Given start state, goal state, and actions: determine a plan (a sequence of actions) Box1 Project: Planning Box2

Contrasts n CP philosophy/methodology ä emphasis on modeling, domain knowledge ä general purpose search algorithm –backtracking with constraint propagation n Successful ä e.g., can solve practical scheduling problems

Contrasts n Planning philosophy/methodology ä emphasis on minimal model –just representation of actions ä special-purpose search algorithms n Not as successful ä has not solved many practical problems

Tradeoffs n Robust CSP model needed for each new domain ä can require much intellectual effort n Less work needs to be done on algorithms ä many general purpose constraint solvers available

CSP model of planning n State-based model ä model each state by a collection of variables ä constraints enforce valid transitions between states n Example: logistics world ä variable for each package, truck, plane ä domains of packages: all locations, trucks, planes ä domains of trucks, planes: all locations

CSP model: constraints (I) n Action constraints ä model the effects of actions ä patterned after explanation closure axioms n State constraints ä variables within a state must be consistent

Improving model efficiency n Can add/remove/aggregate/decompose ä variables ä domain values ä constraints n Here: ä added hidden variables ä added redundant & symmetry-breaking constraints

CSP model: constraints (II) n Symmetric values constraints ä break symmetries on values variables can be assigned n Action choice constraints ä break symmetries on equivalent permutations of actions

CSP model: constraints (III) n Domain constraints ä restrictions on original domains of variables n Capacity constraints ä bounds on resources n Distance constraints ä bounds on steps needed for a variable to change from one value to another

Solving the CSP model n Given an instance of a planning problem ä generate a model with one step in it ä instantiate variables in the initial and goal states ä search for a solution (GAC+CBJ) ä repeat, incrementing number of steps, until plan is found n Properties: ä forwards, backwards, or middle out planner ä sound, complete, guaranteed to terminate

Experiments n Five test domains from AIPS98 n Five planners: ä CPlan ä Blackbox (Kautz & Selman) ä HSP (Bonet & Geffner) ä IPP (Koehler & Nebel) ä TLPlan (Bacchus & Kabanza) n Setup: ä machines: 400MHz Pentium IIs ä resources: 1 hour CPU time, 256 Mb memory

Gripper problems

Logistics problems

Mystery problems

MysteryPrime problems

Grid problems

Related work n Planning as a CSP ä satisfiability (Kautz & Selman) ä ILP (e.g., Bockmayr & Dimopoulos) n Adding declarative knowledge to improve efficiency ä hand-coded (e.g, Kautz & Selman, Bacchus & Kabanza) ä automatically derived (e.g., Fox & Long, Nebel et al.)

Project: Resource-constrained instruction scheduling (I) n Modern architectures (VLIW) allow instruction level parallelism ä multiple functional units n Compiler to generate code that takes advantage of parallelism ä resource-constrained scheduling task a: j i + h b: k i + g c: l j + 1 1: a, b 2: c

Project: Resource-constrained instruction scheduling (II) n Current methods: ä heuristic ä recent: integer linear programming approach n Project: ä investigate constraint programming approach ä GNU compiler, MERCED chip

Project: Theoretical analysis of alternative models n Improve computational efficiency by completely changing the model ä change denotation of variables –e.g, convert from non-binary to binary ä aggregate variables –e.g, timetabling multiple sections of a course n Not much as has been done on either the theory or the practice side

Conclusions n Importance of the model ä ease of modeling is important ä form of model is important n Constraint programming advantages ä succinctness, declarativeness of models ä flexibility in specifying model ä on some classes of problems: speed

Conclusions n Advantages shared with CSP-like approaches ä expressiveness of modeling language ä declarativeness of models ä independence of model and solving algorithm n Advantages over other CSP-like approaches ä succinctness of models ä robustness: scales well, not as brittle ä speed

Future Work n Approximate planning ä heuristic CSP models ä solve same CSP models using local search n Alternative CSP models ä action-based models vs state-based models ä finding the right model can be key to solving difficult combinatorial problems