Introduction to Artificial Intelligence Problem Solving through - - PowerPoint PPT Presentation

introduction to artificial intelligence problem solving
SMART_READER_LITE
LIVE PREVIEW

Introduction to Artificial Intelligence Problem Solving through - - PowerPoint PPT Presentation

Introduction to Artificial Intelligence Problem Solving through Search (Goal-based agents) BFS, DFS, Greedy Search Janyl Jumadinova September 12-16, 2016 Example: Romania On holiday in Romania; currently in Arad. Flight leaves tomorrow from


slide-1
SLIDE 1

Introduction to Artificial Intelligence Problem Solving through Search (Goal-based agents) BFS, DFS, Greedy Search

Janyl Jumadinova September 12-16, 2016

slide-2
SLIDE 2

Example: Romania

On holiday in Romania; currently in Arad. Flight leaves tomorrow from Bucharest Formulate goal: be in Bucharest Formulate problem: states: various cities actions: drive between cities Find solution: sequence of cities, e.g., Arad, Sibiu, Fagaras, Bucharest

2/38

slide-3
SLIDE 3

Example: Romania

3/38

slide-4
SLIDE 4

Tree search algorithms

Basic idea:

  • ffline, simulated exploration of state space

by generating successors of already-explored states (a.k.a. expanding states)

4/38

slide-5
SLIDE 5

Tree search example

5/38

slide-6
SLIDE 6

Tree search example

6/38

slide-7
SLIDE 7

Tree search example

7/38

slide-8
SLIDE 8

Implementation: states vs. nodes

A state is a (representation of) a physical configuration A node is a data structure constituting part of a search tree includes parent, children, depth, path cost g(x) States do not have parents, children, depth, or path cost!

8/38

slide-9
SLIDE 9

Breadth-first search

Expand shallowest unexpanded node

◮ FIFO queue, i.e., new successors go at end

A B C D E F G

9/38

slide-10
SLIDE 10

Breadth-first search

Expand shallowest unexpanded node

◮ FIFO queue, i.e., new successors go at end

A B C D E F G

10/38

slide-11
SLIDE 11

Breadth-first search

Expand shallowest unexpanded node

◮ FIFO queue, i.e., new successors go at end

A B C D E F G

11/38

slide-12
SLIDE 12

Breadth-first search

Expand shallowest unexpanded node

◮ FIFO queue, i.e., new successors go at end

A B C D E F G

12/38

slide-13
SLIDE 13

Breadth-first search

Arad

13/38

slide-14
SLIDE 14

Breadth-first search

Zerind Sibiu Timisoara Arad

14/38

slide-15
SLIDE 15

Breadth-first search

Arad Oradea Zerind Sibiu Timisoara Arad

15/38

slide-16
SLIDE 16

Breadth-first search

Arad Oradea Rimnicu Vilcea Fagaras Arad Lugoj Arad Oradea Zerind Sibiu Timisoara Arad

16/38

slide-17
SLIDE 17

Breadth-first search

17/38

slide-18
SLIDE 18

Depth-first search

Expand deepest unexpanded node

◮ LIFO queue, i.e., put successors at front

Arad

18/38

slide-19
SLIDE 19

Depth-first search

Expand deepest unexpanded node

◮ LIFO queue, i.e., put successors at front

Zerind Sibiu Timisoara Arad

19/38

slide-20
SLIDE 20

Depth-first search

Expand deepest unexpanded node

◮ LIFO queue, i.e., put successors at front

Arad Oradea Zerind Sibiu Timisoara Arad

20/38

slide-21
SLIDE 21

Depth-first search

Expand deepest unexpanded node

◮ LIFO queue, i.e., put successors at front

Zerind Sibiu Timisoara Arad Oradea Zerind Sibiu Timisoara Arad

21/38

slide-22
SLIDE 22

Best-first search

Idea: use an evaluation function for each node – estimate of “desirability”

22/38

slide-23
SLIDE 23

Best-first search

Idea: use an evaluation function for each node – estimate of “desirability” ⇒ Expand most desirable unexpanded node

22/38

slide-24
SLIDE 24

Best-first search

Idea: use an evaluation function for each node – estimate of “desirability” ⇒ Expand most desirable unexpanded node Implementation: a queue sorted in decreasing order of desirability

22/38

slide-25
SLIDE 25

Best-first search

Idea: use an evaluation function for each node – estimate of “desirability” ⇒ Expand most desirable unexpanded node Implementation: a queue sorted in decreasing order of desirability Special cases: greedy search, A∗ search

22/38

slide-26
SLIDE 26

Romania with step costs in km

Bucharest Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Sibiu Fagaras Pitesti Rimnicu Vilcea Vaslui Iasi Straight−line distance to Bucharest 160 242 161 77 151 241 366 193 178 253 329 80 199 244 380 226 234 374 98

Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Sibiu Fagaras Pitesti Vaslui Iasi Rimnicu Vilcea Bucharest

71 75 118 111 70 75 120 151 140 99 80 97 101 211 138 146 85 90 98 142 92 87 86

A* slide

23/38

slide-27
SLIDE 27

Greedy search

Evaluation function h(n) (heuristic) = estimate of cost from n to the closest goal Example: h(n) = straight-line distance from n to Bucharest

24/38

slide-28
SLIDE 28

Greedy search

Evaluation function h(n) (heuristic) = estimate of cost from n to the closest goal Example: h(n) = straight-line distance from n to Bucharest

◮ Greedy search expands the node that appears to be closest to

goal

24/38

slide-29
SLIDE 29

Greedy Search

Arad 366

25/38

slide-30
SLIDE 30

Greedy Search

Zerind Arad Sibiu Timisoara 253 329 374

26/38

slide-31
SLIDE 31

Greedy Search

Rimnicu Vilcea

Zerind Arad Sibiu Arad Fagaras Oradea Timisoara 329 374 366 176 380 193

27/38

slide-32
SLIDE 32

Greedy Search

Rimnicu Vilcea

Zerind Arad Sibiu Arad Fagaras Oradea Timisoara Sibiu Bucharest 329 374 366 380 193 253

28/38

slide-33
SLIDE 33

Greedy search

◮ Can get stuck in loops, e.g.,

Iasi → Neamt → Iasi → Neamt → Complete in finite space with repeated-state checking

◮ A good heuristic can give dramatic improvement in search cost 29/38

slide-34
SLIDE 34

http://aispace.org/search/

Explore Best first search (explanation from AIspace: http://www.aispace.org/deduction/help/tut3.shtml)

30/38

slide-35
SLIDE 35

A* search

Idea:

avoid expanding paths that are already expensive

31/38

slide-36
SLIDE 36

A* search

Idea:

avoid expanding paths that are already expensive

◮ Evaluation function f (n) = g(n) + h(n) ◮ g(n) = cost so far to reach n ◮ h(n) = estimated cost to goal from n ◮ f (n) = estimated total cost of path through n to goal

Romania with step costs

31/38

slide-37
SLIDE 37

Example: Romania

32/38

slide-38
SLIDE 38

A* Search

Arad 366=0+366

33/38

slide-39
SLIDE 39

A* Search

Zerind Arad Sibiu Timisoara 447=118+329 449=75+374 393=140+253

34/38

slide-40
SLIDE 40

A* Search

Zerind Arad Sibiu Arad Timisoara

Rimnicu Vilcea

Fagaras Oradea 447=118+329 449=75+374 646=280+366 413=220+193 415=239+176 671=291+380

35/38

slide-41
SLIDE 41

A* Search

Zerind Arad Sibiu Arad Timisoara Fagaras Oradea 447=118+329 449=75+374 646=280+366 415=239+176

Rimnicu Vilcea

Craiova Pitesti Sibiu 526=366+160 553=300+253 417=317+100 671=291+380

36/38

slide-42
SLIDE 42

A* Search

Zerind Arad Sibiu Arad Timisoara Sibiu Bucharest

Rimnicu Vilcea

Fagaras Oradea Craiova Pitesti Sibiu 447=118+329 449=75+374 646=280+366 591=338+253 450=450+0 526=366+160 553=300+253 417=317+100 671=291+380

37/38

slide-43
SLIDE 43

A* Search

Zerind Arad Sibiu Arad Timisoara Sibiu Bucharest

Rimnicu Vilcea

Fagaras Oradea Craiova Pitesti Sibiu Bucharest Craiova

Rimnicu Vilcea

418=418+0 447=118+329 449=75+374 646=280+366 591=338+253 450=450+0 526=366+160 553=300+253 615=455+160 607=414+193 671=291+380

38/38