+ All Categories
Home > Documents > Use “Search” for Pathfinding FactorySchool Library Hospital Park Newsagent University church...

Use “Search” for Pathfinding FactorySchool Library Hospital Park Newsagent University church...

Date post: 16-Dec-2015
Category:
Upload: hilda-charles
View: 215 times
Download: 1 times
Share this document with a friend
25
Use “Search” for Pathfinding Factory School Library Hospital Park Newsagent University church Example from Alison Cawsey’s book sta rt finis h
Transcript

Use “Search” for Pathfinding

FactorySchool

Library

Hospital

Park

Newsagent

University

church

Example from Alison Cawsey’s book

start

finish

Breadth First Searchlibrary

school hospital

factorypark

newsagent

university church

Put things on the back of the list “to visit later”

Depth First Searchlibrary

school hospital

factorypark

newsagent

university church

Put things on the front of the list “to visit later”

Breadth vs. Depth Which is better?

library

school

hospital

factorypark

newsagent

university

churchstadium grocers

market bridgefountain

Breadth vs. Depth Which is better?

library

school

hospital

factorypark

newsagent

market

churchstadium grocers

bridgeuniversity

Breadth vs. Depth Which is better?

Depends on problem

Breadth usually needs a lot more memory Remember all the bits you need to expand next

Breadth could be good if There are many long dead ends,

But one very short successful path

Depth could be good if There are many successful paths

But all are quite long

Can also combine – set a depth limit

What about a big open space?

See demo…

Break it up into squares Each node has 8 children

(Be careful about looping)

That’s an awfully big tree!

Need some clever tricks…

How would a human do it?

Heuristics Search we did before is called “blind” or “brute force” (not clever)

Heuristic is a clever rule of thumb

Hill-climbing with Heuristic

FactorySchool

Library

Hospital

Park

Newsagent

University

church

startfinish

Heuristic: how close to goal

Hill-climbing with Heuristic

Library 9

School 7 Hospital 5

Factory 5Park 6

Newsagent 0

University 3 Church 4

finish

Heuristic: how close to goal

Hill-climbing with Heuristic

FactorySchool

Library

Hospital

Park

Newsagent

University

church

start

finish

Heuristic: how close to goal

Hill-climbing with Heuristic

Library 9

School 7 Hospital 5

Factory 5Park 2

Newsagent 4

University 0 Church 4

finish

Heuristic: how close to goal

Hill-climbing with HeuristicHeuristic: how close to goal

from Russell and Norvig’s book

Best first Search

Library 9

School 7 Hospital 5

Factory 5Park 2

Newsagent 4

University 0 Church 4

finish

Heuristic: how close to goal

Order the list of nodes “to visit later” Do best first

But try others later

Very good, e.g. in open space

Doesn’t consider how far we’ve come though A* - more in practical

Search is an abstract technique… Jugs problem

Two jugs, 4 litre and 3 litre

Want to get 2 litres in 4 litre jug

Formulate problem Can represent state as (0,0) or (4,0) or (4,2)…

Actions:

Fill 4 litre ( _ , _ ) ( 4 , _ )

Fill 3 litre ( _ , _ ) ( _ , 3 )

Empty 4 litre ( _ , _ ) ( 0 , _ )

Empty 3 litre ( _ , _ ) ( _ , 0 )

What else?

Search for games: Minimax

Search for games: Minimax

Alpha-Beta pruning example

Alpha value

I get at least this

Beta value

I get at most this(if I go here)

Alpha-Beta pruning example

No question about 3 now

What about real (hard) games? So far we searched all the way to the end of the game

Not feasible in chess, branching factor 35

So far we didn’t use heuristics Do a limited lookahead

Distance to goal? Evaluate the board state Requires intelligence: pieces, their positions, and stage in game

How much lookahead? Modern computer?

Alpha beta can give about double

4 moves ≈ human novice

8 moves ≈ human master

12 moves ≈ Deep Blue, Kasparov

Deep Blue had extra tricks to look further on interesting paths

Go Branching factor ≈ 300… forget it!

Use databases of patterns

What is search good for? Pretty much everything!

Pathfinding, puzzles, general problem solver, games

Scheduling deliveries

Arranging the CS1013 timetable

Diagnostic systems find a set of malfunctions that explain the symptoms

Speech recognition find the right sequence of words

Finding templates/models to match a visual scene

Learning is search for a hypothesis

Planning systems Find a sequence of actions that achieves a given goal

We will look at this next week

Defence

A big user of AI.

"... the deployment of a single logistics support aid called DART during the Desert Shield/Storm

Campaign paid back all US government investment in AI/KBS research over a 30 year period."

Tate A. Smart Planning. ARPI Proc. 1996.

Search is an abstract technique…

What are we really doing here?

What is the science of abstraction?

Mathematics

Look at problems abstractly

See that they’re the same

Use one technique for many problems

Note on Heuristics Hard to come up with a good heuristic

Often use human intelligence Is the chess computer smart? What about TD-Backgammon

Try the Missionaries and Cannibals http://www.learn4good.com/games/puzzle/boat.htm

Interesting because human heuristics go awry

Computer is not confused Remember the first law

6 1 7

3 4

5 8 2

1 2 3

4 5

6 7 8

Recap: What have you learned about “Search” “Blind” or “brute force” techniques

Breadth first Depth first

Heuristic techniques Hill-climbing Best first A* - more in practical

General problem solving

Game playing Minimax Alpha-Beta pruning

Search can apply to many diverse problems Makes some tasks simple for computers Heuristics need some intelligence

Musings… Computer: Some simple tricks can go a long way Power of computer to store so much and go so fast Just like life – simple blocks


Recommended