Bratko, Chapter 12: Best First: A Heuristic Search Principle 12.1 Best-First Search - search from s to t - expand the node with lowest f(n) = g(n) + h(n) - g(n) estimates cost of optimal path from s to n - h(n) estimates cost of optimal path form n to t - A* search if f(n) <= f*(n) for all n - representation of nodes in a search tree - l(N,F/G) is a leaf node N - g(N) = G and f(n) = F = G + h(N) - t(N,F/G,Subs) is a subtree with root node N - list of subtrees Subs ordered by increasing f values - G is g(N) - F is the most promising f value of the successors in Subs - best-first search program [Fig12.3] 12.2 Best-First Search applied to the Eight Puzzle - need to define - s(Node,Node1,Cost) - goal(Node) - goal([2/2,1/3,2/3,3/3,3/2,3/1,2/1,1/1,1/2]) - h(Node,H) = totdist + 3 * seq - totdist = Manhattan distance of all eight tiles - seq = 1 for a tile in the center + 0 for non-center tiles followed by their proper successor + 2 for non-center tiles not followed by their successor 12.3 Best-First Search applied to Scheduling - given - tasks ti with execution time Di - m processors - precedence relations between tasks - what tasks must be completed before starting this task - find a schedule for each processor minimizing total run time - heuristic - finall = ((sum Di) + (sum Fj))/m - Di = execution times of waiting tasks - Fj = finishing times of processors - assumes distributed processing - Fin = max(Fj) - if Finall > Fin then H = Finall - Fin else H = 0