Algorithms for Exploration Searches Algorithms for Exploration
Graphs How do we find the shortest path from NY to LA?
Graphs Graph representation: Nodes or Vertices : places you can be Edges : routes between them
Graphs Graphs can represent any problem with connected states: How do I turn cat into dog?
Graphs Examples:
Breadth First Search Explore all paths of length 1, then all paths of length 2, then all paths of length 3
BFS – Optimal Paths Optimal Paths
Edge Weights Edge Weights : Cost of taking a particular edge
Edge Weights Edge Weights : Cost of taking a particular edge Optimal path may not have fewest edges:
Best First Search Best First Search Maintain list of "places I know I can reach" Always explore shortest remaining path Stop when path to goal is shortest remaining path
Best First Search Best First Search Optimal path
Best First Search Best First Search Optimal path Impossibly large number of paths to worry about Given 20 branches per node:
Heuristic Heuristic : rule of thumb – guesstimation Heuristic Search : Use a heuristic to guide your search – pick particular paths to explore first Heurisitc adds "expected future cost" to each possible path
Sliding Puzzle http://mypuzzle.org/sliding
Sliding Puzzle State – where the tiles are Edge – switch blank with neighbor
Sliding Puzzle Goal: Fewest moves Each move costs 1
Sliding Puzzle Goal: Fewest moves Each move costs 1 Heuristic : each out of place piece is 1 more cost Total estimated cost = moves so far + pieces out of place http://computerscience.chemeketa.edu/cs160Reader/NineAlgorithms/SearchAI/HeuristicSearch.html
TicTacToe & Chess & Go
Game Difficulty https://www.youtube.com/watch?v=SUbqykXVx0A https://www.youtube.com/watch?v=5oXyibEgJr0