1、Principles of Artificial Intelligence 1Uninformed Search StrategiesArtificial Intelligence : Searching : Search 2 Search Strategy 搜索策略Expand lowest-cost unexpanded node.扩展最低代价的 未扩展 节点。 Implementation 实现方法Queue ordered by path cost, lowest first.队列 ,按 路径 代价 排序 , 最低优先 。Uniform-cost Search 一致代价搜索3.4.2.
2、 Uniform-cost SearchArtificial Intelligence : Searching : Search 3Uniform-cost Search Algorithm 一致代价搜索 算法3.4.2. Uniform-cost Searchfunction UNIFORM-FIRST-SEARCH(problem) returns a solution, or failurenode a node with STATE = problem.INITIAL-STATE, PATH-TEST = 0frontier a priority queue ordered by PA
3、TH-COST, with node as the only elementexplored an empty setloop doif EMPTY ? (frontier) then return failurenode POP(frontier) /* chooses the lowest-cost node in frontier */if problem.GOAL-TEST(node.STATE) then return SOLUTION(node)add node.STATE to exploredfor each action in problem.ACTIONS(node.STA
4、TE) dochild CHILD-NODE(problem, node, action)if child.STATE is not in explored or frontier thenfrontier INSERT(child, frontier)else if child.STATE is in frontier with higher PATH-COST thenreplace that frontier node with childArtificial Intelligence : Searching : Search 4 From Sibiu to Bucharest, lea
5、st-cost node, Rimnicu Vilcea, is expanded, next, adding Pitesti with cost 80 + 97 = 177.从 Sibiu到 Bucharest,扩展最低代价节点 Rimnicu Vilcea,然后加上 Pitesti的代价 The least-cost node is now Fagaras, and adding goal node Bucharest with cost 99 + 211 = 310.现在最低代价节点为 Fagaras,加上目标节点 Bucharest的代价Example: From Sibiu to B
6、ucharest 举例: 从 Sibiu到 Bucharest3.4.2. Uniform-cost Search Choosing Pitesti and adding a second path to Bucharest with cost 177 + 101 = 278.选择 Pitesti并 加上第二条路径到 Bucharest的代价 This new path is better, so lowest path cost is 278.这条新路径较好,故最低路径代价为 278.Artificial Intelligence : Searching : Search 5 Time complexity时间复杂性 Space complexity空间复杂性where b - the branching factor分支 因子 C* - the cost of the optimal solution最优解 的代价 - every action costs at least至少 每个动作的代价Properties of Uniform-cost Search 一致 代价搜索的特性3.4.2. Uniform-cost SearchO(b1 + C*/) O(b1 + C*/)