1 / 54

Chapter 5. 최적 탐색 (Optimal Search)

Chapter 5. 최적 탐색 (Optimal Search). Find the shortest route(path length). British Museum Search. Branch-and-bound Search. Branch&bound with underestimate. A* Search. B&B with Dynamic Programming. 최단경로 구하기 (Finding Shortest Path).

Download Presentation

Chapter 5. 최적 탐색 (Optimal Search)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 5. 최적 탐색(Optimal Search) Find the shortest route(path length) British Museum Search Branch-and-bound Search Branch&bound with underestimate A* Search B&B with Dynamic Programming

  2. 최단경로 구하기(Finding Shortest Path) • 최단경로 구하기 (Shortest Path) : 어떤 그래프 G의 정점 A에서 다른 어떤 정점 B로의 최단경로는 A에서 B로가는 경로를 가운데 가장 작은 가중치 합을 가지는 경로를 말한다.

  3. British Museum Search • Idea: 모든 경로를 검사한 후 가장 좋은 것을 선택 • ==> use either depth-first or breadth-first • (but, continue to find all possible paths). • ==> stupid method if depth increase • (탐색공간이 지수적으로 폭발하기 때문). • * 일반적으로 최악의 방법이라고 생각되지만, 탐색 영역이 작은(축소될 수 있는) 문제에는 유용할 수도 있다.

  4. British Museum Search _: dead-end *: goal-reached S 4 3 A D 2 5 5 4 B D A E 5 4 4 2 4 5 C E E B B F _ 4 5 4 2 4 5 4 4 3 D F B C E A C G F *13 _ _ _ _ 3 4 3 4 F G C G _ 3 * G *25 19

  5. Branch-and-bound Search (분기한정 탐색) 분기한정법은 여러가지의 최적화 문제, 특히 이산 (discrete) 과 조합최적화 (combinatorial optimization) 에서 최적 해를 찾기위한 일반적인 방법이다. 암묵적인 열거 방법 (implicit enumeration method) 부류에 속한다. 분기한정법은 1960 년에 linear programming 을 위해 A. H. Land 와 A. G. Doig 가 An Automatic Method for Solving Discrete Programming Problems 에 처음 소개하였다. * B & B Search expands the least-cost partial path.

  6. B 5 1 S A G 2 2 S S 2 5 2 5 A B A B 4 4 G G G 6 Branch-and-bound Search British Museum Search

  7. Branch-and-bound Search Idea: take a path which is so far so good. S A D A E … … B 13 F … don’t need to expand anymore. G 13

  8. Branch-and-bound Search Procedure: * Form a one-element queue consisting of a zero-length path that contains only the root node. * Until the first path in the queue terminates at the goal node or the queue is empty, - remove the first path from the queue; create new paths by extending the first path to all neighbors of the terminal node. - reject all new paths with loops. - add the new paths, if any, to the queue. -sort the entire queue by path length with least-cost paths in front. * If the goal node is found, announce success; otherwise fail.

  9. B & B Search Tree _: dead-end *: goal-reached S A D 3 4

  10. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D 7 8

  11. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 7 8 6 9

  12. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 9 7 8 11 B 10 F

  13. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 9 8 11 C E B 10 F 11 12

  14. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 8 9 11 C E E B 10 F 10 11 12

  15. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 8 9 11 C E E B B 10 F 10 11 13 12

  16. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 8 9 11 C E E B B 10 F 12 11 13 B F 14 15

  17. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 8 9 11 C E E B B 10 F 12 11 13 B G F 14 *13 15

  18. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 8 9 11 C E E B B 10 F 12 11 13 B A C G F 14 *13 15 15 15

  19. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 8 9 11 C E E B B 10 F 12 11 13 B A C G F 14 *13 15 15 15

  20. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 8 9 11 C E E B B 10 F _ 11 13 D F B A C G F *13 14 16 15 15 14 15

  21. B & B Search Tree _: dead-end *: goal-reached S A D 4 B D A E 8 9 11 C E E B B 10 F _ 11 D F B C E A C G F *13 14 16 15 15 14 15 17 18

  22. British Museum Search _: dead-end *: goal-reached S 4 3 A D 2 5 5 4 B D A E 5 4 4 2 4 5 C E E B B F _ 4 5 4 2 4 5 4 4 3 D F B C E A C G F *13 _ _ _ _ 3 4 3 4 F G C G _ 3 * G *25 19

  23. Branch&bound with underestimate Idea: add remaining distance to traveled distance. t = d + e, where, t is total cost, d is traveled cost, and e is remaining cost. Heuristic S 11.0 A D 12.9 = 4 + 8.9 13.4 = 3 + 10.4 A E 12.9 19.4 B F 13 17.7 G 13

  24. Branch&bound with underestimate Procedure: * Form a one-element queue consisting of a zero-length path that contains only the root node. * Until the first path in the queue terminates at the goal node or the queue is empty, - remove the first path from the queue; create new paths by extending the first path to all neighbors of the terminal node. - reject all new paths with loops. - add the new paths, if any, to the queue. - sort the entire queue by the sum of the path length and a lower bound estimate of the cost remaining, with least-cost paths in front. * If the goal node is found, announce success; otherwise fail.

  25. B&B with Dynamic Programming Idea: sub-optimal guarantees total-optimal. S A D 4 To be expanded B D 7 8 Never expanded

  26. B&B with Dynamic Programming Procedure: * Form a one-element queue consisting of a zero-length path that contains only the root node. * Until the first path in the queue terminates at the goal node or the queue is empty, - remove the first path from the queue; create new paths by extending the first path to all neighbors of the terminal node. - reject all new paths with loops. - add the new paths, if any, to the queue. - if two or more paths reach a common node, delete all those paths except the one that reaches the common node with the minimum cost. - sort the entire queue by path length with least-cost paths in front. * If the goal node is found, announce success; otherwise fail.

  27. A* Search ==> B&B with underestimate and dynamic programming Idea: apply underestimate and dynamic programming. * Draw seoul map and try it !!!

  28. A* Search S 11.0 A D 12.9 = 4 + 8.9 13.4 = 3 + 10.4 A E 12.9 19.4 B F 13 17.7 G

  29. Optimal Search Alternatives * British Museum: when search tree is small. * B&B: when tree is big and bad paths turn bad quickly. * B&B with underestimate: when good underestimate are available. * B&B with dynamic programming: when many paths converge on same node. * A*: when above two are good.

  30. Searching Example: Robot Path Planning Idea: describe the situation in simpler search tree representation and use A* search. Situation: initial position octagon pentagon goal position

  31. Searching Example: Robot Path Planning Configuration space: initial position octagon pentagon goal position node ==> vertex link ==> straight line without any obstacle.

  32. Robot Path Planning World Map:

  33. Quiz. Optimal Search Fig. E4.1 4 4 A B C 1.4 3 5 5 5 G S goal start 4 2 4 D E F

  34. ==> Use heuristic measure of remaining distance. A B C 6.7 1.4 10.4 G S 11.0 8.9 6.9 3.0 D E F

  35. Exercise 1. • Show how Branch and Bound search would search the net shown in figure E4.1. (탐색트리를 그리시오. 찾아간 경로를 점선으로 표시하고 경로 검색 횟수는? 최종 경로를 굵은 선으로 표시할 것)

  36. Exercise 2. • Show how Branch and Bound with underestimate Search would search the net shown in figure E4.1. (탐색트리를 그리시오. 찾아간 경로를 점선으로 표시하고 경로 검색 횟수는? 최종 경로를 굵은 선으로 표시할 것)

  37. Exercise 3. • Show how Branch and Bound with dynamic programming search would search the net shown in figure E4.1. Use straight-line distance to sort candidates. (탐색트리를 그리시오. 찾아간 경로를 점선으로 표시하고 경로 검색 횟수는? 최종 경로를 굵은 선으로 표시할 것)

  38. Exercise 4. • Show how A* search would search the net shown in figure E4.1. Use straight-line distance to sort candidates. (탐색트리를 그리시오. 찾아간 경로를 점선으로 표시하고 경로 검색 횟수는? 최종 경로를 굵은 선으로 표시할 것)

  39. 8-puzzle problem 시작 상태 목표 상태

  40. Start node Goal node 3 1 2 3 2 1 8 8 4 4 6 5 7 6 5 7 • # of Misplaced tiles 3 8 3 2 2 3 2 1 1 4 8 4 8 1 4 7 7 6 5 5 7 6 5 6 a c b 8-Puzzle Heuristics • Which is the best move among a, b, c ?

  41. A* 알고리즘을 이용한 8-퍼즐 ※ 순서: ←↓↑→ F=g+h : 값 작은 쪽으로 탐색 (1+5=6) (1+5=6) (1+3=4) (2+3=5) (2+4=6) (2+3=5) (3+3=6) (3+4=7) (3+2=5) (3+4=7) (4+1=5) Goal (5+0=5) (5+2=7)

  42. A* 알고리즘을 이용한 8-퍼즐 • 다른 h 함수를 정의하여 보자. ※ 순서: ←↓↑→

  43. Road Map Problem • To go Bucharest, which city do you choose to visit next from Arad? Zerind, Siblu, Timisoara? • Your rationale ?(이론적 근거는?)

  44. A* Search Start node • f(n) = g(n) + h(n), when h(n) <= h*(n) for all n • Find minimum f(n) toexpand next • Role of h(n) • Direct to goal • Role of g(n) • Guard from roaming due to not perfect heuristics g(n) Current Node n h(n) Goal KAIST CS570 lecture note

  45. A* Search Example Romania with cost in km KAIST CS570 lecture note

More Related