ummary rtificial Intelligence and its applications ecture earch earch onstraint atisfaction Problems rom start state to goal state onsider constraints Professor aniel Yeung danyeung@ieee.org r. Patrick han patrickchan@ieee.org outh hina University of Technology, hina ifficulty ame Playing Markov ecision Processes onsider an adversary onsider an uncertainty einforcement earning No information is given rtificial Intelligence and its applications - ecture : ame Playing genda earch earch ormulation Tree earch Uniform cost search * earch earch is a common technique in problem solving Maze Magic ube 8 puzzle oute-finding rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch
earch n agent finds the action sequence which leads to a goal state nvironment: a set of states gent: User, player, etc who can take actions to change states earch Procedure ormulation How to convert a real problem into a problem can be solved by our algorithm earch earching algorithm xecution ealize it rtificial Intelligence and its applications - ecture : earch 6 rtificial Intelligence and its applications - ecture : earch ormulation implification kashi Too simple: ridge not enough information waji Too complicate: increase complexity and difficulty ppropriate level of abstraction? kashi waji uma uma Harbor and Harbor and Meriken Park Port Kobe irport Meriken Park Port Kobe irport ormulation ssumptions Observable: can be converted into states tatic: no change in execution iscrete: states, actions eterministic: can be predicted kashi waji uma Harbor and Meriken Park Port Kobe irport 7 rtificial Intelligence and its applications - ecture : earch 8 rtificial Intelligence and its applications - ecture : earch
tate s Information of earch tart (Initial) tate nd (oal) tate = {kashi, uma, Harbor and } ction(kashi) = ction(s) : Possible action (a) in s {go to uma, go to waji } ost(s, a) : ction cost ost(uma, go to kashi) = ost(uma, go to Harborand) = ucc(s, a) = s : successor ucc(kashi, go to ) = uma ormulation xample vacuum robot cleans up two rooms automatically How to formulate this problem? kashi waji uma Harbor and Meriken Park Port Kobe irport Two rooms vacuum robot dirt 9 rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch ormulation xample ormulation xample actor of a room: or each room, possible states With / without irt With / without obot or two rooms ctions: ight eft uck ction cost: ach action costs one Initial tate: ny state oal tate: ll rooms are clean Therefore, 8 states rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch
ormulation earch raph ormulation earch raph Nodes are states ach state occurs only once rcs represent successors i.e. action results The goal test is a set of goal nodes rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch ormulation earch Tree arelybuild the full graph in memory raph is usually too big Not necessary to build the whole graph to obtain the solution rtificial Intelligence and its applications - ecture : earch ormulation earch Tree earch Tree will build until the solution is found 6 oot : start state hildren : correspond to successors ometimes the size of a tree is infinite epeat is unavoidable (e.g. move left and right) i.e. yclic graph a graph with a cycle H P J V M rtificial Intelligence and its applications - ecture : earch N Q
ormulation earch Tree ormulation earch Tree yclic graph cyclic graph Infinite Tree inite Tree 7 rtificial Intelligence and its applications - ecture : earch 8 rtificial Intelligence and its applications - ecture : earch earch valuation earch lgorithm ompleteness Is the algorithm guaranteed to find a solution when there is one? Optimality oes the strategy find the optimal solution? Time complexity How long does it take to find a solution? pace complexity How much memory is needed to perform the search? ost-insensitive earch ame cost for all actions Method: Tree earch ost-sensitive earch ctions with different costs Method: Uniform ost earch 7 9 rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch
Tree earch: epth-irst earch xpand deepest nodes first Not optimal (Only leftmost solution) May be infinite Need to control the depth Time complexity: O(b ) pace complexity: O() where b is branch factor is max. depth of the tree rtificial Intelligence and its applications - ecture : earch annot find the optimal one Tree earch: epth V readth-irst earch Tree earch: readth-irst earch xpand shallowest nodes first Optimal for uniform cost Time complexity: O(b s ) pace complexity: O(b s ) where b is branch factor s is the depth of the shallow solution rtificial Intelligence and its applications - ecture : earch Tree earch: Iterative eepening earch When or is better? pace : : Time : : the tree contains the shallow solution a path aster for hallow olution aster for eep olution (?) Need to determine the depth limit to avoid the infinite depth Take the advantages from and : ess time complexity for shallow solution : ess space complexity lgorithm et i =, run with depth limit (i x n) If no solution, do it again with i = i + n n n... rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch
Tree earch: Iterative eepening earch dvantage: educe the space complexity (only one path) No need to consider the infinite tree isadvantage: edundancy: hallow part of tree is considered several times n n n... Tree earch: idirectional earch Two trees from opposite directions uild two trees rooted at Initial and oal state top when the two trees meet each other Time complexity: b s/ + b s/ < b d pace complexity: O(b s ) where b is branch factor s is the depth of the shallow solution rtificial Intelligence and its applications - ecture : earch 6 rtificial Intelligence and its applications - ecture : earch Tree earch: idirectional earch Uniform ost earch ost-sensitive search onsider the cost of actions ind the shortest path from the start state to a state in each iteration until the end state is considered ll weight values are non-negative imilar to ijkstra s algorithm ble to handle a weighted cyclic graph 7 rtificial Intelligence and its applications - ecture : earch 8 rtificial Intelligence and its applications - ecture : earch
Uniform ost earch Uniform ost earch xpand explored region to cover the end state xplored: already found the optimal path rontier: still figuring out the optimal path Unexplored: states have not been seen xplore states according to the order of value of Pastost() Pastost(): the minimum cost from the start state to s utureost(): the minimum cost from to an end state tart xplored nd Pastost() utureost() rontier Unexplored 9 rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch Uniform ost earch Uniform ost earch dd start state to frontier (priority queue) epeat until frontier is empty: emove s with smallest priority p from frontier If s = end state: return solution ddsto explored or each action ain ctions(s): et successor s <- ucc(s, a) If s already in explored: continue dd s to frontier with priority p + ost(s, a) 87 9 xplored rontier Unexplored rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch
Uniform ost earch * earch 8 7 7 9 7 9 Uniform cost search explores many states which are far away from the end state * improves uniform cost search by biasing the states which are closer to the end state Wasted effort at this side? tart xplored rontier Unexplored nd rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch * earch * earch xample Pastost() utureost() lgorithm: * search (proposed by Hart/ Nilsson/ aphael, 968) Total cost of to = Pastost() + utureost() Uniform ost earch xplore states in order of Pastost() * earch xplore states in order of Pastost() + h() h() is a heuristic function which estimates utureost() ost (, ) = ost(, ) + h() where h() = d() - d() d(s) = rtificial Intelligence and its applications - ecture : earch 6 rtificial Intelligence and its applications - ecture : earch
Not consider here * earch d(s) = Uniform ost earch : ost (, ) = ost(, ) * earch d(s) = * : ost (, ) = ost(, ) + (d() -d()) ost h Total: ost - h - - d()-d() d()-d() d()-d() Total 7 rtificial Intelligence and its applications - ecture : earch 8 rtificial Intelligence and its applications - ecture : earch * earch * earch: Heuristic unction Uniform ost earch * h(s) determination is important If h(s) is incorrect, then * performs much worse than U If h(s) =, then * is same as U If h(s) = utureost(s), then * only explores nodes on a minimum cost path (optimal) esign of heuristics is domain dependence 9 rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch
* earch: Heuristic unction xample * earch: Heuristic unction xample Maze ame Maze ame How to find out a suitable heuristic function? onsidering obstacles causes Heuristic function very complicated et rid of constraints to make the problem easier rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : earch * earch: Heuristic unction xample ummary Maze ame earch rom start state to goal state onstraint atisfaction Problems onsider constraints h(s) = Manhattanistance(s, ndtate) where Manhattanistance((r, c ), (r, c )) = r - r + c - c e.g. h((, )) = 6 ifficulty ame Playing Markov ecision Processes onsider an adversary onsider an uncertainty einforcement earning No information is given rtificial Intelligence and its applications - ecture : earch rtificial Intelligence and its applications - ecture : ame Playing