Example Problems
- Robotic Vacuum Cleaner
- 8-Puzzle
- 8-queens
- Route-finding problem
Solving Problems by Searching
์ฉ์ด ์ ์
- Problem formulation: ์ด๋ค ๊ณ ๋ คํ state, action์ ๊ฒฐ์ ํ ์ง ์ ํ๋ ํ๋ก์ธ์ค → ๋ชฉํ๋ ์ฃผ์ด์ ธ ์์
- ๋ฌธ์ ๋ state space, initial state, goal state, action, transition model, action cost function์ผ๋ก ๊ตฌ์ฑ
- action์ ์ฐ์์ path๋ฅผ ๊ตฌ์ฑ
- solution: initial state→goal state๋ก ๊ฐ๋ path
- optimal solution: path cost๊ฐ ๊ฐ์ฅ ์ ์ ํด๋ต
- search: ๋ชฉํ์ ๋๋ฌํ ์ ์๋ ํ๋์ ์ฐ์์ ์ฐพ๋ ๊ฒ
- execution phase์์ ํ๋์ ํ ๋ฒ์ ํ ๊ฐ์ฉ ์ฐพ์๋ผ ์ ์๋ค.
Abstraction
- ์ ์: ํํ์ ํ์ ์๋ ๋ํ
์ผ์ ๊ฐ์ถ๋ ๊ฒ
- Useful abstraction
- Valid abstraction
- level of abstraction
State space
- ์ ์: ํ๊ฒฝ์ด ์ฒํ ์ ์๋ ๊ฐ๋ฅํ state์ ์งํฉ
- ๊ทธ๋ํ๋ก ํํ: vertices → state, edges → actions
- solution
Search Tree
- Node expansion: Node generation, parent / child / successor node
- reached state: ํด๋น state์ ๋ง๋ ๋ ธ๋๊ฐ ์์ฑ๋ ์ํ
- frontier: unexpanded node์ ์งํฉ
- redundent path and cycle ์ ๊ฒฝ์ฐ๋ฉด → graph search, ์๋๋ฉด → tree-like search
ํ์ ์ ๋ต ๋ฐ ์ฑ๋ฅ ํ๊ฐ
- ํ์ ์ ๋ต
- FIFO
- LIFO
- Highest priority first
- ์ฑ๋ฅ ํ๊ฐ
- completeness
- cost optimality
- time complexity
- space complexity
Task Environment์ ํน์ง
- Task environment: ์ฑ๋ฅํ๊ฐ, ํ๊ฒฝ, actuator, sensor
- fully observable, partially observable, unobservable ⇒ sensor
- deterministic, nondeterministic, stochastic ⇒ transition model
- discrete, continuous ⇒ state, action, sensor, time
- known, unknown ⇒ laws of physics
- single, multiagent ⇒ agent
- episodic, sequential ⇒ dependency
- static, dynamic, semi-dynamic ⇒ state and action
- fully observable, deterministic, known environment → solution = fixed sequence of actions
Uninformed Searches
Breadth-First Search
- ์ ์: ๋ฃจํธ ๋ ธ๋๊ฐ ๊ฐ์ฅ ๋จผ์ ํ์ฅ๋๊ณ , ๋ฃจํธ ๋ ธ๋์ ์์์ด ํ์ฅ๋๊ณ , ๊ทธ ๋ค์ ๊ทธ๋ค์ ์์์ด ํ์ฅ๋๊ณ … ํ๋ ์
- ์๋์ฝ๋ ํน์ง
- IsGoal ํจ์: frontier์ FIFO queue๋ฅผ ์ฌ์ฉ
- reached: ๋ ธ๋๊ฐ ์์ฑ๋๋ฉด reached list์ ์ ์ฅ
- ์ฑ๋ฅ ํ๊ฐ
- Complete: ์ ํํ branching factor, ์ ํ/๋ฌดํ state space
- Cost optimalํ์ง ์์
- time complexity: O(b^d) → b: branching factor, d: ๊ฐ์ฅ ์์ ํด
- space complexity: O(b^d)
- ๋ต์ด ์์ผ๋ฉด ๋ฌด์กฐ๊ฑด ์ฐพ์ ์ ์๋ค.
Uniform-Cost Search
- ์ ์: ๊ฐ์ฅ ์ ์ path cost g(n)์ ๊ฐ์ง ๋ ธ๋ n์ผ๋ก ํ์ฅ
- ์๋์ฝ๋ ํน์ง
- reached: lookup table → key problem.Initial & value node
- child.PathCost < reached[s].PathCost : ๋ฐฉ๋ฌธ์ ์ด๋ฏธ ํ ์ํ์์ ๋น๊ต๋ง
- late goal test
- ์ฑ๋ฅ ํ๊ฐ
- Complete: ๋ชจ๋ cost๊ฐ ์์๋ผ๋ ์กฐ๊ฑด์ด ์์ด์ผ ํจ
- Cost-Optimal
- Time complexity: O(b^{1+\lfloor{C/\epsilon}\rfloor})
- Space complexity: O(b^{1+\lfloor{C/\epsilon}\rfloor}) → C*: optimal solution์ cost
- ํ๋๋ง ์ ํํ๋ ค๋ฉด time๋ณด๋ค๋ space๋ฅผ ์ค์ด๋ ๊ฒ์ด ํ์
Depth-First Search
- ์ ์: Frontier์ ์๋ ๊ฐ์ฅ ๊น์ ๋
ธ๋๋ฅผ ํ์ฅ
- backing search: ๋จ 1๊ฐ์ successor๋ง์ด ์์ฑ๋จ → ๋ถ๋ถ์ ์ผ๋ก ํ์ฅ๋ ๋ ธ๋๋ ๋ค์ ๋ฒ์ ํ์ฅ๋ ๋ ธ๋์ ๋ํด์ ๊ธฐ์ต
- ์๋ก์ด ๋ฉ๋ชจ๋ฆฌ๋ฅผ ํ ๋นํ๋ ๊ฒ๋ณด๋ค ํ์ฌ ์ํ ์ค๋ช ์ ์ง์ ๋ณ๊ฒฝํจ์ผ๋ก์จ successor ์์ฑ → backtrack์ด ๊ฐ๋ฅํ๊ฒ ํ๊ธฐ ์ํด์๋ ๋๋๋ฆฌ๋ ๊ฒ์ด ๊ฐ๋ฅํด์ผ ํจ
- ์ฑ๋ฅ ํ๊ฐ
- Completeness
- not complete: infinite state space, tree-like search
- complete: finite, graph
- Not cost-optimal
- Time complexity: $O(b^m)$ → m: ํธ๋ฆฌ์ ์ต๋ ๊น์ด
- Space complexity
- O(b^m): graph search → backtracking ์ ๋ณด๋ฅผ ์ ์งํด์ผ ํ๋ฏ๋ก
- O(bm): tree-like search → ํธ๋ฆฌ ์์น๋ฅผ ํ๋ฉด completeํด์ง์ง ์์ผ๋ฏ๋ก
- O(m): backtracking search
- Completeness
Depth-Limited Search
- ์ ์: depth limit l์ด ์ ํด์ ธ ์์ → ๊น์ด l์ธ ๋ ธ๋์ ๊ฒฝ์ฐ๋ successor๊ฐ ์๋ ๊ฒ์ฒ๋ผ ์ทจ๊ธ
- ์๋์ฝ๋ ํน์ง
- result ← cutoff
- ์ฑ๋ฅ ํ๊ฐ
- Not complete
- Not cost-optimal
- time complexity: $O(b^l)$ → l: depth limit
- space complexity: $O(bl)$ → ๋ฐฉ๋ฌธํ ๋ ธ๋ ๋ฆฌ์คํธ๋ฅผ ์ ์งํ์ง ์์ผ๋ฏ๋ก
Iterative Deepening Search
- ์ ์: depth-limited search + increasing limits
- ์ฑ๋ฅ ํ๊ฐ
- Complete
- Not cost-optimal
- Time complexity: O(b^d)
- Space complexity: O(bd) → ๋ฉ๋ชจ๋ฆฌ ์ ์ฝ
- ํน์ง
- depth first search์ breadth first search์ ์ฅ์ ์ ๋ชจ๋ ํฌํจ
- hybrid approach๋ก ์ด์ฉ ๊ฐ๋ฅ
- state space๊ฐ ๋ฉ๋ชจ๋ฆฌ ํฌ๊ธฐ๋ณด๋ค ํฌ๊ณ depth๊ฐ ์๋ ค์ง์ง ์์์ ๋ ์ด์ฉ
- Iterative lengthening search: cost๊ฐ ๋ชจ๋ ๋์ผํ ๊ฒ์ด ์๋๋ผ๋ฉด cost๊ฐ ์ปค์ง๋ ๋ฐฉ์์ผ๋ก deepening
Bidirectional Search
- ์ ์: 2๊ฐ์ frontier๋ก ํ์ฅ → 1๊ฐ๋ initial state, 1๊ฐ๋ goal state → ์ค๊ฐ์์ ๋ง๋๊ธฐ๋ฅผ ๊ธฐ์
- ์๋์ฝ๋ ํน์ง
- solution ์ ํ ์ ์ด๋ค ๋ฐฉํฅ์ด ๊ฐ์ฅ ๋น์ฉ์ด ์ ์์ง ํ๋จํ์ฌ ๊ทธ๊ฒ์ ์ ํํจ
- proceed ํจ์: ์๋๋ฐฉ์ reached state ์ ๋ณด๋ฅผ ๋ฐ์์ ์คํ
- ์ฑ๋ฅ ํ๊ฐ
- Complete
- Not cost-optimal
- time complexity: O(b^{d/2})
- space complexity: O(b^{d/2})