6주 강의

Informed Search methods
5주 강의
Best-first Search
Evaluation function :::
a number purporting to
described the desirability of expanding the node
Best-first search ::: a node with the
best evaluation is expanded first
자료구조가 중요!!! Queue를 사용하되
linked list로 구현???
Greedy search
heuristic function h(n)
h(n) = estimated cost of the cheapest path from the state
at node n to a goal state
현재부터 가장 가까운 거리에 있는 것
Hill climbing method
Iterative improvement
algorithm
Hill climbing method
Simulated annealing
Neural networks
Genetic algorithm
Hill climbing Method
Simple hill climbing method :::
연산을 적용
한 결과가 goal인지 검사 후, 아니면 기존보다 좋으면 무
조건 선택, 아니면 다른 연산 적용, 더 이상 적용할 연산이
없으면 실패  선택한 노드에서 다시 탐색
Steepest-ascent hill climbing method
::: 현재 노드(상태)에 모든 가능한 연산을 적용한 결
과에 goal이 있으면 성공, 아니면 제일 좋은 것을 선택하
여, 기존보다 좋으면 그 노드에서 다시 탐색, 아니면 실패
Complete하지 못함
예제
A
H
H
G
G
F
F
E
E

D
D
C
C
B
B
A
First move
H
G
F
E
D
C
A
B
Second move(Three possible
moves)
A
H
G
G
G
F
F
F
E
E
E
D
D
D
C
C
H
C
B
A
B
(a)
(b)
A
H
(c)
B
Two heuristics
Local : Add one point for
every block that is resting on
the thing it is supposed to be
resting on. Subtract one point
for every block that is sitting
on the wrong thing
goal : 8
initial state : 4
first move : 6
second move:
(a) 4, (b) 4, (c) 4
Global : For each block that
has the correct support
structure, add one point for
every block in the support
structure. For each block that
has an incorrect support
structure, subtract one point
for every block in the existing
support structure
goal : 28,
initial : -28;
first move : -21;
second move: (a) –28,
(b) –16, (c)-15
Hill climbing method의 약점
Local maxima
Plateau
Ridges
Random-restart hill climbing
Simulated annealing
Simulated annealing
알고리즘
for t  1 to ∞ do
Tschedule[t]
if T=0 then return current
next  a randomly selected successor of current
∆E  Value[next]-Value[current]
if ∆E>0 then current next
else current next only with probability e∆E /T
이동성 P=e∆E /T (P=e-∆E /kT
일반적으로 에너지가 낮은 방향으로 물리현상은 일어나지만
높은 에너지 상황으로 변하는 확률이 존재한다.
∆E : positive change in energy level
T : Temperature
k : Boltzmann’s constant
Heuristic Search
f(n)=g(n)+h(n)
f(n) = estimated cost of the cheapest
solution through n
Best-first search
Minimizing the total path cost
*
(A algorithm)
Admissible heuristics ::: an h function
that never overestimates the cost to
reach the goal
If h is a admissible, f(n) never
overestimates the actual cost of the
best solution through n
The behavior of A* search
Monontonicity ::: along any path from
the root, the f-cost never decreases
-- underestimate하면 non-monotonic할 수 있음
Complete and optimal
f(n’) = max(f(n),g(n’)+h(n’))
(n이 n’의 parent node)
optimality와 completeness를 증명한다
A* Algoritmd의 예
•
•
8(16)-puzzle에서 City block distance (Manhattan
distance)를 사용
: 절대 overestimate하지 않는다…
h1 ::: the number of titles in wrong position
h2 ::: Manhattan distance
결과비교
d
14
24
IDS
A*(h1)
A*(h2)
3473941(2.83)
539(1.42)
73(1.24)
불가능
39135(1.48)
1641(1.26)
Inventing heuristic functions
Relaxed problem
(a) 타일은 인접한 장소로 움직일 수 있다
(b) 타일은 빈자리로 이동할 수 있다
(c) 타일은 다른 위치로 이동할 수 있다
h(n)=max(h1(n), …,hn(n))  실제 값과
가장 가까이 예측하는 함수가 좋다
Heuristics for CSPs
Most-constrained-variable heuristics
:: forward checking  the variable with
fewest possible values is chosen to
have a value assigned
Most-constraining-variable heuristics
:: assigning a value to the variable that
is involved in the largest number of
constraints on the unassigned variables
(reducing the branching factor)
Example
B
A
GREEN
C
RED
E
F
D
Memory Bounded Search
Simplified Memory-Bound A*
A
B
G
10
10+5=15
C
E
10
30+5=35
8+5=13
D
10
20+5=25
8
10
F
10
H
20+0=20
30+0=30
J
8
8
24+0=24
A
I
16
24+0=24
K
24+5=29
A
A
A
12
12
8
16+2=18
13
B
13(15)
15
15
8
A
20(24)
15
15(15)
G
B
B
G
B
15
20(
8
)
15
24
C
25(
/
8
8
24(
I
24
)
A
A
15(24)
13
H
13
18(
/
A
G
G
B
)
)
D
20