SlideShare a Scribd company logo
1 of 39
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
Dstar Lite
Dstar Lite

More Related Content

What's hot

Лекция 4. Префиксные деревья (Tries, prefix trees)
Лекция 4. Префиксные деревья (Tries, prefix trees)Лекция 4. Префиксные деревья (Tries, prefix trees)
Лекция 4. Префиксные деревья (Tries, prefix trees)Mikhail Kurnosov
 
Tutorial de Uso do R Selenium
Tutorial de Uso do R Selenium Tutorial de Uso do R Selenium
Tutorial de Uso do R Selenium Daniel Marcelino
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prologbaran19901990
 
Gstreamer plugin devpt_1
Gstreamer plugin devpt_1Gstreamer plugin devpt_1
Gstreamer plugin devpt_1shiv_nj
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programmingOye Tu
 
Elliptic Curve Cryptography and Zero Knowledge Proof
Elliptic Curve Cryptography and Zero Knowledge ProofElliptic Curve Cryptography and Zero Knowledge Proof
Elliptic Curve Cryptography and Zero Knowledge ProofArunanand Ta
 
Εφαρμογή Τεχνικών Εξόρυξης Δεδομένων για την Εξαγωγή Προτύπων Διόρθωσης σε Σφ...
Εφαρμογή Τεχνικών Εξόρυξης Δεδομένων για την Εξαγωγή Προτύπων Διόρθωσης σε Σφ...Εφαρμογή Τεχνικών Εξόρυξης Δεδομένων για την Εξαγωγή Προτύπων Διόρθωσης σε Σφ...
Εφαρμογή Τεχνικών Εξόρυξης Δεδομένων για την Εξαγωγή Προτύπων Διόρθωσης σε Σφ...ISSEL
 
Hash length extension attacks
Hash length extension attacksHash length extension attacks
Hash length extension attacksJerome Smith
 
Τελευταία επανάληψη για τους μαθητές της Γ Λυκείου
Τελευταία επανάληψη για τους μαθητές της Γ ΛυκείουΤελευταία επανάληψη για τους μαθητές της Γ Λυκείου
Τελευταία επανάληψη για τους μαθητές της Γ ΛυκείουΜάκης Χατζόπουλος
 
Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)Patricia Aas
 
Writing native bindings to node.js in C++
Writing native bindings to node.js in C++Writing native bindings to node.js in C++
Writing native bindings to node.js in C++nsm.nikhil
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and ComplexityRajandeep Gill
 
Διαγώνισμα δομή ακολουθίας ΑΕΠΠ
Διαγώνισμα δομή ακολουθίας ΑΕΠΠΔιαγώνισμα δομή ακολουθίας ΑΕΠΠ
Διαγώνισμα δομή ακολουθίας ΑΕΠΠEleni Kokkinou
 
Marc edit en la migración de datos - Luis Peña. 2014
Marc edit en la migración de datos - Luis Peña. 2014Marc edit en la migración de datos - Luis Peña. 2014
Marc edit en la migración de datos - Luis Peña. 2014Luis Peña
 
Elliptic Curve Cryptography for those who are afraid of maths
Elliptic Curve Cryptography for those who are afraid of mathsElliptic Curve Cryptography for those who are afraid of maths
Elliptic Curve Cryptography for those who are afraid of mathsMartijn Grooten
 
Λεξιλογικές ασκήσεις
Λεξιλογικές ασκήσειςΛεξιλογικές ασκήσεις
Λεξιλογικές ασκήσειςmanolis mavrakakis
 
φύλλο εργασίας δομής επανάληψης Scratch
φύλλο εργασίας δομής επανάληψης Scratchφύλλο εργασίας δομής επανάληψης Scratch
φύλλο εργασίας δομής επανάληψης Scratchcpapadak
 

What's hot (20)

Лекция 4. Префиксные деревья (Tries, prefix trees)
Лекция 4. Префиксные деревья (Tries, prefix trees)Лекция 4. Префиксные деревья (Tries, prefix trees)
Лекция 4. Префиксные деревья (Tries, prefix trees)
 
Tutorial de Uso do R Selenium
Tutorial de Uso do R Selenium Tutorial de Uso do R Selenium
Tutorial de Uso do R Selenium
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prolog
 
Gstreamer plugin devpt_1
Gstreamer plugin devpt_1Gstreamer plugin devpt_1
Gstreamer plugin devpt_1
 
Lecture 8 dynamic programming
Lecture 8 dynamic programmingLecture 8 dynamic programming
Lecture 8 dynamic programming
 
Elliptic Curve Cryptography and Zero Knowledge Proof
Elliptic Curve Cryptography and Zero Knowledge ProofElliptic Curve Cryptography and Zero Knowledge Proof
Elliptic Curve Cryptography and Zero Knowledge Proof
 
Εφαρμογή Τεχνικών Εξόρυξης Δεδομένων για την Εξαγωγή Προτύπων Διόρθωσης σε Σφ...
Εφαρμογή Τεχνικών Εξόρυξης Δεδομένων για την Εξαγωγή Προτύπων Διόρθωσης σε Σφ...Εφαρμογή Τεχνικών Εξόρυξης Δεδομένων για την Εξαγωγή Προτύπων Διόρθωσης σε Σφ...
Εφαρμογή Τεχνικών Εξόρυξης Δεδομένων για την Εξαγωγή Προτύπων Διόρθωσης σε Σφ...
 
Hash length extension attacks
Hash length extension attacksHash length extension attacks
Hash length extension attacks
 
Τελευταία επανάληψη για τους μαθητές της Γ Λυκείου
Τελευταία επανάληψη για τους μαθητές της Γ ΛυκείουΤελευταία επανάληψη για τους μαθητές της Γ Λυκείου
Τελευταία επανάληψη για τους μαθητές της Γ Λυκείου
 
Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)Software Vulnerabilities in C and C++ (CppCon 2018)
Software Vulnerabilities in C and C++ (CppCon 2018)
 
Writing native bindings to node.js in C++
Writing native bindings to node.js in C++Writing native bindings to node.js in C++
Writing native bindings to node.js in C++
 
Asymptotic Notation and Complexity
Asymptotic Notation and ComplexityAsymptotic Notation and Complexity
Asymptotic Notation and Complexity
 
DES.ppt
DES.pptDES.ppt
DES.ppt
 
Διαγώνισμα δομή ακολουθίας ΑΕΠΠ
Διαγώνισμα δομή ακολουθίας ΑΕΠΠΔιαγώνισμα δομή ακολουθίας ΑΕΠΠ
Διαγώνισμα δομή ακολουθίας ΑΕΠΠ
 
Marc edit en la migración de datos - Luis Peña. 2014
Marc edit en la migración de datos - Luis Peña. 2014Marc edit en la migración de datos - Luis Peña. 2014
Marc edit en la migración de datos - Luis Peña. 2014
 
Elliptic Curve Cryptography for those who are afraid of maths
Elliptic Curve Cryptography for those who are afraid of mathsElliptic Curve Cryptography for those who are afraid of maths
Elliptic Curve Cryptography for those who are afraid of maths
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Λεξιλογικές ασκήσεις
Λεξιλογικές ασκήσειςΛεξιλογικές ασκήσεις
Λεξιλογικές ασκήσεις
 
φύλλο εργασίας δομής επανάληψης Scratch
φύλλο εργασίας δομής επανάληψης Scratchφύλλο εργασίας δομής επανάληψης Scratch
φύλλο εργασίας δομής επανάληψης Scratch
 
2.2 ΠΑΡΑΓΩΓΟΣ ΣΥΝΑΡΤΗΣΗ
2.2 ΠΑΡΑΓΩΓΟΣ ΣΥΝΑΡΤΗΣΗ2.2 ΠΑΡΑΓΩΓΟΣ ΣΥΝΑΡΤΗΣΗ
2.2 ΠΑΡΑΓΩΓΟΣ ΣΥΝΑΡΤΗΣΗ
 

Viewers also liked

Gray bat conservation plan at sauta nwr ppt nr5884_summer2015_
Gray bat conservation plan at sauta nwr ppt nr5884_summer2015_Gray bat conservation plan at sauta nwr ppt nr5884_summer2015_
Gray bat conservation plan at sauta nwr ppt nr5884_summer2015_Blake Ellett
 
வருமானவரித்துறை வழங்கும் “பான் கார்டு” அட்டைக்கு விண்ணப்பிப்பது எப்படி?
வருமானவரித்துறை வழங்கும் “பான் கார்டு” அட்டைக்கு விண்ணப்பிப்பது எப்படி?வருமானவரித்துறை வழங்கும் “பான் கார்டு” அட்டைக்கு விண்ணப்பிப்பது எப்படி?
வருமானவரித்துறை வழங்கும் “பான் கார்டு” அட்டைக்கு விண்ணப்பிப்பது எப்படி?National Centre for Financial Education
 
Sslc2015 key -eng-paper ii
Sslc2015  key -eng-paper iiSslc2015  key -eng-paper ii
Sslc2015 key -eng-paper iijayaenglish
 

Viewers also liked (9)

Gray bat conservation plan at sauta nwr ppt nr5884_summer2015_
Gray bat conservation plan at sauta nwr ppt nr5884_summer2015_Gray bat conservation plan at sauta nwr ppt nr5884_summer2015_
Gray bat conservation plan at sauta nwr ppt nr5884_summer2015_
 
வருமானவரித்துறை வழங்கும் “பான் கார்டு” அட்டைக்கு விண்ணப்பிப்பது எப்படி?
வருமானவரித்துறை வழங்கும் “பான் கார்டு” அட்டைக்கு விண்ணப்பிப்பது எப்படி?வருமானவரித்துறை வழங்கும் “பான் கார்டு” அட்டைக்கு விண்ணப்பிப்பது எப்படி?
வருமானவரித்துறை வழங்கும் “பான் கார்டு” அட்டைக்கு விண்ணப்பிப்பது எப்படி?
 
How to ppt Sukanya Samriddhi Yojana_Kannada
How to ppt Sukanya Samriddhi Yojana_KannadaHow to ppt Sukanya Samriddhi Yojana_Kannada
How to ppt Sukanya Samriddhi Yojana_Kannada
 
Sslc2015 key -eng-paper ii
Sslc2015  key -eng-paper iiSslc2015  key -eng-paper ii
Sslc2015 key -eng-paper ii
 
Ольга Смирнова. Как создать проектный офис с нуля? 10 ошибок начинающего прое...
Ольга Смирнова. Как создать проектный офис с нуля? 10 ошибок начинающего прое...Ольга Смирнова. Как создать проектный офис с нуля? 10 ошибок начинающего прое...
Ольга Смирнова. Как создать проектный офис с нуля? 10 ошибок начинающего прое...
 
Filipino 140705062755-phpapp01
Filipino 140705062755-phpapp01Filipino 140705062755-phpapp01
Filipino 140705062755-phpapp01
 
Pliegues y fallas
Pliegues y fallasPliegues y fallas
Pliegues y fallas
 
Diseño de modas
Diseño de modasDiseño de modas
Diseño de modas
 
Swept away
Swept away Swept away
Swept away
 

Similar to Dstar Lite

MapReduceAlgorithms.ppt
MapReduceAlgorithms.pptMapReduceAlgorithms.ppt
MapReduceAlgorithms.pptCheeWeiTan10
 
Lec5 pagerank
Lec5 pagerankLec5 pagerank
Lec5 pagerankCarlos
 
Lec5 Pagerank
Lec5 PagerankLec5 Pagerank
Lec5 Pagerankmobius.cn
 
Pagerank (from Google)
Pagerank (from Google)Pagerank (from Google)
Pagerank (from Google)Sri Prasanna
 
Heuristic Searching: A* Search
Heuristic Searching: A* SearchHeuristic Searching: A* Search
Heuristic Searching: A* SearchIOSR Journals
 
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?Santosh Pandeya
 
Hashing.pptx
Hashing.pptxHashing.pptx
Hashing.pptxkratika64
 
Informed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data scienceInformed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data sciencedevvpillpersonal
 
Searching Informed Search.pdf
Searching Informed Search.pdfSearching Informed Search.pdf
Searching Informed Search.pdfDrBashirMSaad
 
Sorting Seminar Presentation by Ashin Guha Majumder
Sorting Seminar Presentation by Ashin Guha MajumderSorting Seminar Presentation by Ashin Guha Majumder
Sorting Seminar Presentation by Ashin Guha MajumderAshin Guha Majumder
 
An_Accelerated_Nearest_Neighbor_Search_Method_for_the_K-Means_Clustering_Algo...
An_Accelerated_Nearest_Neighbor_Search_Method_for_the_K-Means_Clustering_Algo...An_Accelerated_Nearest_Neighbor_Search_Method_for_the_K-Means_Clustering_Algo...
An_Accelerated_Nearest_Neighbor_Search_Method_for_the_K-Means_Clustering_Algo...Adam Fausett
 
C3L2_The Derivative_G12A.pptx
C3L2_The Derivative_G12A.pptxC3L2_The Derivative_G12A.pptx
C3L2_The Derivative_G12A.pptxkaran11dhawan
 
2-Heuristic Search.ppt
2-Heuristic Search.ppt2-Heuristic Search.ppt
2-Heuristic Search.pptMIT,Imphal
 
Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7Traian Rebedea
 
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaGraph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaPyData
 
Hashing and File Structures in Data Structure.pdf
Hashing and File Structures in Data Structure.pdfHashing and File Structures in Data Structure.pdf
Hashing and File Structures in Data Structure.pdfJaithoonBibi
 

Similar to Dstar Lite (20)

Data Structure
Data StructureData Structure
Data Structure
 
MapReduceAlgorithms.ppt
MapReduceAlgorithms.pptMapReduceAlgorithms.ppt
MapReduceAlgorithms.ppt
 
Lec5 Pagerank
Lec5 PagerankLec5 Pagerank
Lec5 Pagerank
 
Lec5 pagerank
Lec5 pagerankLec5 pagerank
Lec5 pagerank
 
Lec5 Pagerank
Lec5 PagerankLec5 Pagerank
Lec5 Pagerank
 
Pagerank (from Google)
Pagerank (from Google)Pagerank (from Google)
Pagerank (from Google)
 
Heuristic Searching: A* Search
Heuristic Searching: A* SearchHeuristic Searching: A* Search
Heuristic Searching: A* Search
 
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
 
Hashing.pptx
Hashing.pptxHashing.pptx
Hashing.pptx
 
Informed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data scienceInformed-search TECHNIQUES IN ai ml data science
Informed-search TECHNIQUES IN ai ml data science
 
Searching Informed Search.pdf
Searching Informed Search.pdfSearching Informed Search.pdf
Searching Informed Search.pdf
 
Heuristic search
Heuristic searchHeuristic search
Heuristic search
 
Sorting Seminar Presentation by Ashin Guha Majumder
Sorting Seminar Presentation by Ashin Guha MajumderSorting Seminar Presentation by Ashin Guha Majumder
Sorting Seminar Presentation by Ashin Guha Majumder
 
An_Accelerated_Nearest_Neighbor_Search_Method_for_the_K-Means_Clustering_Algo...
An_Accelerated_Nearest_Neighbor_Search_Method_for_the_K-Means_Clustering_Algo...An_Accelerated_Nearest_Neighbor_Search_Method_for_the_K-Means_Clustering_Algo...
An_Accelerated_Nearest_Neighbor_Search_Method_for_the_K-Means_Clustering_Algo...
 
C3L2_The Derivative_G12A.pptx
C3L2_The Derivative_G12A.pptxC3L2_The Derivative_G12A.pptx
C3L2_The Derivative_G12A.pptx
 
2-Heuristic Search.ppt
2-Heuristic Search.ppt2-Heuristic Search.ppt
2-Heuristic Search.ppt
 
Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7Algorithm Design and Complexity - Course 7
Algorithm Design and Complexity - Course 7
 
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam LermaGraph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
Graph Analytics - From the Whiteboard to Your Toolbox - Sam Lerma
 
Hashing and File Structures in Data Structure.pdf
Hashing and File Structures in Data Structure.pdfHashing and File Structures in Data Structure.pdf
Hashing and File Structures in Data Structure.pdf
 
Hashing
HashingHashing
Hashing
 

Dstar Lite

  • 1. Adrian Sotelo CS582 Spring 2009 Digipen Institute of Technology
  • 2.  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
  • 3.
  • 4.  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
  • 5. Let’s review quickly how A* works.
  • 6.  Graph  Node  Open List  Closed List
  • 7.  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
  • 8.  List of nodes that need to be examined  Priority Queue sorted by f(x)  f(x) = g(x) + h(x)
  • 9.  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
  • 10. 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
  • 11.
  • 12.  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?
  • 13.  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
  • 14.  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
  • 15.  Cost changed dynamically  g(x) = A+B  rhs(x) = g(x’)+c(x’,x) =A+∞ = ∞  g(x) != rhs(x)  This is called locally inconsistent
  • 16.  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
  • 17.  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
  • 18.  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.
  • 19.  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)
  • 21.  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
  • 22.  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
  • 23.  Priority Queue Sorted by Key Value  All nodes in the Open List are locally inconsistent  All locally inconsistent nodes are on the open list
  • 24. 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
  • 25.
  • 26.  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
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.  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
  • 33.  Built on top of LPA*  Takes into consideration path already traveled  How does it do this?
  • 34.  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
  • 35.  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
  • 36.  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?
  • 37.  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