Aug 30, 2006 ------------- - Informed search algorithms - e.g., "psychic search" - Psychic search - provides an evaluation function that somehow knows the true cost to goal - called a heuristic, or h(n) Using it in a search - Create the evaluation function f(n) as f(n) = g(n) + h*(n) - g(n): cost expended thus far (history/experience) - h(n): cost expeceted from now on (future/promise) - Example of psychic search on a graph - One simple psychic - make h(n) = 0 - reduces to BFS/UCS, which is complete and optimal - What do we do when we don't have a psychic - as long as your h(n) does not overestimate h*(n), you are fine! (you get completeness and optimality) - AMAZING, ISN'T IT? - called admissible heuristic - One simple way to ensure that h(n) <= h*(n) - make h(n) = 0 - reduces to BFS/UCS, which is complete and optimal - A good heuristic is one - that is as close to h*(n) as possible (from below) - but doesn't take too long to compute - after all, the psychic could just be a fast supercomputer that actually does BFS, finds the answer, and comes back and gives you an estimate of the cost! - Special cases of evaluation functions - If g(n) = 0, you are only relying on the psychic - "greedy search"; does not guarantee optimality - If h(n) = 0, you are only relying on the past - reduces to BFS and UCS - Heuristics for the 8-puzzle problem - h1(n): number of misplaced tiles - h2(n): Manhattan distance - Both share the essential characteristics of a heuristic - i.e., never overestimate path cost to a goal - How do we get heuristics such as this? - an automatic way by "relaxing" problem specs - Motto: Heuristic cost for original problem = Optimal solution cost for a relaxed problem - Example of relaxation - People can fly (to compute time taken to travel from point A to point B) - tiles can magically go into their correct position - Automatic discovery of heuristics: 8-puzzle problem - formulate it as: MOVE(x,y,z) <- ON(x,y), FREE(z), NEXTTO(y,z) - Tile "x" can be moved from y to z if x is originally on y, z is free, and z is adjacent to y - Relax it in different ways: - MOVE(x,y,z) <- ON(x,y) - can move a tile to anywhere - leads to h1(n) = #misplaced tiles - Another - MOVE(x,y,z) <- ON(x,y), NEXTTO(y,z) - can move a tile to an adjacent position - leads to h2(n) = Manhattan distance - Yet Another - MOVE(x,y,z) <- ON(x,y), FREE(z) - can swap a tile for the empty position - leads to h3(n) = #swaps - Best first search - put your best foot forward - A* search - Best first search with admissible heuristic - Making A* more efficient - mainly w.r.t. space complexity - Just as BFS:DFID, we get A*:IDA* - increase trees, not by depth but by f() - Read up yourself: memory bounded search - RBFS - SMA* - Homework #1 assigned - details of some questions