SlideShare une entreprise Scribd logo
1  sur  34
SHORTEST PATH ALGORITHM
SALMAN ELAHI | UZAIR ALAM | KAMRAN TARIQ
SHORTEST PATH ALGORITHM
 HISTORY, MOTIVATION & BACKGROUND
 WHAT’S IN A NUTSHELL?
 APPLICATIONS AND IMPLEMENTATION
THE KONIGSBERG BRIDGE PROBLEM
Konigsberg is a town on the Preger River, which in the 18th century was a
German town, but now is Russian.Within the town are two river islands
that are connected to the banks with seven bridges.
THE KONIGSBERG BRIDGE PROBLEM
 It became a tradition to try to walk around the town in a way that only
crossed each bridge once, but it proved to be a difficult problem.
Leonhard Euler, a Swiss mathematician heard about the problem and
tries to solve it.
GRAPH THEORY
 In 1736 Euler proved that the walk was not possible to do. He proved
this by inventing a kind of diagram called a Graph that is made up of
vertices (dots) and edges (arc). In this way Graph Theory can be
invented.
SHORTEST PATH PROBLEM
 The problem of computing shortest paths is indisputably one of the well-studied
problems in computer science and can be applied on many complex system of real
life.
 In graph theory, the shortest path problem is the problem of finding a path
between two vertices (or nodes) in a graph such that the sum of the weights of its
constituent edges is minimized.
 Two well-known algorithms we used in shortest path problem are:
 Dijkstra Algorithm
 A * Search Algorithm
SHORTEST PATH ALGORITHM
 HISTORY, MOTIVATION & BACKGROUND
 WHAT’S IN A NUTSHELL?
 APPLICATIONS AND IMPLEMENTATION
APPROACHESTO PATH FINDING
 There are many different approaches to path finding and for our purposes it is not necessary to detail each one.
 DIRECTED APPROACH:
 The main strategies for directed path finding algorithms are:
 Uniform cost search g(n) modifies the search to always choose the lowest cost next node.This minimizes the cost of the
path so far, it is optimal and complete, but can be very inefficient.
 Heuristic search h(n) estimates the cost from the next node to the goal.This cuts the search cost considerably but it is
neither optimal nor complete.
 So which algorithms works on these approaches.
THETWO BIG CELEBRITIES
 The two most commonly employed algorithms for directed path finding are:
 Dijkstra’s algorithm conceived by computer scientist Edsger Dijkstra in 1956 and published in 1959
 It uses the uniform cost strategy to find the optimal path.
 First in 1968 Nils Nilsson suggested this heuristic approach for path-finding algorithm, called A1 it is then
improved by different scientist and thus called A*
algorithm
 It combines both strategies there by minimizing the total path cost.
PRESENTING LEGENDARY DIJKSTRA
 Dijkstra’s algorithm pick the edge v that has minimum distance to the starting node g(v) is minimum and carries
the same process until it reaches the terminal point.
 Dijkstra’s algorithm pick the edge v that has minimum distance to the starting node g(v) is minimum and carries
the same process until it reaches the terminal point.
 Conditions:
 All edges must have nonnegative weights
 Graph must be connected
PSEUDO CODE FOR DIJKSTRA ALGORITHM
LIMITATIONS AND FLAWS
 Actual complexity is O(|E|log2 |E|)
 Is this good?
 Actually it is bad for very large graphs. As u can see in the side picture
 So Better Solution: Make a ‘hunch”!
HERE COME’S THE SAVER (A*)
 A* is an algorithm that:
 Uses heuristic to guide search
 While ensuring that it will compute a path with minimum cost
 It computes the function
f(n) = g(n) + h(n)
g(n) = “cost from the starting node to reach n”
h(n) = “estimate of the cost of the cheapest path from n to the goal node”
A * SAVES THE DAY
PROPERTIES OF A*
 A* generates an optimal solution if h(n) is an admissible heuristic and the search space is a tree:
 h(n) is admissible if it never overestimates the cost to reach the destination node
 A* generates an optimal solution if h(n) is a consistent heuristic and the search space is a graph:
– h(n) is consistent if for every node n and for every successor node n’ of n:
 h(n) ≤ c(n,n’) + h(n’)
n
n’
d
h(n)
c(n,n’) h(n’)
SHORTEST PATH ALGORITHM
 HISTORY, MOTIVATION & BACKGROUND
 WHAT’S IN A NUTSHELL?
 APPLICATIONS AND IMPLEMENTATION
DIJKSTRA OR A * SEARCH?
DIJKSTRA ALGORITHM
 It has one cost function, which is real cost value
from source to each node
 It finds the shortest path from source to every other
node by considering only real cost.
A * SEARCH ALGORITHM
 It has two cost function.
 Same as Dijkstra.The real cost to reach a node x.
 A* search only expand a node if it seems promising.
It only focuses to reach the goal node from the
current node, not to reach every other nodes. It is
optimal, if the heuristic function is admissible.
 By assigning weights to the nodes visited along the
way, we can predict the direction we should try
next
APPLICATIONS OF SHORTEST PATH ALGORITHM
 Games Development (Artificial Intelligence based)
 Maps
 Routing of Telecommunications Messages
 Network Routing Protocols
 Optimal Pipelining ofVLSI Chip
 Texture Mapping
 Typesetting in TeX
 UrbanTraffic Planning
 Subroutine in Advanced Algorithms
 Exploiting Arbitrage Opportunities in Currency Exchange
PATH FINDING IN GAMES DEVELOPMENT
 In many Games, computer controlled opponents need to move from one place to another in the GameWorld
 Path finding is the basic building block of most game A.I. (artificial intelligence), and with a little help from the
proper code your game will be that much smarter for it.
 If the start and end points are known in advance, and never change
 Can simply define a fixed path
 Computed before the game begins
 Most plat formers do this
 If the start and end points vary and are not known in advance (or may vary due to change in game state).
 Have to compute the path to follow while the game is running
 Need to use a path finding algorithm
A * IN GAMES DEVELOPMENT
 A * Algorithm is widely used as the conceptual core for path finding in Computer
Games
 Most commercial games use variants of the algorithm tailored to the specific game
 E.G. Star Craft Series
VIDEO
A * SEARCH BASED GAMES IN HTML5
DEMO
APPLICATIONS OF SHORTEST PATH ALGORITHM
 Games Development (Artificial Intelligence based)
 Maps
 Routing of Telecommunications Messages
 Network Routing Protocols
 Optimal Pipelining ofVLSI Chip
 Texture Mapping
 Typesetting in TeX
 UrbanTraffic Planning
 Subroutine in Advanced Algorithms
 Exploiting Arbitrage Opportunities in Currency Exchange
WHAT GOOGLE MAPS DO?
WHAT GOOGLE MAPS DO?
WHAT GOOGLE MAPS DO?
1
3
3
2
4
2
1 3 4
1
3
WHAT GOOGLE MAPS DO?
1
3
3
2
4
2
1 3 4
1
3
WHAT GOOGLE MAPS DO?
1
3
3
2
4
2
1 3 4
1
3
WHAT GOOGLE MAPS DO?
1
3
3
2
4
2
1 3 4
1
3
APPLICATIONS OF SHORTEST PATH ALGORITHM
 Games Development (Artificial Intelligence based)
 Maps
 Routing ofTelecommunications Messages
 Network Routing Protocols
 Optimal Pipelining ofVLSI Chip
 Texture Mapping
 Typesetting in TeX
 UrbanTraffic Planning
 Subroutine in Advanced Algorithms
 Exploiting Arbitrage Opportunities in Currency Exchange
SHORTEST PATH ALGORITHMS IN NETWORKING
APPLICATIONS OF SHORTEST PATH ALGORITHM
 Games Development (Artificial Intelligence based)
 Maps
 Routing of Telecommunications Messages
 Network Routing Protocols
 Optimal Pipelining ofVLSI Chip
 Texture Mapping
 Typesetting in TeX
 UrbanTraffic Planning
 Subroutine in Advanced Algorithms
 Exploiting Arbitrage Opportunities in Currency Exchange
REFERENCES
 http://mcfunkypants.com/LD25/
 A* Path finding Algorithm (University of UC Santa Cruz)
 http://en.wikipedia.org/wiki/A*_search_algorithm
 http://gis.stackexchange.com/questions/23908/what-is-the-difference-between-astar-and-dijkstra-algorithms-in-pgrouting
 https://www.cs.sunysb.edu/~skiena/combinatorica/animations/dijkstra.html
SHORTEST PATH ALGORITHM
SALMAN ELAHI | UZAIR ALAM | KAMRAN TARIQ
THANKS!

Contenu connexe

Tendances

daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
hodcsencet
 
MachineLearning.ppt
MachineLearning.pptMachineLearning.ppt
MachineLearning.ppt
butest
 
Bellman ford Algorithm
Bellman ford AlgorithmBellman ford Algorithm
Bellman ford Algorithm
taimurkhan803
 

Tendances (20)

15 puzzle problem using branch and bound
15 puzzle problem using branch and bound15 puzzle problem using branch and bound
15 puzzle problem using branch and bound
 
Shortest path algorithm
Shortest  path algorithmShortest  path algorithm
Shortest path algorithm
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
Discrete Math in Real Life
Discrete Math in Real LifeDiscrete Math in Real Life
Discrete Math in Real Life
 
sum of subset problem using Backtracking
sum of subset problem using Backtrackingsum of subset problem using Backtracking
sum of subset problem using Backtracking
 
implementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity pptimplementation of travelling salesman problem with complexity ppt
implementation of travelling salesman problem with complexity ppt
 
Intro & Applications of Discrete Math
Intro & Applications of Discrete MathIntro & Applications of Discrete Math
Intro & Applications of Discrete Math
 
A Star Search
A Star SearchA Star Search
A Star Search
 
Algorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms IAlgorithms Lecture 4: Sorting Algorithms I
Algorithms Lecture 4: Sorting Algorithms I
 
Knowledge Engineering in FOL.
Knowledge Engineering in FOL.Knowledge Engineering in FOL.
Knowledge Engineering in FOL.
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
daa-unit-3-greedy method
daa-unit-3-greedy methoddaa-unit-3-greedy method
daa-unit-3-greedy method
 
Bellman ford algorithm
Bellman ford algorithmBellman ford algorithm
Bellman ford algorithm
 
Approximation Algorithms
Approximation AlgorithmsApproximation Algorithms
Approximation Algorithms
 
MachineLearning.ppt
MachineLearning.pptMachineLearning.ppt
MachineLearning.ppt
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
 
Bellman ford Algorithm
Bellman ford AlgorithmBellman ford Algorithm
Bellman ford Algorithm
 
Shortest Path in Graph
Shortest Path in GraphShortest Path in Graph
Shortest Path in Graph
 
Shortest path problem
Shortest path problemShortest path problem
Shortest path problem
 

En vedette

Lecture 1 basic concepts2009
Lecture 1 basic concepts2009Lecture 1 basic concepts2009
Lecture 1 basic concepts2009
barath r baskaran
 
PROBABILITY AND IT'S TYPES WITH RULES
PROBABILITY AND IT'S TYPES WITH RULESPROBABILITY AND IT'S TYPES WITH RULES
PROBABILITY AND IT'S TYPES WITH RULES
Bhargavi Bhanu
 
Probability powerpoint
Probability powerpointProbability powerpoint
Probability powerpoint
Tiffany Deegan
 
Basic Concept Of Probability
Basic Concept Of ProbabilityBasic Concept Of Probability
Basic Concept Of Probability
guest45a926
 
Probability Powerpoint
Probability PowerpointProbability Powerpoint
Probability Powerpoint
spike2904
 

En vedette (15)

Introduction and Applications of Discrete Mathematics
Introduction and Applications of Discrete MathematicsIntroduction and Applications of Discrete Mathematics
Introduction and Applications of Discrete Mathematics
 
Penal code presentation. abduction, assault, criminal force, extortion, force...
Penal code presentation. abduction, assault, criminal force, extortion, force...Penal code presentation. abduction, assault, criminal force, extortion, force...
Penal code presentation. abduction, assault, criminal force, extortion, force...
 
Carbohydrate Counting
Carbohydrate CountingCarbohydrate Counting
Carbohydrate Counting
 
Penal code
Penal codePenal code
Penal code
 
Basic Probability
Basic ProbabilityBasic Probability
Basic Probability
 
Probability
ProbabilityProbability
Probability
 
Probability
ProbabilityProbability
Probability
 
Lecture 1 basic concepts2009
Lecture 1 basic concepts2009Lecture 1 basic concepts2009
Lecture 1 basic concepts2009
 
Applications of Discrete Structures
Applications of Discrete StructuresApplications of Discrete Structures
Applications of Discrete Structures
 
Supply Chain in Abbot
Supply Chain in AbbotSupply Chain in Abbot
Supply Chain in Abbot
 
PROBABILITY AND IT'S TYPES WITH RULES
PROBABILITY AND IT'S TYPES WITH RULESPROBABILITY AND IT'S TYPES WITH RULES
PROBABILITY AND IT'S TYPES WITH RULES
 
Probability powerpoint
Probability powerpointProbability powerpoint
Probability powerpoint
 
Basic Concept Of Probability
Basic Concept Of ProbabilityBasic Concept Of Probability
Basic Concept Of Probability
 
Probability Powerpoint
Probability PowerpointProbability Powerpoint
Probability Powerpoint
 
PROBABILITY
PROBABILITYPROBABILITY
PROBABILITY
 

Similaire à Discrete Mathematics Presentation

Spanning Tree in data structure and .pptx
Spanning Tree in data structure and .pptxSpanning Tree in data structure and .pptx
Spanning Tree in data structure and .pptx
asimshahzad8611
 
AbstractWe design an software to find optimal(shortest) path .docx
AbstractWe design an software to find optimal(shortest) path .docxAbstractWe design an software to find optimal(shortest) path .docx
AbstractWe design an software to find optimal(shortest) path .docx
aryan532920
 
An Introduction to Graph Databases
An Introduction to Graph DatabasesAn Introduction to Graph Databases
An Introduction to Graph Databases
InfiniteGraph
 

Similaire à Discrete Mathematics Presentation (20)

Dijkstra’S Algorithm
Dijkstra’S AlgorithmDijkstra’S Algorithm
Dijkstra’S Algorithm
 
Spanning Tree in data structure and .pptx
Spanning Tree in data structure and .pptxSpanning Tree in data structure and .pptx
Spanning Tree in data structure and .pptx
 
Node Path Visualizer Using Shortest Path Algorithms
Node Path Visualizer Using Shortest Path AlgorithmsNode Path Visualizer Using Shortest Path Algorithms
Node Path Visualizer Using Shortest Path Algorithms
 
Ai1.pdf
Ai1.pdfAi1.pdf
Ai1.pdf
 
PATH FINDING SOLUTIONS FOR GRID BASED GRAPH
PATH FINDING SOLUTIONS FOR GRID BASED GRAPHPATH FINDING SOLUTIONS FOR GRID BASED GRAPH
PATH FINDING SOLUTIONS FOR GRID BASED GRAPH
 
Algo labpresentation a_group
Algo labpresentation a_groupAlgo labpresentation a_group
Algo labpresentation a_group
 
Fakhre alam
Fakhre alamFakhre alam
Fakhre alam
 
AbstractWe design an software to find optimal(shortest) path .docx
AbstractWe design an software to find optimal(shortest) path .docxAbstractWe design an software to find optimal(shortest) path .docx
AbstractWe design an software to find optimal(shortest) path .docx
 
artifical intelligence final paper
artifical intelligence final paperartifical intelligence final paper
artifical intelligence final paper
 
Combinatorial Optimization
Combinatorial OptimizationCombinatorial Optimization
Combinatorial Optimization
 
Pathfinding - Part 3: Beyond the basics
Pathfinding - Part 3: Beyond the basicsPathfinding - Part 3: Beyond the basics
Pathfinding - Part 3: Beyond the basics
 
Path Finding Solutions For Grid Based Graph
Path Finding Solutions For Grid Based GraphPath Finding Solutions For Grid Based Graph
Path Finding Solutions For Grid Based Graph
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyiAstar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
 
Week13 lec1
Week13 lec1Week13 lec1
Week13 lec1
 
An Introduction to Graph Databases
An Introduction to Graph DatabasesAn Introduction to Graph Databases
An Introduction to Graph Databases
 
dsa.pptx
dsa.pptxdsa.pptx
dsa.pptx
 
Ds presentation
Ds presentationDs presentation
Ds presentation
 
(Icca 2014) shortest path analysis in social graphs
(Icca 2014) shortest path analysis in social graphs(Icca 2014) shortest path analysis in social graphs
(Icca 2014) shortest path analysis in social graphs
 
Implementation of D* Path Planning Algorithm with NXT LEGO Mindstorms Kit for...
Implementation of D* Path Planning Algorithm with NXT LEGO Mindstorms Kit for...Implementation of D* Path Planning Algorithm with NXT LEGO Mindstorms Kit for...
Implementation of D* Path Planning Algorithm with NXT LEGO Mindstorms Kit for...
 

Dernier

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Discrete Mathematics Presentation

  • 1. SHORTEST PATH ALGORITHM SALMAN ELAHI | UZAIR ALAM | KAMRAN TARIQ
  • 2. SHORTEST PATH ALGORITHM  HISTORY, MOTIVATION & BACKGROUND  WHAT’S IN A NUTSHELL?  APPLICATIONS AND IMPLEMENTATION
  • 3. THE KONIGSBERG BRIDGE PROBLEM Konigsberg is a town on the Preger River, which in the 18th century was a German town, but now is Russian.Within the town are two river islands that are connected to the banks with seven bridges.
  • 4. THE KONIGSBERG BRIDGE PROBLEM  It became a tradition to try to walk around the town in a way that only crossed each bridge once, but it proved to be a difficult problem. Leonhard Euler, a Swiss mathematician heard about the problem and tries to solve it.
  • 5. GRAPH THEORY  In 1736 Euler proved that the walk was not possible to do. He proved this by inventing a kind of diagram called a Graph that is made up of vertices (dots) and edges (arc). In this way Graph Theory can be invented.
  • 6. SHORTEST PATH PROBLEM  The problem of computing shortest paths is indisputably one of the well-studied problems in computer science and can be applied on many complex system of real life.  In graph theory, the shortest path problem is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized.  Two well-known algorithms we used in shortest path problem are:  Dijkstra Algorithm  A * Search Algorithm
  • 7. SHORTEST PATH ALGORITHM  HISTORY, MOTIVATION & BACKGROUND  WHAT’S IN A NUTSHELL?  APPLICATIONS AND IMPLEMENTATION
  • 8. APPROACHESTO PATH FINDING  There are many different approaches to path finding and for our purposes it is not necessary to detail each one.  DIRECTED APPROACH:  The main strategies for directed path finding algorithms are:  Uniform cost search g(n) modifies the search to always choose the lowest cost next node.This minimizes the cost of the path so far, it is optimal and complete, but can be very inefficient.  Heuristic search h(n) estimates the cost from the next node to the goal.This cuts the search cost considerably but it is neither optimal nor complete.  So which algorithms works on these approaches.
  • 9. THETWO BIG CELEBRITIES  The two most commonly employed algorithms for directed path finding are:  Dijkstra’s algorithm conceived by computer scientist Edsger Dijkstra in 1956 and published in 1959  It uses the uniform cost strategy to find the optimal path.  First in 1968 Nils Nilsson suggested this heuristic approach for path-finding algorithm, called A1 it is then improved by different scientist and thus called A* algorithm  It combines both strategies there by minimizing the total path cost.
  • 10. PRESENTING LEGENDARY DIJKSTRA  Dijkstra’s algorithm pick the edge v that has minimum distance to the starting node g(v) is minimum and carries the same process until it reaches the terminal point.  Dijkstra’s algorithm pick the edge v that has minimum distance to the starting node g(v) is minimum and carries the same process until it reaches the terminal point.  Conditions:  All edges must have nonnegative weights  Graph must be connected
  • 11. PSEUDO CODE FOR DIJKSTRA ALGORITHM
  • 12. LIMITATIONS AND FLAWS  Actual complexity is O(|E|log2 |E|)  Is this good?  Actually it is bad for very large graphs. As u can see in the side picture  So Better Solution: Make a ‘hunch”!
  • 13. HERE COME’S THE SAVER (A*)  A* is an algorithm that:  Uses heuristic to guide search  While ensuring that it will compute a path with minimum cost  It computes the function f(n) = g(n) + h(n) g(n) = “cost from the starting node to reach n” h(n) = “estimate of the cost of the cheapest path from n to the goal node”
  • 14. A * SAVES THE DAY
  • 15. PROPERTIES OF A*  A* generates an optimal solution if h(n) is an admissible heuristic and the search space is a tree:  h(n) is admissible if it never overestimates the cost to reach the destination node  A* generates an optimal solution if h(n) is a consistent heuristic and the search space is a graph: – h(n) is consistent if for every node n and for every successor node n’ of n:  h(n) ≤ c(n,n’) + h(n’) n n’ d h(n) c(n,n’) h(n’)
  • 16. SHORTEST PATH ALGORITHM  HISTORY, MOTIVATION & BACKGROUND  WHAT’S IN A NUTSHELL?  APPLICATIONS AND IMPLEMENTATION
  • 17. DIJKSTRA OR A * SEARCH? DIJKSTRA ALGORITHM  It has one cost function, which is real cost value from source to each node  It finds the shortest path from source to every other node by considering only real cost. A * SEARCH ALGORITHM  It has two cost function.  Same as Dijkstra.The real cost to reach a node x.  A* search only expand a node if it seems promising. It only focuses to reach the goal node from the current node, not to reach every other nodes. It is optimal, if the heuristic function is admissible.  By assigning weights to the nodes visited along the way, we can predict the direction we should try next
  • 18. APPLICATIONS OF SHORTEST PATH ALGORITHM  Games Development (Artificial Intelligence based)  Maps  Routing of Telecommunications Messages  Network Routing Protocols  Optimal Pipelining ofVLSI Chip  Texture Mapping  Typesetting in TeX  UrbanTraffic Planning  Subroutine in Advanced Algorithms  Exploiting Arbitrage Opportunities in Currency Exchange
  • 19. PATH FINDING IN GAMES DEVELOPMENT  In many Games, computer controlled opponents need to move from one place to another in the GameWorld  Path finding is the basic building block of most game A.I. (artificial intelligence), and with a little help from the proper code your game will be that much smarter for it.  If the start and end points are known in advance, and never change  Can simply define a fixed path  Computed before the game begins  Most plat formers do this  If the start and end points vary and are not known in advance (or may vary due to change in game state).  Have to compute the path to follow while the game is running  Need to use a path finding algorithm
  • 20. A * IN GAMES DEVELOPMENT  A * Algorithm is widely used as the conceptual core for path finding in Computer Games  Most commercial games use variants of the algorithm tailored to the specific game  E.G. Star Craft Series
  • 21. VIDEO
  • 22. A * SEARCH BASED GAMES IN HTML5 DEMO
  • 23. APPLICATIONS OF SHORTEST PATH ALGORITHM  Games Development (Artificial Intelligence based)  Maps  Routing of Telecommunications Messages  Network Routing Protocols  Optimal Pipelining ofVLSI Chip  Texture Mapping  Typesetting in TeX  UrbanTraffic Planning  Subroutine in Advanced Algorithms  Exploiting Arbitrage Opportunities in Currency Exchange
  • 26. WHAT GOOGLE MAPS DO? 1 3 3 2 4 2 1 3 4 1 3
  • 27. WHAT GOOGLE MAPS DO? 1 3 3 2 4 2 1 3 4 1 3
  • 28. WHAT GOOGLE MAPS DO? 1 3 3 2 4 2 1 3 4 1 3
  • 29. WHAT GOOGLE MAPS DO? 1 3 3 2 4 2 1 3 4 1 3
  • 30. APPLICATIONS OF SHORTEST PATH ALGORITHM  Games Development (Artificial Intelligence based)  Maps  Routing ofTelecommunications Messages  Network Routing Protocols  Optimal Pipelining ofVLSI Chip  Texture Mapping  Typesetting in TeX  UrbanTraffic Planning  Subroutine in Advanced Algorithms  Exploiting Arbitrage Opportunities in Currency Exchange
  • 31. SHORTEST PATH ALGORITHMS IN NETWORKING
  • 32. APPLICATIONS OF SHORTEST PATH ALGORITHM  Games Development (Artificial Intelligence based)  Maps  Routing of Telecommunications Messages  Network Routing Protocols  Optimal Pipelining ofVLSI Chip  Texture Mapping  Typesetting in TeX  UrbanTraffic Planning  Subroutine in Advanced Algorithms  Exploiting Arbitrage Opportunities in Currency Exchange
  • 33. REFERENCES  http://mcfunkypants.com/LD25/  A* Path finding Algorithm (University of UC Santa Cruz)  http://en.wikipedia.org/wiki/A*_search_algorithm  http://gis.stackexchange.com/questions/23908/what-is-the-difference-between-astar-and-dijkstra-algorithms-in-pgrouting  https://www.cs.sunysb.edu/~skiena/combinatorica/animations/dijkstra.html
  • 34. SHORTEST PATH ALGORITHM SALMAN ELAHI | UZAIR ALAM | KAMRAN TARIQ THANKS!