24.06.2015 Views

COMP9414: Artificial Intelligence Informed Search - Sorry

COMP9414: Artificial Intelligence Informed Search - Sorry

COMP9414: Artificial Intelligence Informed Search - Sorry

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>COMP9414</strong>, Wednesday 23 March, 2005 <strong>Informed</strong> <strong>Search</strong> 4<br />

Heuristics — Example<br />

<strong>COMP9414</strong>, Wednesday 23 March, 2005 <strong>Informed</strong> <strong>Search</strong> 6<br />

Heuristics — Example<br />

8-Puzzle — number of tiles out of place<br />

2 8 3<br />

1<br />

2<br />

3<br />

Another common heuristic is the straight-line distance (“as the crow<br />

flies”) from node to goal<br />

1 6 4<br />

8<br />

4<br />

n<br />

7 5<br />

Therefore, h(n) = 5<br />

7<br />

6<br />

5<br />

Therefore, h(n) = distance from n to g<br />

g<br />

<strong>COMP9414</strong> c○UNSW, 2005 Generated: 24 March 2005<br />

<strong>COMP9414</strong> c○UNSW, 2005 Generated: 24 March 2005<br />

<strong>COMP9414</strong>, Wednesday 23 March, 2005 <strong>Informed</strong> <strong>Search</strong> 5<br />

Heuristics — Example<br />

<strong>COMP9414</strong>, Wednesday 23 March, 2005 <strong>Informed</strong> <strong>Search</strong> 7<br />

Best-First <strong>Search</strong><br />

8-Puzzle — Manhattan distance (distance tile is out of place)<br />

2 8 3 1 2 3<br />

1 6 4 8 4<br />

7 5 7 6 5<br />

function BestFirst<strong>Search</strong>(problem, EvalFn) returns solution sequence<br />

inputs: problem — a problem<br />

EvalFn — evaluation function<br />

QueueingFn ← function that orders nodes by EvalFn<br />

return General<strong>Search</strong>(problem, QueueingFn)<br />

Therefore, h(n) = 1 + 1 + 0 + 0 + 0 + 1 + 1 + 2 = 6<br />

<strong>COMP9414</strong> c○UNSW, 2005 Generated: 24 March 2005<br />

<strong>COMP9414</strong> c○UNSW, 2005 Generated: 24 March 2005

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!