Graduate AI
Lecture 2: Search I
Instructors: Nihar B. Shah (this time)
- J. Zico Kolter
Graduate AI Lecture 2: Search I Instructors: Nihar B. Shah (this - - PowerPoint PPT Presentation
Graduate AI Lecture 2: Search I Instructors: Nihar B. Shah (this time) J. Zico Kolter E XAMPLE : P ATHFINDING Best route? 2 E XAMPLE : 8-P UZZLE Fewest moves? 5 2 1 2 3 6 1 3 4 5 6 7 8 4 7 8 15780 Spring 2019: Lecture 2
Instructors: Nihar B. Shah (this time)
2
15780 Spring 2019: Lecture 2
3 5 4 6 1 8 7 3 2 5 4 6 1 8 7 3 2
15780 Spring 2019: Lecture 2
4
5
! "
6
! "
7
! "
8
! " 3 2 4 1
15780 Spring 2019: Lecture 2
9
# $ % & '
1 3 2 5 1 1 1
! "
starting state goal
15780 Spring 2019: Lecture 2
10 5 4 6 1 8 7 3 2 5 4 6 1 8 7 3 2 5 4 6 1 8 7 3 2 5 4 6 1 8 7 3 2
s t
1 1
15780 Spring 2019: Lecture 2
11
15780 Spring 2019: Lecture 2
12
# $ % & '
1 1 1 1 1 1
, = 0 , = 1
#
, = 2
$
, = 2
&
, = 2
'
1
#1 #2 #3
! " !
, = 3
%
15780 Spring 2019: Lecture 2
13
15780 Spring 2019: Lecture 2
14
# $ % & '
1 3 2 5 1 1
, = 0 , = 1
#
, = 2
$
, = 4
&
, = 6
'
, = 3
%
, = 6
1
, = 7
&
#1 #2 #3 #4 #5 #6 #7
! " ! "
s a d s a e d Frontier:
15780 Spring 2019: Lecture 2
15
16
! "
15780 Spring 2019: Lecture 2
17 5 4 6 1 8 7 3 2 5 4 6 1 8 7 3 2
15780 Spring 2019: Lecture 2
18
# $ % & '
1 3 2 5 1 1 1
ℎ = 6 ℎ = 5 ℎ = 2 ℎ = 0 ℎ = 1 ℎ = 6 ℎ = 7
! "
15780 Spring 2019: Lecture 2
19
# $ % & '
1 3 2 5 1 1
ℎ = 6 ℎ = 5
#
ℎ = 6
$
ℎ = 2
&
ℎ = 1
'
ℎ = 2
&
ℎ = 0
1
#1 #2 #3 #4 #5
ℎ = 6 ℎ = 5 ℎ = 2 ℎ = 0 ℎ = 1 ℎ = 6 ℎ = 7
! " ! "
15780 Spring 2019: Lecture 2
20
# $ % & '
1 3 2 5 1 1 1
ℎ = 6 ℎ = 5 ℎ = 2 ℎ = 0 ℎ = 1 ℎ = 6 ℎ = 7
! "
6 = 6 6 = 6
#
6 = 8
$
6 = 6
&
6 = 7
'
6 = 6
"
#1 #2 #3 #4
!
15780 Spring 2019: Lecture 2
21
# $
2 2
ℎ = 3 ℎ = 2 ℎ = 0 ℎ = 1
2 3
Slide adapted from Dan Klein
! "
6 = 3 6 = 4
#
6 = 3
$
6 = 5
"
6 = 4
"
#1 #2 #4
!
#3
15780 Spring 2019: Lecture 2
22
15780 Spring 2019: Lecture 2
23
#
5 1
ℎ = 7 ℎ = 0 ℎ = 6
3
Slide adapted from Dan Klein
! "
6 = 7 6 = 7
#
6 = 5
"
#1 #2
!
15780 Spring 2019: Lecture 2
24
# $
2 2
ℎ = 3 ℎ = 2 ℎ = 0 ℎ = 1
2 3
! "
§ Aerial distance in pathfinding § ℎ ≡ 0
#
5 1
ℎ = 7 ℎ = 0 ℎ = 6
3
! "
§ §
15780 Spring 2019: Lecture 2
25
26
Adapted from Dan Klein
15780 Spring 2019: Lecture 2
27 5 4 6 1 8 7 3 2 5 4 6 1 8 7 3 2
Example state Goal state
15780 Spring 2019: Lecture 2
28 5 4 6 1 8 7 3 2 5 4 6 1 8 7 3 2
Example state Goal state
15780 Spring 2019: Lecture 2
29
Length N∗(OP) N∗(OQ) 16 1301 211 18 3056 363 20 7276 676 22 18094 1219 24 39135 1641
15780 Spring 2019: Lecture 2
30
15780 Spring 2019: Lecture 2
function GRAPH-SEARCH(problem, strategy) set of frontier nodes contains the start state of problem loop
and add it to the expanded set
frontier nodes, only if not in the expanded set
31
15780 Spring 2019: Lecture 2
32
# $
1 1
ℎ = 2 ℎ = 4 ℎ = 1 ℎ = 1
1 2
%
3
ℎ = 0
Adapted from Dan Klein
! "
6 = 2 6 = 5
#
6 = 2
$
#1 #2
!
6 = 4
%
6 = 6
"
#3 #4
6 = 3
%
#5
15780 Spring 2019: Lecture 2
1.
Admissible ⇒ consistent
2.
Consistent ⇒ admissible
3.
They are equivalent
4.
They are incomparable
33
S "
15780 Spring 2019: Lecture 2
34 5 4 6 1 8 7 3 2 5 4 6 1 8 7 3 2
Example state Goal state
Consistent heuristics yield guarantees for A*graph search (next class)
15780 Spring 2019: Lecture 2
uniform cost search, greedy, A*
35