Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Randomization in Complete Tree Search.

Slides:



Advertisements
Similar presentations
Review: Search problem formulation
Advertisements

Heuristic Search techniques
Artificial Intelligence Presentation
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
1 Backdoor Sets in SAT Instances Ryan Williams Carnegie Mellon University Joint work in IJCAI03 with: Carla Gomes and Bart Selman Cornell University.
1 Restart search techniques for Employee Timetabling Problems Amnon Meisels And Eliezer Kaplansky Ben-Gurion University.
Dynamic Restarts Optimal Randomized Restart Policies with Observation Henry Kautz, Eric Horvitz, Yongshao Ruan, Carla Gomes and Bart Selman.
Lecture 13 Last time: Games, minimax, alpha-beta Today: Finish off games, summary.
Planning under Uncertainty
Review: Search problem formulation
4 Feb 2004CS Constraint Satisfaction1 Constraint Satisfaction Problems Chapter 5 Section 1 – 3.
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
08/1 Foundations of AI 8. Satisfiability and Model Construction Davis-Putnam, Phase Transitions, GSAT Wolfram Burgard and Bernhard Nebel.
Heavy-Tailed Behavior and Search Algorithms for SAT Tang Yi Based on [1][2][3]
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
Ryan Kinworthy 2/26/20031 Chapter 7- Local Search part 1 Ryan Kinworthy CSCE Advanced Constraint Processing.
Solvable problem Deviation from best known solution [%] Percentage of test runs ERA RDGR RGR LS Over-constrained.
Computational Methods for Management and Economics Carla Gomes
Constraint Satisfaction Problems
Master Class on Experimental Study of Algorithms Scientific Use of Experimentation Carla P. Gomes Cornell University CPAIOR Bologna, Italy 2010.
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Analysis of Algorithms CS 477/677
Short XORs for Model Counting: From Theory to Practice Carla P. Gomes, Joerg Hoffmann, Ashish Sabharwal, Bart Selman Cornell University & Univ. of Innsbruck.
1 Backdoors To Typical Case Complexity Ryan Williams Carnegie Mellon University Joint work with: Carla Gomes and Bart Selman Cornell University.
Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Instance Hardness and Phase Transitions.
CP-AI-OR-02 Gomes & Shmoys 1 The Promise of LP to Boost CSP Techniques for Combinatorial Problems Carla P. Gomes David Shmoys
1 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Satisfiability (Reading R&N: Chapter 7)
Stochastic greedy local search Chapter 7 ICS-275 Spring 2007.
1 Understanding Problem Hardness: Recent Developments and Directions Bart Selman Cornell University.
Carla P. Gomes School on Optimization CPAIOR02 Exploiting Structure and Randomization in Combinatorial Search Carla P. Gomes
Lukas Kroc, Ashish Sabharwal, Bart Selman Cornell University, USA SAT 2010 Conference Edinburgh, July 2010 An Empirical Study of Optimal Noise and Runtime.
1 Combinatorial Problems in Cooperative Control: Complexity and Scalability Carla Gomes and Bart Selman Cornell University Muri Meeting March 2002.
DAST, Spring © L. Joskowicz 1 Data Structures – LECTURE 1 Introduction Motivation: algorithms and abstract data types Easy problems, hard problems.
Hardness-Aware Restart Policies Yongshao Ruan, Eric Horvitz, & Henry Kautz IJCAI 2003 Workshop on Stochastic Search.
Why SAT Scales: Phase Transition Phenomena & Back Doors to Complexity slides courtesy of Bart Selman Cornell University.
Constraint Satisfaction Problems
Distributions of Randomized Backtrack Search Key Properties: I Erratic behavior of mean II Distributions have “heavy tails”.
Distributed Constraint Optimization Michal Jakob Agent Technology Center, Dept. of Computer Science and Engineering, FEE, Czech Technical University A4M33MAS.
Vilalta&Eick: Informed Search Informed Search and Exploration Search Strategies Heuristic Functions Local Search Algorithms Vilalta&Eick: Informed Search.
ANTs PI Meeting, Nov. 29, 2000W. Zhang, Washington University1 Flexible Methods for Multi-agent distributed resource Allocation by Exploiting Phase Transitions.
Chapter 5 Section 1 – 3 1.  Constraint Satisfaction Problems (CSP)  Backtracking search for CSPs  Local search for CSPs 2.
Heavy-Tailed Phenomena in Satisfiability and Constraint Satisfaction Problems by Carla P. Gomes, Bart Selman, Nuno Crato and henry Kautz Presented by Yunho.
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.
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Lecture 3: Uninformed Search
Quality of LP-based Approximations for Highly Combinatorial Problems Lucian Leahu and Carla Gomes Computer Science Department Cornell University.
Stochastic greedy local search Chapter 7 ICS-275 Spring 2009.
/425 Declarative Methods - J. Eisner 1 Random 3-SAT  sample uniformly from space of all possible 3- clauses  n variables, l clauses Which are.
SAT 2009 Ashish Sabharwal Backdoors in the Context of Learning (short paper) Bistra Dilkina, Carla P. Gomes, Ashish Sabharwal Cornell University SAT-09.
A General Introduction to Artificial Intelligence.
CHAPTER 5 SECTION 1 – 3 4 Feb 2004 CS Constraint Satisfaction 1 Constraint Satisfaction Problems.
Accelerating Random Walks Wei Wei and Bart Selman.
1 Combinatorial Problems in Cooperative Control: Complexity and Scalability Carla P. Gomes and Bart Selman Cornell University Muri Meeting June 2002.
Balance and Filtering in Structured Satisfiability Problems Henry Kautz University of Washington joint work with Yongshao Ruan (UW), Dimitris Achlioptas.
1. 2 Outline of Ch 4 Best-first search Greedy best-first search A * search Heuristics Functions Local search algorithms Hill-climbing search Simulated.
Chapter 5 Team Teaching AI (created by Dewi Liliana) PTIIK Constraint Satisfaction Problems.
Lecture 8 Randomized Search Algorithms Part I: Backtrack Search CSE 573 Artificial Intelligence I Henry Kautz Fall 2001.
Inference in Propositional Logic (and Intro to SAT) CSE 473.
Formal Complexity Analysis of RoboFlag Drill & Communication and Computation in Distributed Negotiation Algorithms in Distributed Negotiation Algorithms.
1 P NP P^#P PSPACE NP-complete: SAT, propositional reasoning, scheduling, graph coloring, puzzles, … PSPACE-complete: QBF, planning, chess (bounded), …
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Presentation transcript:

Carla P. Gomes CS4700 CS 4700: Foundations of Artificial Intelligence Carla P. Gomes Module: Randomization in Complete Tree Search Algorithms Wrap-up of Search!

Carla P. Gomes CS4700 Randomization in Local Search Randomized strategies are very successful in the area of local search. –Random Hill Climbing – Simulated annealing –Genetic algorithms –Tabu Search –Gsat and variants. Key Limitation? Inherent incomplete nature of local search methods.

Carla P. Gomes CS4700 Introduce randomness in a tree search method e.g., by randomly breaking ties in variable and/or value selection. Why would we do that? Can we also add a stochastic element to a systematic (tree search) procedure without losing completeness? Randomization in Tree Search

Carla P. Gomes CS4700 Backtrack Search ( a OR NOT b OR NOT c ) AND ( b OR NOT c) AND ( a OR c)

Carla P. Gomes CS4700 Backtrack Search Two Different Executions ( a OR NOT b OR NOT c ) AND ( b OR NOT c) AND ( a OR c)

Carla P. Gomes CS4700 The fringe of the search space The fringe of search space

Carla P. Gomes CS4700 Latin Square Completion: Randomized Backtrack Search (*) no solution found - reached cutoff: 2000 Time:(*)3011(*)7 Easy instance – 15 % pre-assigned cells Gomes et al. 97

Median = 1! sample mean 3500! number of runs (on the same instance) Erratic Mean Behavior

1

Carla P. Gomes CS %<=30 Proportion of cases Solved F(x) 5%> Number backtracks

Carla P. Gomes CS4700 Run Time Distributions The runtime distributions of some of the instances reveal interesting properties: I Erratic behavior of mean. II Distributions have “heavy tails”.

Carla P. Gomes CS4700 Heavy-Tailed Distributions … infinite variance … infinite mean Introduced by Pareto in the 1920’s --- “probabilistic curiosity.” Mandelbrot established the use of heavy-tailed distributions to model real-world fractal phenomena. Examples: stock-market, earth-quakes, weather,...

Carla P. Gomes CS4700 Decay of Distributions Standard --- Exponential Decay e.g. Normal: Heavy-Tailed --- Power Law Decay e.g. Pareto-Levy:

Normal, Cauchy, and Levy Normal - Exponential Decay Cauchy -Power law Decay Levi -Power law Decay

Carla P. Gomes CS4700 Tail Probabilities (Standard Normal, Cauchy, Levy)

Carla P. Gomes CS4700 Fat tailed distributions Kurtosis = second central moment (i.e., variance) fourth central moment Normal distribution  kurtosis is 3 Fat tailed distribution  when kurtosis > 3 (e.g., exponential, lognormal)

Carla P. Gomes CS4700 Fat and Heavy-tailed distributions Exponential decay for standard distributions, e.g. Normal, Logonormal, exponential: Heavy-Tailed Power Law Decay e.g. Pareto-Levy: Normal 

Carla P. Gomes CS4700 Pareto Distribution Density Function f(x) = P[ X = x ] –f(x) =  / x (  + 1) for x  1 Distribution Function F(x) = P[ X  x ] –F(x) = / x  for x  1 Survival Function (Tail probability S(x) = 1 – F(x) = P[X>x] –S(x) = 1 / x  for x  1 where  > 0 is a shape parameter

Carla P. Gomes CS4700 Pareto Distribution Moments E(X n ) =  / (  - n) if n <  E(X n ) =  if n  . Mean  E(X) =  / (  - 1) if  > 1. E(X) =  if   1. Variance  var(X) =  / [(  - 1) 2 (  - 2)] if  > 2 var(X) =  if   2.

Carla P. Gomes CS4700 How to Check for “Heavy Tails”? Power-law decay of tail  Log-Log plot of tail of distribution (Survival function or 1-F(x): e.g for the Pareto S(x) = 1 / x  for x  1 )  should be approximately linear. Slope gives value of infinite mean and infinite variance infinite mean and infinite variance infinite variance infinite variance

Carla P. Gomes CS4700 Pareto  =1 Lognormal 1,1 X f(x) Infinite mean and infinite variance. Lognormal(1,1) Pareto(1)

Carla P. Gomes CS4700 How to Visually Check for Heavy-Tailed Behavior Log-log plot of tail of distribution exhibits linear behavior.

Carla P. Gomes CS4700 Survival Function: Pareto and Lognormal

Carla P. Gomes CS4700 Example of Heavy Tailed Model Random Walk: Start at position 0 Toss a fair coin: with each head take a step up (+1) with each tail take a step down (-1) X --- number of steps the random walk takes to return to position 0.

Carla P. Gomes CS4700 The record of 10,000 tosses of an ideal coin (Feller) Zero crossing Long periods without zero crossing

Random Walk Heavy-tails vs. Non-Heavy-Tails Normal (2, ) Normal (2,1) O,1%> % 2 Median=2 1-F(x) Unsolved fraction X - number of steps the walk takes to return to zero (log scale)

Number backtracks (log) (1-F(x))(log) Unsolved fraction => Infinite mean Heavy-Tailed Behavior in Latin Square Completion Problem 18% unsolved 0.002% unsolved

Carla P. Gomes CS4700 Walsh 99 How Toby Walsh Fried his PC (Graph Coloring)

Carla P. Gomes CS4700 To Be or Not To Be Heavy-Tailed

Carla P. Gomes CS4700 Random Binary CSP Models Model E N – number of variables; D – size of the domains: p – proportion of forbidden pairs (out of D 2 N ( N-1)/ 2) (Achlioptas et al 2000) N – from 15 to 50;

Carla P. Gomes CS4700 Typical Case Analysis: Model E Constrainedness Computational Cost (Mean) % of solvable instances Phase Transition Phenomenon: Discriminating “easy” vs. “hard” instances Hogg et al 96

Carla P. Gomes CS4700 Runtime distributions

Towards phase transition

Carla P. Gomes CS4700 Explaining and Exploiting Fat and Heavy-Tailed

Formal Models of Heavy and Fat Tails in Combinatorial Search How to explain short runs? Heavy/Fat Tails – wide range of solution times very short and very long runtimes Backdoors Hidden tractable substructure in real-world problems subset of the “critical” variables such that once assigned a value the instance simplifies to a tractable class practical consequences

After setting 5 backdoor vars After setting 12 backdoor vars Logistics planning problem formula- 843 vars, 7,301 constraints – 16 backdoor variables (visualization by Anand Kapur, 4701 project) Initial Constraint Graph Logistics Planning – instances with O(log(n)) backdoors

Carla P. Gomes CS4700 Exploiting Backdoors

Carla P. Gomes CS4700 Algorithms Three kinds of strategies for dealing with backdoors: A complete backtrack-search deterministic algorithm A complete randomized backtrack-search algorithm Provably better performance over the deterministic one A heuristicly guided complete randomized backtrack-search algorithm Assumes existence of a good heuristic for choosing variables to branch on We believe this is close to what happens in practice Williams, Gomes, Selman 03/04

Carla P. Gomes CS4700 Deterministic Generalized Iterative Deepening

Generalized Iterative Deepening x 1 = 0x 1 = 1 All possible trees of depth 1 x 2 = 0x 2 = 1 (…) x n = 0x n = 1

Generalized Iterative Deepening Level 2 x 1 = 0x 1 = 1 x 2 = 0 x 2 = 1 x 2 = 0 x 2 = 1 All possible trees of depth 2

Generalized Iterative Deepening Level 2 x n-1 = 0X n-1 = 1 x n = 0 x n = 1 x n = 0 x n = 1 Level 3, level 4, and so on … All possible trees of depth 2

Carla P. Gomes CS4700 Randomized Generalized Iterative Deepening Assumption: There exists a backdoor whose size is bounded by a function of n (call it B(n)) Idea: Repeatedly choose random subsets of variables that are slightly larger than B(n), searching these subsets for the backdoor

Deterministic Versus Randomized Deterministic strategy Randomized strategy Suppose variables have 2 possible values (e.g. SAT) k For B(n) = n/k, algorithm runtime is c n c Det. algorithm outperforms brute-force search for k > 4.2

Carla P. Gomes CS4700 Complete Randomized Depth First Search with Heuristic Assume we have the following. DFS, a generic depth first search randomized backtrack search solver with: (polytime) sub-solver A Heuristic H that (randomly) chooses variables to branch on, in polynomial time  H has probability 1/h of choosing a backdoor variable (h is a fixed constant) Call this ensemble (DFS, H, A)

Carla P. Gomes CS4700 Polytime Restart Strategy for (DFS, H, A) Essentially: If there is a small backdoor, then (DFS, H, A) has a restart strategy that runs in polytime.

Carla P. Gomes CS4700 Runtime Table for Algorithms DFS,H,A B(n) = upper bound on the size of a backdoor, given n variables When the backdoor is a constant fraction of n, there is an exponential improvement between the randomized and deterministic algorithm Williams, Gomes, Selman 03/04

Carla P. Gomes CS4700 How to avoid the long runs in practice? Restarts provably eliminate heavy-tailed behavior. Use restarts or parallel / interleaved runs to exploit the extreme variance performance.

Restarts 70% unsolved 1-F(x) Unsolved fraction Number backtracks (log) no restarts restart every 4 backtracks 250 (62 restarts) 0.001% unsolved

Example of Rapid Restart Speedup (planning) ~100 restarts Cutoff (log) Number backtracks (log) ~10 restarts

Carla P. Gomes CS4700 XXXXX solved 10 Sequential: = 51 seconds Parallel: 10 machines second 51 x speedup Super-linear Speedups Interleaved (1 machine): 10 x 1 = 10 seconds 5 x speedup

Carla P. Gomes CS4700 Sketch of proof of elimination of heavy tails Let’s truncate the search procedure after m backtracks. Probability of solving problem with truncated version: Run the truncated procedure and restart it repeatedly.

Carla P. Gomes CS4700 Y - does not have Heavy Tails

Paramedic Crew Assignment Paramedic crew assignment is the problem of assigning paramedic crews from different stations to cover a given region, given several resource constraints.

Deterministic Search

Restarts

Carla P. Gomes CS4700 Restart Strategies Restart with increasing cutoff - e.g., used by the Satisfiability and Constraint Programming community; cutoff increases linearly: Randomized backtracking – (Lynce et al 2001)  randomizes the target decision points when backtracking (several variants) Random jumping (Zhang 2002)  the solver randomly jumps to unexplored portions of the search space; jumping decisions are based on analyzing the ratio between the space searched vs. the remaining search space; solved several open problems in combinatorics; Geometric restarts – (Walsh 99) – cutoff is increased geometrically; Learning restart strategies – (Kautz et al 2001 and Ruan et. al 2002) – results on optimal policies for restarts under particular scenarios. Huge area for further research. Universal restart strategies (Luby et al 93) – seminal paper on optimal restart strategies for Las Vegas algorithms (theoretical paper)

Carla P. Gomes CS4700 Walsh 99 Notes on Randomizing Backtrack Search Can we replay a “randomized” run?  yes since we use pseudo random numbers; if we save the “seed”, we can then repeat the run with the same seed; “Deterministic randomization” (Wolfram 2002) – the behavior of some very complex deterministic systems is so unpredictable that it actually appears to be random (e.g., adding learned clauses or cutting constraints between restarts  used in the satisfiability community) What if we cannot randomized the code? Randomize the input – Randomly rename the variables (Motwani and Raghavan 95) (Walsh (99) applied this technique to study the runtime distributions of graph-coloring using a deterministic algorithm based on DSATUR implemented by Trick)

Carla P. Gomes CS4700 Portfolios of Algorithms

Carla P. Gomes CS4700 Portfolio of Algorithms A portfolio of algorithms is a collection of algorithms running interleaved or on different processors. Goal: to improve the performance of the different algorithms in terms of: –expected runtime –“risk” (variance) Efficient Set or Pareto set: set of portfolios that are best in terms of expected value and risk.

Depth-First: Average ;St. Dev Branch & Bound for MIP Depth-first vs. Best-bound Cumulative Frequencies Number of nodes 30% Best bound Best-Bound: Average-1400 nodes; St. Dev Optimal strategy: Best Bound 45% Depth-first

Heavy-tailed behavior of Depth-first

Portfolio for 6 processors 0 DF / 6 BB 6 DF / 0BB Expected run time of portfolios 5 DF / 1BB 3 DF / 3 BB 4 DF / 2 BB Efficient set Standard deviation of run time of portfolios

Portfolio for 20 processors 0 DF / 20 BB 20 DF / 0 BB Expected run time of portfolios Standard deviation of run time of portfolios The optimal strategy is to run Depth First on the 20 processors! Optimal collective behavior emerges from suboptimal individual behavior.

Carla P. Gomes CS4700 Compute Clusters and Distributed Agents With the increasing popularity of compute clusters and distributed problem solving / agent paradigms, portfolios of algorithms --- and flexible computation in general --- are rapidly expanding research areas.

Carla P. Gomes CS4700 Stochastic search methods (complete and incomplete) have been shown very effective. Restart strategies and portfolio approaches can lead to substantial improvements in the expected runtime and variance, especially in the presence of heavy-tailed phenomena. Randomization is therefore a tool to improve algorithmic performance and robustness. Summary Take home message: you should always “randomize” your complete search method.

Carla P. Gomes CS4700 Exploiting Structure using Randomization: Summary Very exciting new research area with successful stories  E.g., state of the art complete Sat and CP solvers use randomization and restarts. Very effective when combined with learning More later…

Carla P. Gomes CS4700 Local Search - Summary Surprisingly efficient search method. Wide range of applications. –any type of optimization / search task Handles search spaces that are too large –(e.g., ) for systematic search Often best available algorithm when lack of global information. Formal properties remain largely elusive. Research area will most likely continue to thrive.

Carla P. Gomes CS4700 Summary: Search Uninformed search: DFS / BFS / Uniform cost search time / space complexity size search space: up to approx nodes. Informed Search: use heuristic function guide to goal Greedy best-first search A* search / provably optimal Search space up to approximately 10 25

Carla P. Gomes CS4700 Summary: Search (contd.) Special case: Constraint Satisfaction / CSPs generic framework that uses a restricted, structured format for representing states and goal: variables & constraints, backtrack search (DFS); propagation (forward-checking / arc-consistency, global constraints, variable / value ordering / randomized backtrack-search).

Local search Greedy / Hillclimbing Simulated annealing Genetic Algorithms / Genetic Programming search space to Aversarial Search / Game Playing minimax Up to ~10 10 nodes, 6–7 ply in chess. alpha-beta pruning Up to ~10 20 nodes, 14 ply in chess. provably optimal Summary: Search (Contd)

Carla P. Gomes CS4700 Search and AI Why such a central role? Basically, because lots of tasks in AI are intractable. Search is “the only” way to handle them. Many applications of search, in e.g., Learning / Reasoning / Planning / NLU / Vision Good thing: much recent progress (10 30 quite feasible; sometimes up to ). Qualitative difference from only a few years ago!