Docsity

Search Algorithms: Best-First, Greedy, A*, Hill Climbing, Simulated Annealing, Slides of Introduction to Computing

Partial preview of the text

Download Search Algorithms: Best-First, Greedy, A*, Hill Climbing, Simulated Annealing and more Slides Introduction to Computing in PDF only on Docsity!

Introduction to Artificial Intelligence

Lecture 4 c

Local Search for Optimization Problems

Informed (Heuristic) Search Methods

  1. Traditional informed search strategies (Best First Search): 9 Greedy Best first search 9 A search* 9 Memory-Bounded Search (search algorithms that try to conserve memory)
  • iterative deepening A* (IDA*)
  • Recursive best-first search (RBFS)
  • simplified memory-bounded A* (SMA) 9 Problem Reduction (AND-OR graph and AO)
  1. Local Search Algorithms: 9 Hill Climbing, 9 Simulated Annealing, 9 **Genetic Algorithm
  2. Constraint Satisfaction problems (CSP)**

Exercise: Search Algorithms

The following figure shows a portion of a partially expanded search tree. Each arc between nodes is labeled with the cost of the corresponding operator, and the leaves are labeled with the value of the heuristic function,h. Which node (use the node’s letter) will be expanded next by each of the following search algorithms? (a) Depth-first search (b) Breadth-first search (c) Uniform-cost search (d) Greedy search (e) A* search^5 D 5

A

C 4 5

19

6

3

h=

B

E F G h=10 h=12 h=8 h=

h= H

h=

h=

Depth-first search

Node queue: initialization

state depth path cost parent

1 A 0 0 --

Depth-first search

Node queue: add successors to queue front; empty queue from top

state depth path cost parent

5 E 2 7 2 6 F 2 8 2 7 G 2 8 2 8 H 2 9 2 2 B 1 3 1 3 C 1 19 1 4 D 1 5 1 1 A 0 0 --

Depth-first search

Node queue: add successors to queue front; empty queue from top

state depth path cost parent

5 E 2 7 2 6 F 2 8 2 7 G 2 8 2 8 H 2 9 2 2 B 1 3 1 3 C 1 19 1 4 D 1 5 1 1 A 0 0 --

Breadth-first search

Node queue: initialization

state depth path cost parent

1 A 0 0 --

Breadth-first search

Node queue: add successors to queue end; empty queue from top

state depth path cost parent

1 A 0 0 -- 2 B 1 3 1 3 C 1 19 1 4 D 1 5 1

Breadth-first search

Node queue: add successors to queue end; empty queue from top

state depth path cost parent

1 A 0 0 -- 2 B 1 3 1 3 C 1 19 1 4 D 1 5 1 5 E 2 7 2 6 F 2 8 2 7 G 2 8 2 8 H 2 9 2

Exercise: Search Algorithms

The following figure shows a portion of a partially expanded search tree. Each arc between nodes is labeled with the cost of the corresponding operator, and the leaves are labeled with the value of the heuristic function,h. Which node (use the node’s letter) will be expanded next by each of the following search algorithms? (a) Depth-first search (b) Breadth-first search (c) Uniform-cost search (d) Greedy search (e) A* search^5 D 5

A

C 4 5

19

6

3

h=

B

E F G h=10 h=12 h=8 h=

h= H

h=

h=

Uniform-cost search

Node queue: add successors to queue so that entire queue is sorted by path cost so far; empty queue from top

state depth path cost parent

1 A 0 0 -- 2 B 1 3 1 3 D 1 5 1 4 C 1 19 1

Uniform-cost search

Node queue: add successors to queue so that entire queue is sorted by path cost so far; empty queue from top

state depth path cost parent

1 A 0 0 -- 2 B 1 3 1 3 D 1 5 1 5 E 2 7 2 6 F 2 8 2 7 G 2 8 2 8 H 2 9 2 4 C 1 19 1

UCS Example

Open list: C

UCS Example

Open list: B(2) T(1) O(3) E(2) P(5)