CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) Oct, 5, 2012.

Slides:



Advertisements
Similar presentations
Constraint Satisfaction Problems
Advertisements

Informed search algorithms
Advanced Piloting Cruise Plot.
Chapter 1 The Study of Body Function Image PowerPoint
Thursday, March 7 Duality 2 – The dual problem, in general – illustrating duality with 2-person 0-sum game theory Handouts: Lecture Notes.
and 6.855J Spanning Tree Algorithms. 2 The Greedy Algorithm in Action
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
Jeopardy Q 1 Q 6 Q 11 Q 16 Q 21 Q 2 Q 7 Q 12 Q 17 Q 22 Q 3 Q 8 Q 13
FACTORING ax2 + bx + c Think “unfoil” Work down, Show all steps.
Solve Multi-step Equations
Chapter 4: Informed Heuristic Search
Informed Search CS 171/271 (Chapter 4)
CPSC 322, Lecture 7Slide 1 Heuristic Search Computer Science cpsc322, Lecture 7 (Textbook Chpt 3.5) January, 19, 2009.
Copyright © Cengage Learning. All rights reserved.
Randomized Algorithms Randomized Algorithms CS648 1.
ABC Technology Project
1 Undirected Breadth First Search F A BCG DE H 2 F A BCG DE H Queue: A get Undiscovered Fringe Finished Active 0 distance from A visit(A)
VOORBLAD.
Quadratic Inequalities
Local Search Algorithms
BIOLOGY AUGUST 2013 OPENING ASSIGNMENTS. AUGUST 7, 2013  Question goes here!
Computer Science CPSC 322 Lecture 22 Finish Planning as CSP and Planning Wrap-up (Ch 8.4)
Decision Theory: Sequential Decisions Computer Science cpsc322, Lecture 34 (Textbook Chpt 9.3) Nov, 28, 2012.
© 2012 National Heart Foundation of Australia. Slide 2.
Understanding Generalist Practice, 5e, Kirst-Ashman/Hull
25 seconds left…...
Januar MDMDFSSMDMDFSSS
Week 1.
We will resume in: 25 Minutes.
Chapter 12 Analyzing Semistructured Decision Support Systems Systems Analysis and Design Kendall and Kendall Fifth Edition.
©Brooks/Cole, 2001 Chapter 12 Derived Types-- Enumerated, Structure and Union.
Local Search Jim Little UBC CS 322 – CSP October 3, 2014 Textbook §4.8
PSSA Preparation.
CpSc 3220 Designing a Database
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 14, 2012.
Distributed Constraint Satisfaction Problems M OHSEN A FSHARCHI.
Heuristic Search Jim Little UBC CS 322 – Search 4 September 17, 2014 Textbook §
1 Constraint Satisfaction Problems A Quick Overview (based on AIMA book slides)
Department of Computer Science Undergraduate Events More
CPSC 322, Lecture 16Slide 1 Stochastic Local Search Variants Computer Science cpsc322, Lecture 16 (Textbook Chpt 4.8) February, 9, 2009.
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) February, 3, 2010.
CPSC 322, Lecture 13Slide 1 CSPs: Arc Consistency & Domain Splitting Computer Science cpsc322, Lecture 13 (Textbook Chpt 4.5,4.6) February, 01, 2010.
CPSC 322, Lecture 15Slide 1 Stochastic Local Search Computer Science cpsc322, Lecture 15 (Textbook Chpt 4.8) February, 6, 2009.
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
CPSC 322, Lecture 13Slide 1 CSPs: Arc Consistency & Domain Splitting Computer Science cpsc322, Lecture 13 (Textbook Chpt 4.5,4.8) February, 02, 2009.
CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) February, 4, 2009.
Slide 1 CSPs: Arc Consistency & Domain Splitting Jim Little UBC CS 322 – Search 7 October 1, 2014 Textbook §
Local Search CPSC 322 – CSP 5 Textbook §4.8 February 7, 2011.
Department of Computer Science Undergraduate Events More
CS 484 – Artificial Intelligence1 Announcements Homework 2 due today Lab 1 due Thursday, 9/20 Homework 3 has been posted Autumn – Current Event Tuesday.
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Fall 2006 Jim Martin.
CPSC 322, Lecture 16Slide 1 Stochastic Local Search Variants Computer Science cpsc322, Lecture 16 (Textbook Chpt 4.8) Oct, 11, 2013.
Domain Splitting, Local Search CPSC 322 – CSP 4 Textbook §4.6, §4.8 February 4, 2011.
CPSC 322, Lecture 15Slide 1 Stochastic Local Search Computer Science cpsc322, Lecture 15 (Textbook Chpt 4.8) Oct, 9, 2013.
Stochastic Local Search Computer Science cpsc322, Lecture 15
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Computer Science cpsc322, Lecture 13
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Local Search Algorithms
Computer Science cpsc322, Lecture 14
CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12
Computer Science cpsc322, Lecture 13
Computer Science cpsc322, Lecture 14
Stochastic Local Search Variants Computer Science cpsc322, Lecture 16
Domain Splitting CPSC 322 – CSP 4 Textbook §4.6 February 4, 2011.
Local Search Algorithms
Presentation transcript:

CPSC 322, Lecture 14Slide 1 Local Search Computer Science cpsc322, Lecture 14 (Textbook Chpt 4.8) Oct, 5, 2012

Announcements Assignment1 due now! Assignment2 out next week CPSC 322, Lecture 10Slide 2

CPSC 322, Lecture 14Slide 3 Lecture Overview Recap solving CSP systematically Local search Constrained Optimization Greedy Descent / Hill Climbing: Problems

CPSC 322, Lecture 13Slide 4 Systematically solving CSPs: Summary Build Constraint Network Apply Arc Consistency One domain is empty  Each domain has a single value  Some domains have more than one value  Apply Depth-First Search with Pruning Split the problem in a number of disjoint cases Apply Arc Consistency to each case

CPSC 322, Lecture 14Slide 5 Lecture Overview Recap Local search Constrained Optimization Greedy Descent / Hill Climbing: Problems

CPSC 322, Lecture 14Slide 6 Local Search motivation: Scale Many CSPs (scheduling, DNA computing, more later) are simply too big for systematic approaches If you have 10 5 vars with dom(var i ) = 10 4 but if solutions are densely distributed……. Systematic SearchConstraint Network 10 5 * * * 10 8

CPSC 322, Lecture 14Slide 7 Local Search motivation: Scale Many CSPs (scheduling, DNA computing, more later) are simply too big for systematic approaches If you have 10 5 vars with dom(var i ) = 10 4 but if solutions are densely distributed……. Systematic SearchConstraint Network

CPSC 322, Lecture 14Slide 8 Local Search: General Method Remember, for CSP a solution is….. Start from a possible world Generate some neighbors ( “similar” possible worlds) Move from the current node to a neighbor, selected according to a particular strategy Example: A,B,C same domain {1,2,3}

CPSC 322, Lecture 14Slide 9 Local Search: Selecting Neighbors How do we determine the neighbors? Usually this is simple: some small incremental change to the variable assignment a) assignments that differ in one variable's value, by (for instance) a value difference of +1 b) assignments that differ in one variable's value c) assignments that differ in two variables' values, etc. Example: A,B,C same domain {1,2,3}

Iterative Best Improvement How to determine the neighbor node to be selected? Iterative Best Improvement: select the neighbor that optimizes some evaluation function Which strategy would make sense? Select neighbor with … Minimal number of constraint violations Similar number of constraint violations as current state Maximal number of constraint violations No constraint violations

Iterative Best Improvement How to determine the neighbor node to be selected? Iterative Best Improvement: select the neighbor that optimizes some evaluation function Which strategy would make sense? Select neighbour with … Evaluation function: h(n): number of constraint violations in state n Greedy descent: evaluate h(n) for each neighbour, pick the neighbour n with minimal h(n) Hill climbing: equivalent algorithm for maximization problems Here: maximize the number of constraints satisfied Minimal number of constraint violations

CPSC 322, Lecture 5Slide 12 Selecting the best neighbor A common component of the scoring function (heuristic) => select the neighbor that results in the …… - the min conflicts heuristics Example: A,B,C same domain {1,2,3}, (A=B, A>1, C≠3)

Example: N-Queens Put n queens on an n × n board with no two queens on the same row, column, or diagonal (i.e attacking each other) Positions a queen can attack

Example: N-queen as a local search problem CSP: N-queen CSP - One variable per column; domains {1,…,N} => row where the queen in the i th column seats; - Constraints: no two queens in the same row, column or diagonal Neighbour relation: value of a single column differs Scoring function: number of constraint violations (i..e, number of attacks)

CPSC 322, Lecture 5Slide 15 Example: n-queens Put n queens on an n × n board with no two queens on the same row, column, or diagonal (i.e attacking each other)

16 Example: Greedy descent for N-Queen For each column, assign randomly each queen to a row (a number between 1 and N) Repeat For each column & each number: Evaluate how many constraint violations changing the assignment would yield Choose the column and number that leads to the fewest violated constraints; change it Until solved

17 h = 5 h = ?

CPSC 322, Lecture 14Slide 18 n-queens, Why? Why this problem? Lots of research in the 90’ on local search for CSP was generated by the observation that the run- time of local search on n-queens problems is independent of problem size!

CPSC 322, Lecture 14Slide 19 Lecture Overview Recap Local search Constrained Optimization Greedy Descent / Hill Climbing: Problems

CPSC 322, Lecture 14Slide 20 Constrained Optimization Problems So far we have assumed that we just want to find a possible world that satisfies all the constraints. But sometimes solutions may have different values / costs We want to find the optimal solution that maximizes the value or minimizes the cost

CPSC 322, Lecture 5Slide 21 Constrained Optimization Example Hill Climbing means selecting the neighbor which best improves a (value-based) scoring function. Greedy Descent means selecting the neighbor which minimizes a (cost-based) scoring function. The scoring function we’d like to maximize might be: f(n) = (C + A) + #-of-satisfied-const Example: A,B,C same domain {1,2,3}, (A=B, A>1, C≠3) Value = (C+A) so we want a solution that maximize that

CPSC 322, Lecture 14Slide 22 Lecture Overview Recap Local search Constrained Optimization Greedy Descent / Hill Climbing: Problems

CPSC 322, Lecture 5Slide 23 Hill Climbing NOTE: Everything that will be said for Hill Climbing is also true for Greedy Descent

CPSC 322, Lecture 5Slide 24 Problems with Hill Climbing Local Maxima. Plateau - Shoulders (Plateau)

CPSC 322, Lecture 5Slide 25 Corresponding problem for GreedyDescent Local minimum example: 8-queens problem A local minimum with h = 1

CPSC 322, Lecture 5Slide 26 Even more Problems in higher dimensions E.g., Ridges – sequence of local maxima not directly connected to each other From each local maximum you can only go downhill

CPSC 322, Lecture 5Slide 27 Local Search: Summary A useful method for large CSPs Start from a possible world Generate some neighbors ( “similar” possible worlds) Move from current node to a neighbor, selected to minimize/maximize a scoring function which combines: Info about how many constraints are violated Information about the cost/quality of the solution (you want the best solution, not just a solution)

CPSC 322, Lecture 4Slide 28 Learning Goals for today’s class You can: Implement local search for a CSP. Implement different ways to generate neighbors Implement scoring functions to solve a CSP by local search through either greedy descent or hill-climbing.

CPSC 322, Lecture 13Slide 29 Next Class How to address problems with Greedy Descent / Hill Climbing? Stochastic Local Search (SLS)

CPSC 322, Lecture 12Slide Feedback or  Lectures Slides Practice Exercises Assignments AIspace …… Textbook Course Topics / Objectives TAs Learning Goals ……