Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Beam Search - Artificial Intelligence - Lecture Slides, Slides of Artificial Intelligence

Some concept of Artificial Intelligence are Agents and Problem Solving, Autonomy, Programs, Classical and Modern Planning, First-Order Logic, Resolution Theorem Proving, Search Strategies, Structure Learning. Main points of this lecture are: Beam Search, Iterative Improvement, Applying Knowledge, Problem Representation, Knowledge Representation, Family of Algorithms, Algorithm, Implementation, Functional Abstraction, Comparator Function

Typology: Slides

2012/2013

Uploaded on 04/29/2013

shantii
shantii 🇮🇳

4.4

(14)

98 documents

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Lecture 6 of 41
A/A*, Beam Search, and
Iterative Improvement
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download Beam Search - Artificial Intelligence - Lecture Slides and more Slides Artificial Intelligence in PDF only on Docsity!

Lecture 6 of 41

A/A*, Beam Search, and

Iterative Improvement

Lecture Outline

  • Today’s Reading
  • Reading for Next Week: Chapter 6, Russell and Norvig 2e
  • More Heuristic Search
    • Best-First Search: A/A concluded*
    • Iterative improvement
      • Hill-climbing
      • Simulated annealing (SA)
    • Search as function maximization
      • Problems: ridge; foothill; plateau, jump discontinuity
      • Solutions: macro operators; global optimization (genetic algorithms / SA)
  • Next Lecture: AI Applications 1 of 3
  • Next Week: Adversarial Search (e.g., Game Tree Search)
    • Competitive problems
    • Minimax algorithm

Best-First Search [1]:

Characterization of Algorithm Family

  • Evaluation Function
    • Recall: General-Search (Figure 3.9, 3.10 R&N)
    • Applying knowledge
      • In problem representation (state space specification)
      • At Insert (), aka Queueing-Fn () – determines node to expand next
    • Knowledge representation (KR): expressing knowledge symbolically/numerically
      • Objective; initial state, state space (operators, successor function), goal test
      • h ( n ) – part of (heuristic) evaluation function
  • Best-First: Family of Algorithms
    • Justification: using only g doesn’t direct search toward goal
    • Nodes ordered so that node with best evaluation function (e.g., h ) expanded first
    • Best-first: any algorithm with this property ( NB : not just using h alone)
  • Note on “Best”
    • Refers to “apparent best node based on eval function applied to current frontier”
    • Discussion: when is best-first not really best?

Best-First Search [2]:

Implementation

  • function Best-First-Search ( problem , Eval-Fn ) returns solution sequence
    • inputs: problem, specification of problem (structure or class) Eval-Fn , an evaluation function
    • Queueing-Fnfunction that orders nodes by Eval-Fn
      • Compare: Sort with comparator function <
      • Functional abstraction
    • return General-Search ( problem , Queueing-Fn )
  • Implementation
    • Recall: priority queue specification
      • Eval-Fn : nodeR
      • Queueing-FnSort-By : node listnode list
    • Rest of design follows General-Search
  • Issues
    • General family of greedy ( aka myopic, i.e., nearsighted) algorithms
    • Discussion: What guarantees do we want on h ( n )? What preferences?

Heuristic Search [2]:

Background

  • Origins of Term
    • Heuriskein – to find (to discover)
    • Heureka
      • “I have found it”
      • Legend imputes exclamation to Archimedes (bathtub flotation / displacement)
  • Usage of Term
    • Mathematical logic in problem solving
      • Polyà [1957]
      • Study of methods for discovering and inventing problem-solving techniques
      • Mathematical proof derivation techniques
    • Psychology: “rules of thumb” used by humans in problem-solving
    • Pervasive through history of AI
      • e.g., Stanford Heuristic Programming Project
      • One origin of rule-based (expert) systems
  • General Concept of Heuristic (A Modern View)
    • Any standard (symbolic rule or quantitative measure) used to reduce search
    • “As opposed to exhaustive blind search”
    • Compare (later): inductive bias in machine learning

Greedy Search [1]:

A Best-First Algorithm

  • function Greedy-Search ( problem ) returns solution or failure
    • // recall: solution Option
    • return Best-First-Search ( problem , h )
  • Example of Straight-Line Distance (SLD) Heuristic: Figure 4.2 R&N
    • Can only calculate if city locations (coordinates) are known
    • Discussion: Why is hSLD useful?
      • Underestimate
      • Close estimate
  • Example: Figure 4.3 R&N
    • Is solution optimal?
    • Why or why not?

Greedy Search [4]:

More Properties

  • Good Heuristic Functions Reduce Practical Space and Time Complexity
    • “Your mileage may vary”: actual reduction
      • Domain-specific
      • Depends on quality of h (what quality h can we achieve?)
    • “You get what you pay for”: computational costs or knowledge required
  • Discussions and Questions to Think About
    • How much is search reduced using straight-line distance heuristic?
    • When do we prefer analytical vs. search-based solutions?
    • What is the complexity of an exact solution?
    • Can “meta-heuristics” be derived that meet our desiderata?
      • Underestimate
      • Close estimate
    • When is it feasible to develop parametric heuristics automatically?
      • Finding underestimates
      • Discovering close estimates

Algorithm A/A* [1]:

Methodology

  • Idea: Combine Evaluation Functions g and h
    • Get “best of both worlds”
    • Discussion: Why is it important to take both components into account?
  • function A-Search ( problem ) returns solution or failure
    • // recall: solution Option
    • return Best-First-Search ( problem , g + h )
  • Requirement: Monotone Restriction on f
    • Recall: monotonicity of h
      • Requirement for completeness of uniform-cost search
      • Generalize to f = g + h
    • aka triangle inequality
  • Requirement for A = A: Admissibility of* h
    • h must be an underestimate of the true optimal cost (n****. h ( n )h *( n ))

Algorithm A/A* [3]:

Optimality/Completeness and Performance

  • Admissibility: Requirement for A Search to Find Min-Cost Solution*
  • Related Property: Monotone Restriction on Heuristics
    • For all nodes m , n such that m is a descendant of n : h(m)h(n) - c(n, m)
    • Change in h is less than true cost
    • Intuitive idea: “No node looks artificially distant from a goal”
    • Discussion questions
      • Admissibilitymonotonicity? Monotonicityadmissibility?
      • Always realistic, i.e., can always be expected in real-world situations?
      • What happens if monotone restriction is violated? (Can we fix it?)
  • Optimality and Completeness
    • Necessarily and sufficient condition (NASC): admissibility of h
    • Proof: p. 99-100 R&N (contradiction from inequalities)
  • Behavior of A: Optimal Efficiency*
  • Empirical Performance
    • Depends very much on how tight h is
    • How weak is admissibility as a practical requirement?

Problems with Best-First Searches

  • Idea: Optimization-Based Problem Solving as Function Maximization
    • Visualize function space: criterion ( z axis) versus solutions ( x - y plane)
    • Objective: maximize criterion subject to solutions, degrees of freedom
  • Foothills aka Local Optima
    • aka relative minima (of error), relative maxima (of criterion)
    • Qualitative description
      • All applicable operators produce suboptimal results (i.e., neighbors)
      • However, solution is not optimal!
    • Discussion: Why does this happen in optimization?
  • Lack of Gradient aka Plateaux
    • Qualitative description: all neighbors indistinguishable by evaluation function f
    • Related problem: jump discontinuities in function space
    • Discussion: When does this happen in heuristic problem solving?
  • Single-Step Traps aka Ridges
    • Qualitative description: unable to move along steepest gradient
    • Discussion: How might this problem be overcome?

Preview:

Iterative Improvement Framework

  • Intuitive Idea
    • “Single-point search frontier”
      • Expand one node at a time
      • Place children at head of queue
      • Sort only this sublist, by f
    • Result – direct convergence in direction of steepest:
      • Ascent (in criterion)
      • Descent (in error)
    • Common property: proceed toward goal from search locus (or loci)
  • Variations
    • Local (steepest ascent hill-climbing) versus global (simulated annealing)
    • Deterministic versus Monte-Carlo
    • Single-point versus multi-point
      • Maintain frontier
      • Systematic search (cf. OPEN / CLOSED lists): parallel simulated annealing
      • Search with recombination: genetic algorithm

Preview:

Hill-Climbing (Gradient Descent)

  • function Hill-Climbing ( problem ) returns solution state
    • inputs: problem : specification of problem (structure or class)
    • static: current , next : search nodes
    • currentMake-Node ( problem****. Initial-State )
    • loop do
      • nexta highest-valued successor of current
      • if next.value () < current.value () then return current
      • currentnext // make transition
    • end
  • Steepest Ascent Hill-Climbing
    • aka gradient ascent (descent)
    • Analogy: finding “tangent plane to objective surface”
    • Implementations
      • Finding derivative of (differentiable) f with respect to parameters
      • Example: error backpropagation in artificial neural networks (later)
  • Discussion: Difference Between Hill-Climbing, Best-First?

Properties of Algorithm A/A*:

Review

  • Admissibility: Requirement for A Search to Find Min-Cost Solution*
  • Related Property: Monotone Restriction on Heuristics
    • For all nodes m , n such that m is a descendant of n : h(m)h(n) - c(n, m)
    • Discussion questions
      • Admissibilitymonotonicity? Monotonicityadmissibility?
      • What happens if monotone restriction is violated? (Can we fix it?)
  • Optimality Proof for Admissible Heuristics
    • Theorem: Ifn****. h ( n )_h_* ( n ) _, A will never return a suboptimal goal node._*
    • Proof
      • Suppose _A_* returns x such thats****. g ( s ) < g ( x )
      • Let path from root to s be < n 0 , n 1 , …, nk > where nks
      • Suppose _A_* expands a subpath < n 0 , n 1 , …, nj > of this path
      • Lemma: by induction on i , s = nk is expanded as well Base case: n 0 (root) always expanded Induction step: h ( nj +1)_h_* ( nj +1), so f ( nj +1)f ( x ), Q.E.D.
      • Contradiction: if s were expanded, A would have selected* s , not x

A/A: Extensions (IDA, SMA*)

  • Memory-Bounded Search
    • Rationale
      • Some problems intrinsically difficult (intractable, exponentially complex)
      • Fig. 3.12, p. 75 R&N (compare Garey and Johnson, Baase, Sedgewick)
      • “Something’s got to give” – size, time or memory? (“Usually it’s memory”)
  • Iterative Deepening A – Pearl, Rorf (Fig. 4.10, p. 107 R&N)*
    • Idea: use iterative deepening DFS with sort on f – expands node iff A does*
    • Limit on expansion: f -cost
    • Space complexity: linear in depth of goal node
    • Caveat: could take O( n^2 ) time – e.g., TSP ( n = 106 could still be a problem)
    • Possible fix
      • Increase f cost limit byon each iteration
      • Approximation error bound: no worse than-bad (-admissible)
  • Simplified Memory-Bounded A – Chakrabarti, Russell (Fig. 4.12 p. 107 R&N)*
    • Idea: make space on queue as needed (compare: virtual memory)
    • Selective forgetting: drop nodes (select victims) with highest f