Docsity

Informed (Heuristic) Search Methods in Artificial Intelligence, Slides of Introduction to Computing

Partial preview of the text

Download Informed (Heuristic) Search Methods in Artificial Intelligence and more Slides Introduction to Computing in PDF only on Docsity!

CS613 INTRODUCTION TO

ARTIFICIAL INTELLIGENCE

Lecture 4 a

Informed (Heuristic) Search Methods

Informed (Heuristic) Search Methods

  1. Traditional informed search strategies (Best First Search):  Greedy Best first searchA search*  Iterative Deepening A (IDA) search**  *Problem Reduction (AND-OR graph and AO)
  2. Local Search Algorithms:**  Hill Climbing,  **Simulated Annealing,
  3. Constraint Satisfaction problems (CSP)**
  • The most straightforward way to implement systematic Generate-and-test is as a depth-first search tree with backtracking.
  • For simple problems, it is a reasonable technique.
  • In much harder problems, it is not an effective technique. But when combined with other techniques to restrict the space in which to search, the technique can be very effective, e.g. DENDRAL which uses a strategy called “plan-generate-test’ , to create lists of recommended substructures that will be used by the generate-and-test algorithm to explore a limited set of structures.
  • Combination of techniques will overcome the limitations that each possesses individually. The combination of planning using one problem solving method (constraint satisfaction) with the use of the plan by another problem solving method (generate- and test) is an example of the way techniques can be combined.
  • Planning weakness is that it produces inaccurate solutions since there is no feedback from the world. But by using it only to produce pieces of solutions that will then be exploited in the generate-and-test process, the lack of detailed accuracy becomes unimportant and the combinatorial problems that arise in simple generate-and-test method are avoided
  • Heuristic : is a technique that improves the

efficiency of a search process (i.e., find the good answer not the best answer) {Heuristic function}

  • Evaluate the "goodness" of each rule

according to its usefulness in reaching the

goal. Use this to focus the search effort

  • It is common to define a heuristic function

f(n) that returns the estimated cost of a

solution through node n

  • (This is sometimes called an objective

function, search criterion, cost function,

or distance function )

  • Usually, we want to minimize cost.

What are the qualities

of a good heuristic function?

  • should be an accurate measure of

"goodness" or "cost"

  • should be easy to compute
  • Assume that the "best" solution is the one

with the lowest cost. A good heuristic yields

a search with

  • lower average cost of path to goal
  • lower average cost of performing the search

(number of nodes processed; amount of

computation required to evaluate heuristic)

  • Better heuristic  higher "heuristic power“

Definitions

  • Let g(n) be the minimum known cost to

reach node n from start state

  • Let g(n)* be the actual lowest cost to reach

node n from start state

  • Let h(n) be the estimated cost to reach the

closest goal state from node n

  • Let h(n)* be the actual lowest cost to reach

the closest goal state from node n

  • f(n) = g(n) + h(n) = estimate of cost of best

solution through node n

  • f(n) = g(n) + h*(n) = actual cost of best

solution through node n

Heuristic Functions

  • A heuristic function is a function f(n) that gives an estimation on the “cost” of getting from node n to the goal state – so that the node with the least cost among all possible choices can be selected for expansion first.
  • Three approaches to defining f :
    • f measures the value of the current state (its “goodness”)
    • f measures the estimated cost of getting to the goal from the current state: - f(n) = h(n) where h(n) = an estimate of the cost to get from n to a goal
    • f measures the estimated cost of getting to the goal state from the current state and the cost of the existing path to it. Often, in this case, we decompose f : - f(n) = g(n) + h(n) where g(n) = the cost to get to n (from initial state)

Approach 1: f Measures the Value of

the Current State

  • Usually the case when solving optimization problems - Finding a state such that the value of the metric f is optimized
  • Often, in these cases, f could be a weighted sum of a set of component values: - N-Queens - Example: the number of queens under attack …

Approach 2: f Measures the Cost to

the Goal

  • A state X would be better than a state Y if

the estimated cost of getting from X to the

goal is lower than that of Y – because X

would be closer to the goal than Y

8 – Puzzle

h 1 : The number of misplaced tiles (squares with number).

h 2 : The sum of the distances of the tiles from their goal positions.

Traditional informed search strategies

  • Greedy Best first search
    • “Always chooses the successor node with the best f value” where f(n) = h(n)
    • We choose the one that is nearest to the final state among all possible choices
  • A* search
    • Best first search using an “admissible” heuristic function f that takes into account the current cost g
    • Always returns the optimal solution path

Informed Search

  • Relies on additional knowledge about the

problem or domain

  • frequently expressed through heuristics (“rules of thumb”)
  • Used to distinguish more promising paths

towards a goal

  • may be mislead, depending on the quality of the heuristic
  • In general, performs much better than

uninformed search

  • but frequently still exponential in time and space for realistic problems

Best-first search

  • To implement an informed search strategy, we need to slightly modify the skeleton for agenda-based search that we've already seen.
  • Again, the crucial part of the skeleton is where we update the agenda.
  • Rather than simply adding the new agenda items to the beginning (depth-first) or end (breadth-first) of the existing agenda, we add them to the existing agenda in order according to some measure of how promising we think a state is, with the most promising ones first. This gives us best-first search. update_agenda(OldAgenda, NewStates, NewAgenda) :- append(NewStates, OldAgenda, NewAgenda). sort_agenda(NewStates, OldAgenda, NewAgenda).

Best-first search (Cont.)

  • Idea:

use an evaluation function for each node; estimate of “desirability”

 expand most desirable unexpanded node.

  • Implementation:

QueueingFn = insert successors in decreasing

order of desirability

  • Special cases:

greedy search A* search