Informed search algorithms Outline n Bestfirst search n
Informed search algorithms (接收資訊的搜尋演算法)
Outline n Best-first search (最佳優先搜尋法) n n Greedy best-first search (貪婪最佳優先搜尋) A* search
Review(複習): Tree search n n A search strategy is defined by picking the order of node expansion (搜尋策略為挑選節點展開的順序)
Review: Uninformed search strategies(無接收資訊的搜尋策略) n Uninformed search strategies use only the information available in the problem definition (無接收資訊的的搜尋策略僅使用問題本身定義 的可用資訊) Breadth-first search n Uniform-cost search n Depth-first search n n
Best-first search(最佳優先搜尋) n n Idea: use an evaluation function f(n) for each node 想法:對每個節點使用一個評估函數 n n n estimate of "desirability" 有利條件的評估 Expand most desirable unexpanded node 展開最有利之未展開節點 Implementation: 實作 Order the nodes in fringe in decreasing order of desirability 依據有利條件的評估值由大而小排列待展開的節點順序 n Special cases n n (特別的例子) greedy best-first search A* search
Greedy best-first search n n Evaluation function評估函數 f(n) = h(n) (heuristic啟 發式) = estimate of cost from n to goal n n n 從n狀態到目標狀態的花費 e. g. , h. SLD(n) = straight-line distance from n to Bucharest(到Bucharest的直線距離) Greedy best-first search expands the node that appears to be closest to goal n (貪婪最佳優先搜尋法展開似乎最接近目標的節點)
Greedy best-first search example
Greedy best-first search example
Greedy best-first search example
Greedy best-first search example
Properties of greedy best-first search(貪婪最佳優先搜尋法的特質) n n n n Complete? No – can get stuck in loops(可能遭遇迴圈), e. g. , Iasi Neamt Time? O(bm), but a good heuristic can give dramatic improvement (m is the maximum depth of the search space)但一個好的 啟發式可以產生極大的改善 Space? O(bm) -- keeps all nodes in memory Optimal? No, why? How to modify the greedy best-first search? (如何改進貪婪最佳優先搜尋法)
A* search n n n n Idea: avoid expanding paths that are already expensive (想法: 避免展開已知較大花費的路徑) Evaluation function(評估函數) f(n) = g(n) + h(n) g(n) = cost so far to reach n (到n點的已知花費) h(n) = estimated cost from n to goal(評估從n點到目 標還需要的花費, 啟發式) f(n) = estimated total cost of path through n to goal (評估經由n 到目標所需的總花費)
A* search example
A* search example
A* search example
A* search example
A* search example
A* search example
Admissible heuristics (可採納的啟發式) n n n A heuristic h(n) is admissible if for every node n, h(n) ≤ h*(n), where h*(n) is the true cost to reach the goal state from n. (簡言之: 低估) An admissible heuristic never overestimates the cost to reach the goal, i. e. , it is optimistic Example: h. SLD(n) (never overestimates the actual road distance) 直線距離不會超過實際的距離
Optimality of A* n n n A* expands nodes in order of increasing f value Gradually adds "f-contours" of nodes Contour i has all nodes with f=fi, where fi < fi+1
Properties of A* n Complete? Yes n Time? Exponential (指數成長) Space? Keeps all nodes in memory n Optimal? Yes n n
Memory-bounded heuristic search n n IDA* (Iterative-deepening A*) RBFS (Recursive best-first search) MA* (Memory-bounded A*) SMA* (Simplified MA*)
IDA* n The main difference (與ID method比較 主要差別) n Cutoff using f-cost rather than the depth 使用花費取代深度來加深展開層數
RBFS (Recursive best-first search) n n n Its structure is similar to that of a recursive depthfirst search, it keeps track of the f-value of the best alternative path available from any ancestor of the current node. (其結構與RDFS相似, 但他記錄其他路徑 的最佳f-value) If the current node exceeds this limit, the recursion unwinds back to the alternative path. (如果目前的展 開節點花費已超過紀錄的限制, 則轉換到另一個路徑展 開) 用途: 節省記憶體的使用
Example of RBFS ∞ Arad 366 447 Sibiu Timisoara 393 447 Zerind 415 Arad 646 Fagaras Oradea 415 Rimmicu 526 Craiova 526 Pitesti 417 413 Sibiu 553 449
Example of RBFS (cont. ) ∞ Arad 366 447 Sibiu Timisoara 393 447 417 Arad Fagaras 646 Oradea 415 Sibiu 591 Rimmicu 526 Bucharest 450 417 Zerind 449
Example of RBFS (cont. ) ∞ Arad 366 447 Sibiu Timisoara 393 Zerind 447 449 447 Arad 646 Fagaras Oradea 450 Rimmicu 526 417 447 Craiova Pitesti 526 Sibiu 417 Bucharest 418 Craiova 615 553 Rimmicu 607
SMA* n n Proceeds just like A* (處理過程像A*) Expanding the best leaf until memory is full ( 持續展開最佳的節點直到記憶體已經用完) Drops the worst leaf node (with highest fvalue) 丟掉最糟的節點資料 Backs up the value of the forgotten node to its parent (將丟掉節點的花費值記在他們的父 節點內)
- Slides: 31