Top Banner
Uninformed Search R & N Chapter 3
19

Uninformed Search

Feb 25, 2016

Download

Documents

louis

Uninformed Search. R & N Chapter 3. State Space Search. We need: Set of states A start state A set of operators (a successor function), possibly with costs attached. A set of goal states (or a way to test for goal). A Water Jug Problem. - PowerPoint PPT Presentation
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Uninformed Search

Uninformed Search

R & N Chapter 3

Page 2: Uninformed Search

State Space Search

We need:•Set of states•A start state•A set of operators (a successor function), possibly with costs attached.•A set of goal states (or a way to test for goal)

Page 3: Uninformed Search

A Water Jug Problem

You are given two jugs, a 4-gallon one and a 3-gallon one. Neither has any measuring markers on it. There is a pump that can be used to fill the jugs with water. How can you get exactly 2 gallons of water into the 4-gallon jug?

States:

Start state:

Operators:

Goal state:

Page 4: Uninformed Search

School Lunch Planning

States:

Start state:

Operators:

Goal state:

Page 5: Uninformed Search

Criminal Defense Lawyer

States:

Start state:

Operators:

Goal state:

Page 6: Uninformed Search

Incremental vs. Complete State Formulation

8-Queens

States:

Start state:

Operators:

Goal state:

Page 7: Uninformed Search

Search

Two key decisions:•Use a tree or a graph•How to choose which node to expand next

Example:

Page 8: Uninformed Search

Performance Criteria

•Completeness

•Optimality

•How good is the solution? (R & N call this optimality)

•How efficient is the search algorithm at finding the solution? (R & N call this Time and Space complexity)

Page 9: Uninformed Search

The Outline of a Basic Tree Search

Page 10: Uninformed Search

Breadth-First Search

Is this a good idea?

Page 11: Uninformed Search

Breadth-First Search – When to Evaluate?

Page 12: Uninformed Search

Depth-First Search

Page 13: Uninformed Search

The British Museum Algorithm

A simple algorithm: Generate and test

When done systematically, it is basic depth-first search.

But suppose that each time we end a path, we start over at the top and choose the next path randomly. If we try this long enough, we may eventually hit a solution. We’ll call this

The British Museum Algorithm or

The Monkeys and Typewriters Algorithmhttp://www.arn.org/docs2/news/monkeysandtypewriters051103.htm

Page 14: Uninformed Search

Iterative Deepening

Page 15: Uninformed Search

Is Iterative Deepening a Win?

N(BFS) = b + b2 + … + bd + (bd+1-b) This last term is because of how R&N define best-first search.

N(IDS) = (d)b + (d-1)b2 + … + (1)bd

Example: Let b = 10 and d = 5: N(IDS) = 50 + 400 + 3,000 + 20,000 + 100,000 = 123,450

N(BFS) = 10 + 100 + 1,000 + 10,000 + 100,000 + 999,990 = 1, 111, 100

But there is a real saving in memory.

Page 16: Uninformed Search

Is ID a Win? The Mathematics

1

( 1) ( )1

hhd h

d

bbb bb

Breadth-first search:

Iterative deepening:1

1 1

h dk

d kb h

Lower bound:

Upper bound:

2 2

21 1

( 1) ( )1

hh dk h

d k

b h b hbb bb

Page 17: Uninformed Search

Is Iterative Deepening a Win?

Page 18: Uninformed Search

Which Direction Should We Search?

Our choices: Forward, backwards, or bidirectional

The issues: How many start and goal states are there?Branching factors in each directionHow much work is it to compare states?

Page 19: Uninformed Search

Tree or Graph?

Issues: How common are repeated states?

How expensive is it to compare states?

Examples: 8-puzzle

chess

school lunch planning

defense lawyer

theorem proving