Adrian Sotelo CS582 Spring 2009 Digipen Institute of Technology.

Slides:



Advertisements
Similar presentations
BEST FIRST SEARCH - BeFS
Advertisements

Lights Out Issues Questions? Comment from me.
Informed search algorithms
Review: Search problem formulation
Informed Search Algorithms
Problem solving with graph search
AI Pathfinding Representing the Search Space
A* Search. 2 Tree search algorithms Basic idea: Exploration of state space by generating successors of already-explored states (a.k.a.~expanding states).
D* Lite an incremental version of A* for navigating in unknown terrain Focussed Dynamic A* It implements the same behavior as Stentz’
an incremental version of A*
State Space 3 Chapter 4 Heuristic Search. Three Algorithms Backtrack Depth First Breadth First All work if we have well-defined: Goal state Start state.
Solving Problem by Searching
CS 206 Introduction to Computer Science II 03 / 27 / 2009 Instructor: Michael Eckmann.
ICS-171:Notes 4: 1 Notes 4: Optimal Search ICS 171 Summer 1999.
1 Ceng 585 Paper Presentation D*-Lite Path Finding Algorithm and its Variations Can Eroğul
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
CSE 380 – Computer Game Programming Pathfinding AI
1 Graphs: Traversal Searching/Traversing a graph = visiting the vertices of a graph by following the edges in a systematic way Example: Given a highway.
CS 206 Introduction to Computer Science II 11 / 07 / 2008 Instructor: Michael Eckmann.
Motion Planning CS 6160, Spring 2010 By Gene Peterson 5/4/2010.
Search Strategies.  Tries – for word searchers, spell checking, spelling corrections  Digital Search Trees – for searching for frequent keys (in text,
CS460 Spring 2011 Review of Search. Overview Uninformed search Informed search Local search Adversarial search.
CS 206 Introduction to Computer Science II 11 / 11 / Veterans Day Instructor: Michael Eckmann.
Review: Search problem formulation
Informed Search (no corresponding text chapter). Recall: Wanted " An algorithm and associated data structure(s) that can: 1) Solve an arbitrary 8-puzzle.
MAE 552 – Heuristic Optimization Lecture 27 April 3, 2002
Spanning Trees.
Spanning Trees. 2 Spanning trees Suppose you have a connected undirected graph Connected: every node is reachable from every other node Undirected: edges.
CS 206 Introduction to Computer Science II 11 / 10 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 11 / 05 / 2008 Instructor: Michael Eckmann.
CS 206 Introduction to Computer Science II 03 / 25 / 2009 Instructor: Michael Eckmann.
1 Ceng 585 Paper Presentation D*-Lite Path Finding Algorithm and its Variations Can Eroğul
CS 206 Introduction to Computer Science II 03 / 30 / 2009 Instructor: Michael Eckmann.
More Graph Algorithms Weiss ch Exercise: MST idea from yesterday Alternative minimum spanning tree algorithm idea Idea: Look at smallest edge not.
State-Space Searches. 2 State spaces A state space consists of –A (possibly infinite) set of states The start state represents the initial problem Each.
State-Space Searches.
Chapter 5.4 Artificial Intelligence: Pathfinding.
1 GRAPHS - ADVANCED APPLICATIONS Minimim Spanning Trees Shortest Path Transitive Closure.
Graphs II Robin Burke GAM 376. Admin Skip the Lua topic.
Data Structures Week 9 Towards Weighted BFS So, far we have measured d s (v) in terms of number of edges in the path from s to v. Equivalent to assuming.
Representing and Using Graphs
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l inference l all learning.
Graphs Data Structures and Algorithms A. G. Malamos Reference Algorithms, 2006, S. Dasgupta, C. H. Papadimitriou, and U. V. Vazirani Introduction to Algorithms,Third.
Introduction to search Chapter 3. Why study search? §Search is a basis for all AI l search proposed as the basis of intelligence l all learning algorithms,
P ROBLEM Write an algorithm that calculates the most efficient route between two points as quickly as possible.
State-Space Searches. 2 State spaces A state space consists of A (possibly infinite) set of states The start state represents the initial problem Each.
Efficiency of Alignment-based algorithms B.F. van Dongen Laziness! (Gu)estimation! Implementation effort?
Informed search strategies Idea: give the algorithm “hints” about the desirability of different states – Use an evaluation function to rank nodes and select.
Dijkstra’s Algorithm Supervisor: Dr.Franek Ritu Kamboj
CSE 589 Part VI. Reading Skiena, Sections 5.5 and 6.8 CLR, chapter 37.
Review: Tree search Initialize the frontier using the starting state While the frontier is not empty – Choose a frontier node to expand according to search.
Lecture 3: Uninformed Search
1 Branch and Bound Searching Strategies Updated: 12/27/2010.
Informed Search I (Beginning of AIMA Chapter 4.1)
Informed Search Reading: Chapter 4.5 HW #1 out today, due Sept 26th.
Ricochet Robots Mitch Powell Daniel Tilgner. Abstract Ricochet robots is a board game created in Germany in A player is given 30 seconds to find.
Chapter 13 Backtracking Introduction The 3-coloring problem
Graph Search II GAM 376 Robin Burke. Outline Homework #3 Graph search review DFS, BFS A* search Iterative beam search IA* search Search in turn-based.
Best-first search is a search algorithm which explores a graph by expanding the most promising node chosen according to a specified rule.
Lecture 3: Uninformed Search
Review: Tree search Initialize the frontier using the starting state
Shortest Paths.
Shortest Paths.
CSE373: Data Structures & Algorithms Lecture 18: Dijkstra’s Algorithm
Outline This topic covers Prim’s algorithm:
Chapter 15 Graphs © 2006 Pearson Education Inc., Upper Saddle River, NJ. All rights reserved.
Workshop: A* Search.
Shortest Paths.
Presentation transcript:

Adrian Sotelo CS582 Spring 2009 Digipen Institute of Technology

 DFS  BFS  Dykstra’s  A*  Dykstra’s and A* will find an optimal path  If structure of the search space changes, the path needs to be recomputed from scratch  In real time applications this can be a problem with having to traverse deformable terrain  Also can be problematic if the structure of the search space is not known

 Dynamic pathfinding algorithms will hold on to their search data.  If connections between nodes are lost or created, data is modified and only effected nodes are recalculated  No need to start from scratch

Let’s review quickly how A* works.

 Graph  Node  Open List  Closed List

 g(x) is the cost so far from the start node to the current node  h(x) is the heuristic being used to estimate distance to the goal  Children[] is a list of children nodes or nodes connected to the current node

 List of nodes that need to be examined  Priority Queue sorted by f(x)  f(x) = g(x) + h(x)

 List of nodes that have already been visited  List must also track the source parent of the nodes it contains  When the goal node is placed on the closed list the algorithm terminates

Openlist.Clear(); ClosedList.Clear(); currentNode = nil; startNode.g(x) = 0; Openlist.Push(startNode); While currentNode != goalNode currentNode = OpenList.Pop(); for each s in currentNode.Children[] s.g(x) = currentNode.g(x) + c(currentNode, s); OpenList.Push(s); end for each ClosedList.Push(currentNode); End while

 Dynamic Pathfinding searches run the same basic algorithm.  However, when the search space is altered and costs are changed they’ll handle these inconsistencies.  How does the algorithm detect these inconsistencies?

 The answer lies in the introduction of a new value into the mix  This value is known as the Right Hand Side (rhs) value.  This value is equal to the cost to the parent of a node plus the cost to travel to that node  By comparing this value to the cost to the node we can detect inconsistencies

 g(x) = A+B  rhs(x) = g(x’) + c(x’,x) = A+B  Under normal circumstances g(x)==rhs(x)  This is known as locally consistent

 Cost changed dynamically  g(x) = A+B  rhs(x) = g(x’)+c(x’,x) =A+∞ = ∞  g(x) != rhs(x)  This is called locally inconsistent

 The idea of inconsistency contains within it a lot of information both explicit and implicit that will be exploited in our search algorithms  Explicit data is used by the algorithm to update nodes. The implicit data will be used by the implementer to manage open lists.  Inconsistency falls into two categories: Underconsistency and Overconsisteny

 g(x) < rhs(x) is called underconsistency  When a node is found to be underconsistent that means that the path to the that node was made to be more expensive.  In a video game this would correspond to a wall or an obstruction was created  Nodes found to be underconsistent will need to be reset and paths completely recalculated

 g(x) > rhs(x) is called overconsistency  When a path is found to be overconsistent that means that the path to that node was made to be less expensive  In a video game this would mean that a shortcut was found or that an obstruction was cleared  In the following algorithms the idea of overconsistency is also used to manage the open list by exploiting the fact that an overconsistant node implies that the shortest path has been found to that node.

 This will be the first algorithm we explore as it is the foundation of D* Lite  The idea is that given a goal node you can find a path by backtracking to the start node by minimizing the rhs value.  Because of this we do not need to manage a Closed List (theoretically)

 Graph  Node  OpenList

 g(x) is the cost so far from the start to the node  h(x) is the heuristic estimating the cost from x to the goal  rhs(x) = min(g(x’)+c(x’,x)) where x’ are the parents of x  key(x) is a value used to sort the open list  Children[] is a list of node that can be advanced to from x  Parents[] is a list of nodes from which you can advance to x

 As mentioned before the key of a node is a value that is going to be used to sort the open list by  The key is a touple value = [min(g(x),rhs(x)+h(x)); min(g(x),rhs(s)]  These Keys are compared lexicographically So u < v if (u.first < v.first OR u.first == v.first AND u.second < v.second)  More on this later

 Priority Queue Sorted by Key Value  All nodes in the Open List are locally inconsistent  All locally inconsistent nodes are on the open list

For each s in Graph s.g(x) = rhs(x) = ∞; ( locally consistent) end for each startNode.rhs = 0; ( overconsistent) Forever While(OpenList.Top().key<goal.key OR goal is incosistent) currentNode=OpenList.Pop(); if(currentNode is overconsistent) currentNode.g(x) = currentNode.rhs(x); ( Consistent) else currentNode.g(x)= ∞; ( overconsistent OR consistent ) end if for each s in currentNode.Children[] update s.rhs(x); ( consistent OR inconsistent) end for each End while Wait for changes in Graph For each connection (u, v) with changed cost Update connection(u, v); Make v locally inconsistent; end for each End forever

 ComputeShortestPath() runs that same as A* when there are no changes to the Graph  Only when when changes occur do inconsistencies come into play  Notice that this algorithm is constantly checking for changes in the graph that means that the OpenList is never reset and anytime ComputeShortestPath() is called the openlist still contains all the previous locally inconsistent nodes as well as the new nodes recently made inconsistent by the changes in the Graph

 Is only recalculating from a single start, goal pair.  What if we have already advanced when the Graph changes?  Good for calculating paths at some monitored location, but not good for handling changes while traveling

 Built on top of LPA*  Takes into consideration path already traveled  How does it do this?

 Heap reordering  D* Lite will find the shortest path from the goal node to the start node by minimizing rhs values  Key values are updated when a connection changes not only with the new connection data, but with the new amount the agent has traveled

 As an agent advances along the path the start node becomes the current node the agent is on  So when connections change and keys need to be calculated we need to update the heuristic from being estimated cost from goal to original start to estimated cost from goal node to new start

 Because we’re moving toward the goal the heuristic will be decreasing  This decrease can be no more than h(startOrg, startNew). This is due to the propery of the heuristic being derived from a relaxed version of the problem.  So subtract that value from all keys?

 Because the we’re subtracting the same value from all keys the order in the Priority Queue does not change.  So Instead why don’t we add that value to all new calculated keys  This way we avoid traversing the Queue everytime connections change and heuristics remain admissible