Local Search Pat Riddle 2012 Semester 2 Patricia J Riddle Adapted from slides by Stuart Russell,

Slides:



Advertisements
Similar presentations
Informed search algorithms
Advertisements

Informed search algorithms
Local Search and Optimization
Local Search Algorithms
Local Search Algorithms Chapter 4. Outline Hill-climbing search Simulated annealing search Local beam search Genetic algorithms Ant Colony Optimization.
LOCAL SEARCH AND CONTINUOUS SEARCH. Local search algorithms  In many optimization problems, the path to the goal is irrelevant ; the goal state itself.
CPSC 322, Lecture 16Slide 1 Stochastic Local Search Variants Computer Science cpsc322, Lecture 16 (Textbook Chpt 4.8) February, 9, 2009.
Problem Solving by Searching
CSC344: AI for Games Lecture 5 Advanced heuristic search Patrick Olivier
Local search algorithms
Local search algorithms
Two types of search problems
CS 460 Spring 2011 Lecture 3 Heuristic Search / Local Search.
CS 4700: Foundations of Artificial Intelligence
Trading optimality for speed…
Adapted by Doug Downey from Bryan Pardo Fall 2007 Machine Learning EECS 349 Machine Learning Lecture 4: Greedy Local Search (Hill Climbing)
CSC344: AI for Games Lecture 4: Informed search
Constraint Satisfaction Problems
Informed search algorithms
Local Search and Optimization
1 Local search and optimization Local search= use single current state and move to neighboring states. Advantages: –Use very little memory –Find often.
When A* fails – Hill climbing, simulated annealing Genetic algorithms
Search CSE When you can’t use A* Hill-climbing Simulated Annealing Other strategies 2 person- games.
INTRODUÇÃO AOS SISTEMAS INTELIGENTES Prof. Dr. Celso A.A. Kaestner PPGEE-CP / UTFPR Agosto de 2011.
An Introduction to Artificial Life Lecture 4b: Informed Search and Exploration Ramin Halavati In which we see how information.
Local Search Algorithms This lecture topic Chapter Next lecture topic Chapter 5 (Please read lecture topic material before and after each lecture.
Dr.Abeer Mahmoud ARTIFICIAL INTELLIGENCE (CS 461D) Dr. Abeer Mahmoud Computer science Department Princess Nora University Faculty of Computer & Information.
Informed search algorithms
Informed search algorithms
1 Shanghai Jiao Tong University Informed Search and Exploration.
Chapter 4.1 Beyond “Classic” Search. What were the pieces necessary for “classic” search.
Informed search algorithms Chapter 4. Best-first search Idea: use an evaluation function f(n) for each node –estimate of "desirability"  Expand most.
ISC 4322/6300 – GAM 4322 Artificial Intelligence Lecture 3 Informed Search and Exploration Instructor: Alireza Tavakkoli September 10, 2009 University.
Iterative Improvement Algorithm 2012/03/20. Outline Local Search Algorithms Hill-Climbing Search Simulated Annealing Search Local Beam Search Genetic.
Artificial Intelligence for Games Online and local search
Local Search Algorithms
CHAPTER 4, Part II Oliver Schulte Summer 2011 Local Search.
Chapter 4 Informed Search and Exploration. Outline Informed (Heuristic) search strategies  (Greedy) Best-first search  A* search (Admissible) Heuristic.
Princess Nora University Artificial Intelligence Chapter (4) Informed search algorithms 1.
Local Search and Optimization Presented by Collin Kanaley.
When A* doesn’t work CIS 391 – Intro to Artificial Intelligence A few slides adapted from CS 471, Fall 2004, UBMC (which were adapted from notes by Charles.
4/11/2005EE562 EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS Lecture 4, 4/11/2005 University of Washington, Department of Electrical Engineering Spring 2005.
A General Introduction to Artificial Intelligence.
Feng Zhiyong Tianjin University Fall  Best-first search  Greedy best-first search  A * search  Heuristics  Local search algorithms  Hill-climbing.
Local search algorithms In many optimization problems, the state space is the space of all possible complete solutions We have an objective function that.
Local Search Algorithms This lecture topic (two lectures) Chapter Next lecture topic Chapter 5 (Please read lecture topic material before and after.
Announcement "A note taker is being recruited for this class. No extra time outside of class is required. If you take clear, well-organized notes, this.
Local Search. Systematic versus local search u Systematic search  Breadth-first, depth-first, IDDFS, A*, IDA*, etc  Keep one or more paths in memory.
Chapter 4 (Section 4.3, …) 2 nd Edition or Chapter 4 (3 rd Edition) Local Search and Optimization.
Chapter 5. Advanced Search Fall 2011 Comp3710 Artificial Intelligence Computing Science Thompson Rivers University.
Lecture 6 – Local Search Dr. Muhammad Adnan Hashmi 1 24 February 2016.
Local Search Algorithms and Optimization Problems
CPSC 420 – Artificial Intelligence Texas A & M University Lecture 5 Lecturer: Laurie webster II, M.S.S.E., M.S.E.e., M.S.BME, Ph.D., P.E.
Department of Computer Science Lecture 5: Local Search
Local Search and Optimization Chapter 4 Mausam (Based on slides of Padhraic Smyth, Stuart Russell, Rao Kambhampati, Raj Rao, Dan Weld…) 1.
Local Search Algorithms CMPT 463. When: Tuesday, April 5 3:30PM Where: RLC 105 Team based: one, two or three people per team Languages: Python, C++ and.
CMPT 463. What will be covered A* search Local search Game tree Constraint satisfaction problems (CSP)
Constraints Satisfaction Edmondo Trentin, DIISM. Constraint Satisfaction Problems: Local Search In many optimization problems, the path to the goal is.
Local search algorithms In many optimization problems, the path to the goal is irrelevant; the goal state itself is the solution State space = set of "complete"
1 Intro to AI Local Search. 2 Intro to AI Local search and optimization Local search: –use single current state & move to neighboring states Idea: –start.
Games: Expectimax MAX MIN MAX Prune if α ≥ β. Games: Expectimax MAX MIN MAX
Local Search Algorithms
Artificial Intelligence (CS 370D)
Local Search and Optimization
Artificial Intelligence
First Exam 18/10/2010.
Local Search Algorithms
CSC 380: Design and Analysis of Algorithms
Beyond Classical Search
Local Search Algorithms
Presentation transcript:

Local Search Pat Riddle 2012 Semester 2 Patricia J Riddle Adapted from slides by Stuart Russell,

Local search algorithms In many optimization problems, the path to the goal is irrelevant; the goal state itself is the solution State space = set of "complete" configurations Find optimal configuration, e.g., TSP Find configuration satisfying constraints, e.g., timetable, n-queens In such cases, we can use local search algorithms (iterative improvement algorithms) keep a single "current" state, try to improve it Constant space, suitable for online as well as offline search 2

Example: n-queens Put n queens on an n × n board with no two queens on the same row, column, or diagonal Move a queen to reduce number of conflicts Almost always solves n-queens problems almost instantaneously for very large n, e.g., n=1million 3

Hill-climbing search: 8-queens problem h = number of pairs of queens that are attacking each other, either directly or indirectly h = 17 for the above state 4

Hill-climbing search: 8-queens problem A local minimum with h = 1 5

Example: Travelling Salesperson Problem Start with any complete tour, perform pairwise exchanges Variants of this approach get within 1% of optimal very quickly with thousands of cities 6

Hill-climbing search "Like climbing Everest in thick fog with amnesia" 7

Hill-climbing search Problem: depending on initial state, can get stuck in local maxima 8

Hill-climbing with 8-queens Gets stuck 86% of the time Solves only 14% of problem instances – 4 steps on average when it succeeds – 3 steps on average when it gets stuck 9

Hill climbing fixes 10

Sideways Moves escape from shoulders loop on at maxima Limit number of consecutive sideways steps 100 consecutive sideways moves in 8-queens Now Solves 94% of problem instances (up from 14%) Average 21 moves when succeeds Average 64 moves when it fails 11

Stochastic Hill Climbing Choose randomly among the uphill moves Or probability of selection based on steepness of move Converges more slowly, but can find better solutions 12

First Choice Hill-climbing Implementation of stochastic hill-climbing Generating successors randomly until it finds one which is uphill – Very good when a state has many successors – Don’t waste time generating them all 13

Random-restart hill climbing series of hill-climbing searches (from randomly generated initial states) overcomes local maxima trivially complete 14

8-queens with Random Restarts p is probability of success Number of restarts is 1/p 8 queens, no sideways, p=0.14, so ~7 restarts 8 queens, sideways, p=0.94, so ~1.06 restarts Number of steps (1 x cost of success) + ((1-p)/p) x cost of failure) 8 queens, no sideways, (1 x 4) + ((.86/.14) x 3) ~ 22 steps 8 queens, sideways, (1x21) + ((0.06/0.94) x 64) ~ 25 steps For 3 million queens, random restart finds solutions in under a minute 15

Hill Climbing Summary The success of hill climbing depends very much on the shape of the state-space landscape. 16

Simulated annealing search Idea: escape local maxima by allowing some "bad" moves but gradually decrease their size and frequency 17

Properties of simulated annealing search One can prove: If T decreases slowly enough, then simulated annealing search will find a global optimum with probability approaching 1 Intuition: Shake hard enough to dislodge from local minima but not hard enough to dislodge from global minima Widely used in VLSI layout, airline scheduling, etc 18

Local beam search Keep track of k states rather than just one, choose top k of all their successors Start with k randomly generated states At each iteration, all the successors of all k states are generated If any one is a goal state, stop; else select the k best successors from the complete list and repeat. 19

Same as k random restarts? NO In a local beam search, useful information is passed among the parallel search threads. But can quickly become concentrated in a small region 20

Stochastic Beam Search Choose k successors randomly, biased towards good ones Observe the close analogy to natural selection! 21

Genetic algorithms 1 = stochastic local beam search + generate successors from pairs of states 22

Genetic algorithms 2 A successor state is generated by combining two parent states Start with k randomly generated states (population) A state is represented as a string over a finite alphabet (often a string of 0s and 1s) Evaluation function (fitness function). Higher values for better states. Produce the next generation of states by selection, crossover, and mutation 23

Genetic Algorithms 3 GAs frequently use states encoded as strings (GPs use programs - trees) Crossover helps iff substrings are meaningful components 24