ARTIFICIAL INTELLIGENCE
Lecturer: Silja Renooij
Pathfinding and search
Utrecht University The Netherlands
These slides are part of the INFOB2KI Course Notes available from www.cs.uu.nl/docs/vakken/b2ki/schema.html
ARTIFICIAL INTELLIGENCE Pathfinding and search Lecturer: Silja - - PowerPoint PPT Presentation
Utrecht University INFOB2KI 2019-2020 The Netherlands ARTIFICIAL INTELLIGENCE Pathfinding and search Lecturer: Silja Renooij These slides are part of the INFOB2KI Course Notes available from www.cs.uu.nl/docs/vakken/b2ki/schema.html
Utrecht University The Netherlands
These slides are part of the INFOB2KI Course Notes available from www.cs.uu.nl/docs/vakken/b2ki/schema.html
2
`Physical’ world: open space or structured?
3
4
5
6
7
8
We often represent the world in a simplified way
(waypoint) graph), or
9
Edsger W. Dijkstra 1930‐2002
10
11
12
13
14
Open: (S,140) A, (O,146) Z, (L,229)T Closed: (Arad,0), (Z,75) A, (T,118) A
15
Open: (O,146)Z, (L,229) T, (R,220)S, (F,239) S Closed: (Arad,0), (Z,75) A, (T,118) A, (S,140) A
140 + 151 > 146
16
Open: (L,229) T, (R,220) S, (F,239) S Closed: (Arad,0), (Z,75) A, (T,118) A, (S,140) A, (O,146) Z
17
Open: (L,229) T, (F,239) S, (C,366)R, (P,317) R Closed: (Arad,0), (Z,75) A, (T,118) A, (S,140) A, (O,146) Z, (R,220) S
18
Open: (F,239) S, (C,366) R, (P,317) R, (M,299)L Closed: (Arad,0), (Z,75) A, (T,118) A, (S,140) A, (O,146) Z, (R,220) S, (L,229) T
19
Open: (C,366) R, (P,317) R, (M,299) L, (B,450)F Closed: (Arad,0), (Z,75) A, (T,118) A, (S,140) A, (O,146) Z, (R,220) S, (L,229) T, (F,239) S
20
Open: (C,366) R, (P,317) R, (B,450) F, (D,374)M Closed: (Arad,0), (Z,75) A, (T,118) A, (S,140) A, (O,146) Z, (R,220) S, (L,229) T, (F,239) S, (M,299) L
21
Open: (C,366) R, (B,450) F, (D,374) M, (B,418)P Closed:(Arad,0), (Z,75) A, (T,118) A, (S,140) A, (O,146) Z, (R,220) S, (L,229) T, (F,239) S, (M,299) L, (P,317) R
317+138>366
22
Open: (D,374) M, (B,418) P Closed:(Arad,0), (Z,75) A, (T,118) A, (S,140) A, (O,146) Z, (R,220) S, (L,229) T, (F,239) S, (M,299)L, (P,317) R, (C,366) R
366+120>374
23
Open: (B,418) P Etc…. (Dijkstra continues, we stop…) Closed: (Arad,0), (Z,75) A, (T,118) A, (S,140) A (O,146) Z, (R,220) S, (L,229) T, (F,239) S, (M,299) L, (P,317) R, (C,366) R, (D,374) M
24
(Arad,0), (Z,75) A, (T,118) A, (S,140) A, (O,146) Z, (R,220) S, (L,229) T, (F,239) S, (M,299) L, (P,317) R, (C,366) R, (D,374) M,(B,418) P
25
26
Note: goal‐test only when node is considered for expansion, not already upon generation!
27
# fringe = frontier = open list Note: goal‐test upon expansion; sometimes more efficient upon generation!
28
– state S – parent node – action – path cost g(x), – depth,…
– creates new nodes – fills in the various node fields – uses problem‐associated Successor‐Fn to generate successors
29
30
31
32
33
34
35
36
– completeness: does it always find a solution if one exists? – optimality: does it always find a least‐cost solution? – time complexity: how long does it take to find a solution? – space complexity: how much memory is needed?
– b: maximum branching factor of the search tree (max # succ.) – d: depth of optimal (least‐cost) solution
(start with d=0)
– m: maximum length of path in state space
(may be ∞)
– total number of nodes generated
(= time)
– maximum number of nodes in memory
(= space)
Solution quality Search complexity
37
38
39
40
41
42
(if goal‐test upon expansion: + b(bd‐1) = O(bd+1))
dominate costs for closed list in GRAPH‐SEARCH
43
44
(# of nodes with path cost g ≤ C * )
typically dominate costs for closed list in GRAPH‐SEARCH
45
46
47
48
49
done at H
50
done at I done at D
51
52
done at J
53
done at K done at E done at B
54
55
56
done at L
– terrible if m is much larger than d – but if solutions are dense, may be much faster than breadth‐first
(“black” nodes are removed from memory)
57
Advantage may be lost in GRAPH‐SEARCH due to costs for closed list !
58
59
(do we know d ??)
Again advantage may be lost in GRAPH‐SEARCH due to costs for closed list !
60
61
62
63
64
65
66
Inherited from BFS; same assumptions apply Inherited from DFS, but max depth restricted to d; same observations wrt GRAPH‐SEARCH apply
67
68