Constraint Programming and Backtracking Search Algorithms

Slides:



Advertisements
Similar presentations
Attacking Cryptographic Schemes Based on Perturbation Polynomials Martin Albrecht (Royal Holloway), Craig Gentry (IBM), Shai Halevi (IBM), Jonathan Katz.
Advertisements

Fast optimal instruction scheduling for single-issue processors with arbitrary latencies Peter van Beek, University of Waterloo Kent Wilken, University.
QoS-based Management of Multiple Shared Resources in Dynamic Real-Time Systems Klaus Ecker, Frank Drews School of EECS, Ohio University, Athens, OH {ecker,
Discovering and Exploiting Program Phases Timothy Sherwood, Erez Perelman, Greg Hamerly, Suleyman Sair, Brad Calder CSE 231 Presentation by Justin Ma.
Simulated Annealing General Idea: Start with an initial solution
Constraint Programming for Compiler Optimization March 2006.
Optimal Instruction Scheduling for Multi-Issue Processors using Constraint Programming Abid M. Malik and Peter van Beek David R. Cheriton School of Computer.
A Simple Distribution- Free Approach to the Max k-Armed Bandit Problem Matthew Streeter and Stephen Smith Carnegie Mellon University.
1 Backdoor Sets in SAT Instances Ryan Williams Carnegie Mellon University Joint work in IJCAI03 with: Carla Gomes and Bart Selman Cornell University.
IBM Labs in Haifa © 2005 IBM Corporation Adaptive Application of SAT Solving Techniques Ohad Shacham and Karen Yorav Presented by Sharon Barner.
Dynamic Restarts Optimal Randomized Restart Policies with Observation Henry Kautz, Eric Horvitz, Yongshao Ruan, Carla Gomes and Bart Selman.
Constraint Processing and Programming Introductory Exemple Javier Larrosa.
All Hands Meeting, 2006 Title: Grid Workflow Scheduling in WOSE (Workflow Optimisation Services for e- Science Applications) Authors: Yash Patel, Andrew.
CPSC 322, Lecture 15Slide 1 Stochastic Local Search Computer Science cpsc322, Lecture 15 (Textbook Chpt 4.8) February, 6, 2009.
Constraint Systems Laboratory Oct 21, 2004Guddeti: MS thesis defense1 An Improved Restart Strategy for Randomized Backtrack Search Venkata P. Guddeti Constraint.
Statistical Regimes Across Constrainedness Regions Carla P. Gomes, Cesar Fernandez Bart Selman, and Christian Bessiere Cornell University Universitat de.
CP Formal Models of Heavy-Tailed Behavior in Combinatorial Search Hubie Chen, Carla P. Gomes, and Bart Selman
Feature Selection for Regression Problems
Solvable problem Deviation from best known solution [%] Percentage of test runs ERA RDGR RGR LS Over-constrained.
1 Backdoors To Typical Case Complexity Ryan Williams Carnegie Mellon University Joint work with: Carla Gomes and Bart Selman Cornell University.
Processing Rate Optimization by Sequential System Floorplanning Jia Wang 1, Ping-Chih Wu 2, and Hai Zhou 1 1 Electrical Engineering & Computer Science.
Statistical Learning: Pattern Classification, Prediction, and Control Peter Bartlett August 2002, UC Berkeley CIS.
Lukas Kroc, Ashish Sabharwal, Bart Selman Cornell University, USA SAT 2010 Conference Edinburgh, July 2010 An Empirical Study of Optimal Noise and Runtime.
Foundations of Constraint Processing, Fall 2004 November 18, 2004More on BT search1 Foundations of Constraint Processing CSCE421/821, Fall 2004:
1 Combinatorial Problems in Cooperative Control: Complexity and Scalability Carla Gomes and Bart Selman Cornell University Muri Meeting March 2002.
Hardness-Aware Restart Policies Yongshao Ruan, Eric Horvitz, & Henry Kautz IJCAI 2003 Workshop on Stochastic Search.
Simple search methods for finding a Nash equilibrium Ryan Porter, Eugene Nudelman, and Yoav Shoham Games and Economic Behavior, Vol. 63, Issue 2. pp ,
Distributions of Randomized Backtrack Search Key Properties: I Erratic behavior of mean II Distributions have “heavy tails”.
 1  Outline  stages and topics in simulation  generation of random variates.
Stochastic sleep scheduling (SSS) for large scale wireless sensor networks Yaxiong Zhao Jie Wu Computer and Information Sciences Temple University.
Can Cloud Computing be Used for Planning? An Initial Study Authors: Qiang Lu*, You Xu†, Ruoyun Huang†, Yixin Chen† and Guoliang Chen* from *University.
Dept. of Computer and Information Sciences : University of Delaware John Cavazos Department of Computer and Information Sciences University of Delaware.
Parallel Algorithm Configuration Frank Hutter, Holger Hoos, Kevin Leyton-Brown University of British Columbia, Vancouver, Canada.
CP Summer School Modelling for Constraint Programming Barbara Smith 2. Implied Constraints, Optimization, Dominance Rules.
Reactive Spin-locks: A Self-tuning Approach Phuong Hoai Ha Marina Papatriantafilou Philippas Tsigas I-SPAN ’05, Las Vegas, Dec. 7 th – 9 th, 2005.
Heavy-Tailed Phenomena in Satisfiability and Constraint Satisfaction Problems by Carla P. Gomes, Bart Selman, Nuno Crato and henry Kautz Presented by Yunho.
Resource Mapping and Scheduling for Heterogeneous Network Processor Systems Liang Yang, Tushar Gohad, Pavel Ghosh, Devesh Sinha, Arunabha Sen and Andrea.
Performance Prediction and Automated Tuning of Randomized and Parametric Algorithms Frank Hutter 1, Youssef Hamadi 2, Holger Hoos 1, and Kevin Leyton-Brown.
On the Performance of Window-Based Contention Managers for Transactional Memory Gokarna Sharma and Costas Busch Louisiana State University.
Performance Prediction and Automated Tuning of Randomized and Parametric Algorithms: An Initial Investigation Frank Hutter 1, Youssef Hamadi 2, Holger.
Quality of LP-based Approximations for Highly Combinatorial Problems Lucian Leahu and Carla Gomes Computer Science Department Cornell University.
1/22 Optimization of Google Cloud Task Processing with Checkpoint-Restart Mechanism Speaker: Sheng Di Coauthors: Yves Robert, Frédéric Vivien, Derrick.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
Performance of Distributed Constraint Optimization Algorithms A.Gershman, T. Grinshpon, A. Meisels and R. Zivan Dept. of Computer Science Ben-Gurion University.
Balance and Filtering in Structured Satisfiability Problems Henry Kautz University of Washington joint work with Yongshao Ruan (UW), Dimitris Achlioptas.
Optimal Superblock Scheduling Using Enumeration Ghassan Shobaki, CS Dept. Kent Wilken, ECE Dept. University of California, Davis
Determining Optimal Processor Speeds for Periodic Real-Time Tasks with Different Power Characteristics H. Aydın, R. Melhem, D. Mossé, P.M. Alvarez University.
Michael J. Voss and Rudolf Eigenmann PPoPP, ‘01 (Presented by Kanad Sinha)
Algorithmic and Domain Centralization in Distributed Constraint Optimization Problems John P. Davin Carnegie Mellon University June 27, 2005 Committee:
Formal Complexity Analysis of RoboFlag Drill & Communication and Computation in Distributed Negotiation Algorithms in Distributed Negotiation Algorithms.
A Graph Theoretic Approach to Cache-Conscious Placement of Data for Direct Mapped Caches Mirza Beg and Peter van Beek University of Waterloo June
Unified Adaptivity Optimization of Clock and Logic Signals Shiyan Hu and Jiang Hu Dept of Electrical and Computer Engineering Texas A&M University.
Embedded System Scheduling
Data Driven Resource Allocation for Distributed Learning
Task: It is necessary to choose the most suitable variant from some set of objects by those or other criteria.
Flavius Gruian < >
When Security Games Go Green
A Unifying View on Instance Selection
Extensions to BT Search Foundations of Constraint Processing
Extensions to BT Search Foundations of Constraint Processing
CSE 573 Introduction to Artificial Intelligence Decision Trees
Extensions to BT Search Foundations of Constraint Processing
Extensions to BT Search Foundations of Constraint Processing
Aiman H. El-Maleh Sadiq M. Sait Syed Z. Shazli
More on HW 2 (due Jan 26) Again, it must be in Python 2.7.
UNINFORMED SEARCH -BFS -DFS -DFIS - Bidirectional
Extensions to BT Search Foundations of Constraint Processing
Case Injected Genetic Algorithms
Determining the capacity of any quantum computer to perform a useful computation Joel Wallman Quantum Resource Estimation June 22, 2019.
Stochastic Methods.
Presentation transcript:

Constraint Programming and Backtracking Search Algorithms Peter van Beek University of Waterloo

Acknowledgements Joint work with: Funding: Alejandro López-Ortiz Abid Malik Jim McInnes Claude-Guy Quimper John Tromp Kent Wilken Huayue Wu Funding: NSERC IBM Canada

Outline Introduction Worst-case performance Practical performance basic-block scheduling constraint programming randomization and restarts Worst-case performance bounds on expected runtime bounds on tail probability Practical performance parameterizing universal strategies estimating optimal parameters experiments Conclusions

Basic-block instruction scheduling Schedule basic-block straight-line sequence of code with single entry, single exit Multiple-issue pipelined processors multiple instructions can begin execution each clock cycle delay or latency before results are available Find minimum length schedule Classic problem lots of attention in literature

Example: evaluate (a + b) + c instructions A r1  a B r2  b C r3  c D r1  r1 + r2 E r1  r1 + r3 3 1 A B D C E dependency DAG

Example: evaluate (a + b) + c optimal schedule A r1  a B r2  b C r3  c nop D r1  r1 + r2 E r1  r1 + r3 3 1 A B D C E dependency DAG

Constraint programming methodology Model problem specify in terms of constraints on acceptable solutions constraint model: variables, domains, constraints Solve model backtracking search many improvements: constraint propagation, restarts, …

Constraint model 3 1 A B D C E variables dependency DAG A, B, C, D, E domains {1, …, m} constraints D  A + 3 D  B + 3 E  C + 3 E  D + 1 gcc(A, B, C, D, E, width) 3 1 A B D C E dependency DAG

Constraint programming methodology Model problem specify in terms of constraints on acceptable solutions constraint model: variables, domains, constraints Solve model backtracking search many improvements: constraint propagation, restarts, …

Solving instances of the model B [1,6] [1,6] A 1 2 5 6 3 3 B D C [1,6] [1,6] C 1 3 D E [1,6] E

Constraint propagation: Bounds consistency variable A B C D E domain [1, 6]  [1, 3]  [1, 2]  [1, 3]  [1, 2]  [1, 3]  [3, 3]  [4, 6]  [4, 5]  [4, 6]  [5, 6]  [6, 6] constraints D  A + 3 D  B + 3 E  C + 3 E  D + 1 gcc(A, B, C, D, E, 1)

Solving instances of the model B [1,2] [1,2] A 1 2 5 6 3 3 B D C [4,5] [3,3] C 1 3 D E [6,6] E

Solving instances of the model B [1,1] [1,2] A 1 2 5 6 3 3 B D C [4,5] [3,3] C 1 3 D E [6,6] E

Solving instances of the model B [1,1] [2,2] A 1 2 5 6 3 3 B D C [5,5] [3,3] C 1 3 D E [6,6] E

Restart strategies Observation: Backtracking algorithms can be brittle on some instances small changes to a heuristic can lead to great differences in running time A technique called randomization and restarts has been proposed to improve performance (Luby et al., 1993; Harvey, 1995; Gomes et al. 1997, 2000) A restart strategy (t1, t2, t3, …) is a sequence idea: a randomized backtracking algorithm is run for t1 steps. If no solution is found within that cutoff, the algorithm is restarted and run for t2 steps, and so on

Restart strategies Let f(t) be the probability a randomized backtracking algorithm A on instance x stops after taking exactly t steps f(t) is called the runtime distribution of algorithm A on instance x Given the runtime distribution of an instance, the optimal restart strategy for that instance is given by (t*, t*, t*, …), for some fixed cutoff t* (Luby, Sinclair, Zuckerman, 1993) A fixed cutoff strategy is an example of a non-universal strategy: designed to work on a particular instance

Universal restart strategies In contrast to non-universal strategies, universal strategies are designed to be used on any instance Luby strategy (Luby, Sinclair, Zuckerman, 1993) Walsh strategy (Walsh, 1999) (1, 1, 2, 1, 1, 2, 4, 1, 1, 2, 1, 1, 2, 4, 8, 1, …)  grows linearly (1, r, r2, r3, …), r > 1  grows exponentially

Related work: Learning a good restart strategy Gomes et al. (2000) Experiments on a sample of instances to informally choose a good strategy Zhan (2001) Extensive experiments to evaluate effect of geometric parameter Ó Nualláin, de Rijke, v. Benthem (2001) Deriving good restart strategies when instances drawn from two known runtime distributions Kautz et al. (2002a, 2002b) Deriving good restart strategies when instances drawn from n known runtime distributions Ruan, Horvitz, and Kautz (2003) Clusters runtime distributions; constructs a strategy using dynamic programming Gagliolo and Schmidhuber (2007) Online learning of a fixed cutoff strategy interleaved with Luby strategy Huang (2007) Extensive experiments; no strategy was best across all benchmarks

Pitfalls of non-universal restart strategies Non-universal strategies are open to catastrophic failure strategy provably will fail on an instance failure is due to all cutoffs being too small Non-universal strategies learned by previous proposals can be unbounded worse than performing no restarts at all pitfall likely to arise whenever some instances are inherently harder to solve than others

Outline Introduction Worst-case performance Practical performance basic-block scheduling constraint programming randomization and restarts Worst-case performance bounds on expected runtime bounds on tail probability Practical performance parameterizing universal strategies estimating optimal parameters experiments Conclusions

Worst-case performance of universal strategies For universal strategies, two worst-case bounds are of interest: worst-case bounds on the expected runtime of a strategy worst-case bounds on the tail probability of a strategy Luby strategy has been thoroughly characterized (Luby, Sinclair, Zuckerman, 1993) Walsh strategy has not been characterized

Worst-case bounds on expected runtime Expected runtime of the Luby strategy is within a log factor of optimal (Luby, Sinclair, Zuckerman, 1993) We show: Expected runtime of the Walsh strategy (1, r, r2, …), r > 1, can be unbounded worse than optimal

Worst-case bounds on tail probability (I) Tail probability: Probability an algorithm or a restart strategy runs for more than t steps, for some given t Tail probability of the Luby strategy decays superpolynomially as a function of t, no matter what the runtime distribution of the original algorithm (Luby, Sinclair, Zuckerman, 1993) P(T > 4000)

Worst-case bounds on tail probability (II) Pareto heavy-tailed distributions can be a good fit to the runtime distributions of randomized backtracking algorithms (Gomes et al., 1997, 2000) We show: If the runtime distribution of the original algorithm is Pareto heavy-tailed, the tail probability of the Walsh strategy decays superpolynomially

Outline Introduction Worst-case performance Practical performance basic-block scheduling constraint programming randomization and restarts Worst-case performance bounds on expected runtime bounds on tail probability Practical performance parameterizing universal strategies estimating optimal parameters experiments Conclusions

Practical performance of universal strategies Previous empirical evaluations have reported that the universal strategies can perform poorly in practice (Gomes et al., 2000; Kautz et al., 2002; Ruan et al. 2002, 2003; Zhan, 2001) We show: Performance of the universal strategies can be improved by Parameterizing the strategies Estimating the optimal settings for these parameters from a small sample of instances

Motivation Setting: a sequence of instances are to be solved over time e.g., in staff rostering, at regular intervals on the calendar a similar problem must be solved e.g., in instruction scheduling, thousands of instances arise each time a compiler is invoked on some software project Useful to learn a good portfolio, in an offline manner, from a training set

Parameterizing the universal strategies Two parameters: scale s geometric factor r Parameterized Luby strategy with, e.g., s = 2, r = 3 Parameterized Walsh strategy Advantages: Improve performance while retaining theoretical guarantees (2, 2, 2, 6, 2, 2, 2, 6, 2, 2, 2, 6, 18, …) (s, sr, sr2, sr3, …)

Estimating the optimal parameter settings Discretize scale s into orders of magnitude, 10-1, …, 105 Discretize geometric r 2, 3, …, 10 (Luby) 1.1, 1.2, ..., 2.0 (Walsh) Choose values that minimizes performance measure on training set

Experimental setup Instruction scheduling problems for multiple-issue pipelined processors hard instances from SPEC 2000 and MediaBench suites gathered censored runtime distributions (10 minute time limit per instance) training set: 927 instances test set: 5,450 instances Solve using backtracking search algorithm randomized dynamic variable ordering heuristic capable of performing three levels of constraint propagation: Level = 0 Bounds consistency Level = 1 Singleton consistency using bounds consistency Level = 2 Singleton consistency using singleton consistency

Experiment 1: Time limit Time limit: 10 minutes per instance Performance measure: Number of instances solved Learn parameter settings from training set, evaluate on test set

Experiment 1: Time limit

Experiment 2: No time limit No time limit : run to completion Performance measure: Expected time to solve instances In our experimental runtime data, replaced timeouts by values sampled from tail of a Pareto distribution Learn parameter settings from training set, evaluate on test set

Experiment 2: No time limit

Conclusions Restart strategies Bigger picture Theoretical performance: worst-case analysis of Walsh universal strategy Practical performance: approach for learning good universal restart strategies Bigger picture Application driven research: Instruction scheduling in compilers Can now solve optimally almost all instances that arise in practice