INFORMED SEARCH ALGORITHMS CHAPTER 4,SECTIONS 1-2 Chapter 4.Sections 1-2 1
Informed search algorithms Chapter 4, Sections 1–2 Chapter 4, Sections 1–2 1
Outline ◇Best--first search ◇A*search ◇Heuristics Chapter 4.Sections 1-2 2
Outline ♦ Best-first search ♦ A∗ search ♦ Heuristics Chapter 4, Sections 1–2 2
Review:Tree search function TREE-SEARCH(problem,fringe)returns a solution,or failure fringeINSERT(MAKE-NODE(INITIAL-STATE[problem]),fringe) loop do if fringe is empty then return failure node-REMOVE-FRONT(fringe) if GOAL-TEST[problem]applied to STATE(node)succeeds return node fringeINSERTALL(EXPAND(node,problem),fringe) A strategy is defined by picking the order of node expansion Chapter 4.Sections 1-2 3
Review: Tree search function Tree-Search( problem, fringe) returns a solution, or failure fringe ← Insert(Make-Node(Initial-State[problem]),fringe) loop do if fringe is empty then return failure node ←Remove-Front(fringe) if Goal-Test[problem] applied to State(node) succeeds return node fringe ← InsertAll(Expand(node, problem),fringe) A strategy is defined by picking the order of node expansion Chapter 4, Sections 1–2 3
Best-first search Idea:use an evaluation function for each node estimate of "desirability" Expand most desirable unexpanded node Implementation: fringe is a queue sorted in decreasing order of desirability Special cases: greedy search A*search Chapter 4.Sections 1-2 4
Best-first search Idea: use an evaluation function for each node – estimate of “desirability” ⇒ Expand most desirable unexpanded node Implementation: fringe is a queue sorted in decreasing order of desirability Special cases: greedy search A∗ search Chapter 4, Sections 1–2 4
Romania with step costs in km 71 ▣Oradea Straight-line distance to Bucharest Neamt Arad 366 白Zerind ▣ 87 Bucharest 0 75 151 Craiova ▣lasi Dobreta 29 Arad 140 Eforie 161 92 Sibiu % Fagaras 178 Fagaras Giurgiu 118 ▣ 80 ▣ 白Vaslui Hirsova Iasi 226 Timisoara Rimnicu Vilcea Lugoj 244 142 Mehadia 241 11 211 口Lugo 97 Pitesti Neamt 234 Oradea 380 98 Pitesti 98 146 ▣Mehadia 10不 85 ▣Hirsova Urziceni Rimnicu Vilcea 193 75 138 86 Sibiu 253 Bucharest 120 Timisoara 32 Dobreta自 Urziceni 0 Craiova % Eforie Vaslui 199 口Giurgiu Zerind 374 Chapter 4.Sections 1-2 5
Romania with step costs in km Bucharest Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Sibiu Fagaras Pitesti Rimnicu Vilcea Vaslui Iasi Straight−line distance to Bucharest 0 160 242 161 77 151 241 366 193 178 253 329 80 199 244 380 226 234 374 98 Giurgiu Urziceni Hirsova Eforie Neamt Oradea Zerind Arad Timisoara Lugoj Mehadia Dobreta Craiova Sibiu Fagaras Pitesti Vaslui Iasi Rimnicu Vilcea Bucharest 71 75 118 111 70 75 120 151 140 99 80 97 101 211 138 146 85 90 98 142 92 87 86 Chapter 4, Sections 1–2 5
Greedy search Evaluation function h(n)(heuristic) estimate of cost from n to the closest goal E.g.,hsLD(n)=straight-line distance from n to Bucharest Greedy search expands the node that appears to be closest to goal Chapter 4.Sections 1-2 6
Greedy search Evaluation function h(n) (heuristic) = estimate of cost from n to the closest goal E.g., hSLD(n) = straight-line distance from n to Bucharest Greedy search expands the node that appears to be closest to goal Chapter 4, Sections 1–2 6
Greedy search example Arad 366 Chapter 4.Sections 1-2 7
Greedy search example Arad 366 Chapter 4, Sections 1–2 7
Greedy search example Arad Sibiu Timisoara Zerind 253 329 374 Chapter 4.Sections 1-2 8
Greedy search example Zerind Arad Sibiu Timisoara 253 329 374 Chapter 4, Sections 1–2 8
Greedy search example Arad Sibiu Timisoara Zerind 329 374 Arad Fagaras Oradea Rimnicu Vilcea 366 176 380 193 Chapter 4.Sections 1-2 9
Greedy search example Rimnicu Vilcea Zerind Arad Sibiu Arad Fagaras Oradea Timisoara 329 374 366 176 380 193 Chapter 4, Sections 1–2 9
Greedy search example Arad Sibiu Timisoara Zerind 329 374 Arad Fagaras Oradea Rimnicu Vilcea 366 380 193 Sibiu Bucharest 253 0 Chapter 4.Sections 1-2 10
Greedy search example Rimnicu Vilcea Zerind Arad Sibiu Arad Fagaras Oradea Timisoara Sibiu Bucharest 329 374 366 380 193 253 0 Chapter 4, Sections 1–2 10