SlideShare a Scribd company logo
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!

More Related Content

What's hot

Engineering mathematics presentation
Engineering mathematics presentationEngineering mathematics presentation
Engineering mathematics presentation
Afzal Hossen
 
Application of Discrete Mathematics in CSE
Application of Discrete Mathematics in CSE Application of Discrete Mathematics in CSE
Application of Discrete Mathematics in CSE
A. N. M. Jubaer
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
Subid Biswas
 
Graph Theory: Trees
Graph Theory: TreesGraph Theory: Trees
Graph Theory: Trees
Ashikur Rahman
 
Graphs - Discrete Math
Graphs - Discrete MathGraphs - Discrete Math
Graphs - Discrete Math
Sikder Tahsin Al-Amin
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning tree
oneous
 
Applications of graph theory
                      Applications of graph theory                      Applications of graph theory
Applications of graph theory
NilaNila16
 
Prim's algorithm
Prim's algorithmPrim's algorithm
Prim's algorithm
Pankaj Thakur
 
Trees and graphs
Trees and graphsTrees and graphs
Trees and graphs
Lokesh Singrol
 
Data Structures - Lecture 10 [Graphs]
Data Structures - Lecture 10 [Graphs]Data Structures - Lecture 10 [Graphs]
Data Structures - Lecture 10 [Graphs]
Muhammad Hammad Waseem
 
Isomorphic graph
Isomorphic graphIsomorphic graph
Isomorphic graph
umair khan
 
Discrete Math in Real Life
Discrete Math in Real LifeDiscrete Math in Real Life
Discrete Math in Real Life
sulaiman hridoy
 
Graph theory in network system
Graph theory in network systemGraph theory in network system
Graph theory in network system
Manikanta satyala
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
Soujanya V
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
Rajendran
 
Graph theory introduction - Samy
Graph theory  introduction - SamyGraph theory  introduction - Samy
Graph theory introduction - Samy
Mark Arokiasamy
 
Real life use of Discrete Mathematics and Digital electronics.
Real life use of Discrete Mathematics and Digital electronics. Real life use of Discrete Mathematics and Digital electronics.
Real life use of Discrete Mathematics and Digital electronics.
Niloy Biswas
 
Dijkstra’S Algorithm
Dijkstra’S AlgorithmDijkstra’S Algorithm
Dijkstra’S Algorithm
ami_01
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
Mohamed Loey
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
Aliul Kadir Akib
 

What's hot (20)

Engineering mathematics presentation
Engineering mathematics presentationEngineering mathematics presentation
Engineering mathematics presentation
 
Application of Discrete Mathematics in CSE
Application of Discrete Mathematics in CSE Application of Discrete Mathematics in CSE
Application of Discrete Mathematics in CSE
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
Graph Theory: Trees
Graph Theory: TreesGraph Theory: Trees
Graph Theory: Trees
 
Graphs - Discrete Math
Graphs - Discrete MathGraphs - Discrete Math
Graphs - Discrete Math
 
Prim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning treePrim's Algorithm on minimum spanning tree
Prim's Algorithm on minimum spanning tree
 
Applications of graph theory
                      Applications of graph theory                      Applications of graph theory
Applications of graph theory
 
Prim's algorithm
Prim's algorithmPrim's algorithm
Prim's algorithm
 
Trees and graphs
Trees and graphsTrees and graphs
Trees and graphs
 
Data Structures - Lecture 10 [Graphs]
Data Structures - Lecture 10 [Graphs]Data Structures - Lecture 10 [Graphs]
Data Structures - Lecture 10 [Graphs]
 
Isomorphic graph
Isomorphic graphIsomorphic graph
Isomorphic graph
 
Discrete Math in Real Life
Discrete Math in Real LifeDiscrete Math in Real Life
Discrete Math in Real Life
 
Graph theory in network system
Graph theory in network systemGraph theory in network system
Graph theory in network system
 
Asymptotic analysis
Asymptotic analysisAsymptotic analysis
Asymptotic analysis
 
Turing Machine
Turing MachineTuring Machine
Turing Machine
 
Graph theory introduction - Samy
Graph theory  introduction - SamyGraph theory  introduction - Samy
Graph theory introduction - Samy
 
Real life use of Discrete Mathematics and Digital electronics.
Real life use of Discrete Mathematics and Digital electronics. Real life use of Discrete Mathematics and Digital electronics.
Real life use of Discrete Mathematics and Digital electronics.
 
Dijkstra’S Algorithm
Dijkstra’S AlgorithmDijkstra’S Algorithm
Dijkstra’S Algorithm
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
 

Viewers also liked

Introduction and Applications of Discrete Mathematics
Introduction and Applications of Discrete MathematicsIntroduction and Applications of Discrete Mathematics
Introduction and Applications of Discrete Mathematics
blaircomp2003
 
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...
Mamunur Rashid
 
Carbohydrate Counting
Carbohydrate CountingCarbohydrate Counting
Carbohydrate Counting
Emily Todhunter
 
Penal code
Penal codePenal code
Penal code
FAROUQ
 
Basic Probability
Basic ProbabilityBasic Probability
Basic Probability
Yesica Adicondro
 
Probability
ProbabilityProbability
Probability
Hasnain Baber
 
Probability
ProbabilityProbability
Probability
Mamello Mapena
 
Lecture 1 basic concepts2009
Lecture 1 basic concepts2009Lecture 1 basic concepts2009
Lecture 1 basic concepts2009
barath r baskaran
 
Supply Chain in Abbot
Supply Chain in AbbotSupply Chain in Abbot
Supply Chain in Abbot
Mubashir Ahmed
 
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
 
PROBABILITY
PROBABILITYPROBABILITY
PROBABILITY
VIV13
 

Viewers also liked (14)

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
 
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
 

Similar to 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
 
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
IRJET Journal
 
Ai1.pdf
Ai1.pdfAi1.pdf
Ai1.pdf
kaxeca4096
 
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
acijjournal
 
Algo labpresentation a_group
Algo labpresentation a_groupAlgo labpresentation a_group
Algo labpresentation a_group
Umme habiba
 
Fakhre alam
Fakhre alamFakhre alam
Fakhre 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
aryan532920
 
artifical intelligence final paper
artifical intelligence final paperartifical intelligence final paper
artifical intelligence final paper
shiva karthik reddy koyya
 
Combinatorial Optimization
Combinatorial OptimizationCombinatorial Optimization
Combinatorial Optimization
Institute of Technology, Nirma University
 
Pathfinding - Part 3: Beyond the basics
Pathfinding - Part 3: Beyond the basicsPathfinding - Part 3: Beyond the basics
Pathfinding - Part 3: Beyond the basics
Stavros Vassos
 
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
acijjournal
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
maharajdey
 
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyiAstar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
kamaleshs183
 
Week13 lec1
Week13 lec1Week13 lec1
Week13 lec1
syedhaiderraza
 
An Introduction to Graph Databases
An Introduction to Graph DatabasesAn Introduction to Graph Databases
An Introduction to Graph Databases
InfiniteGraph
 
dsa.pptx
dsa.pptxdsa.pptx
Ds presentation
Ds presentationDs presentation
Ds presentation
HamzaKhan777
 
(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
Waqas Nawaz
 
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...
idescitation
 
Robotics for Path Planning
Robotics for Path PlanningRobotics for Path Planning
Robotics for Path Planning
Hitesh Mohapatra
 

Similar to Discrete Mathematics Presentation (20)

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...
 
Robotics for Path Planning
Robotics for Path PlanningRobotics for Path Planning
Robotics for Path Planning
 

Recently uploaded

HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
IndexBug
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
DianaGray10
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
panagenda
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 

Recently uploaded (20)

HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial IntelligenceAI 101: An Introduction to the Basics and Impact of Artificial Intelligence
AI 101: An Introduction to the Basics and Impact of Artificial Intelligence
 
How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5UiPath Test Automation using UiPath Test Suite series, part 5
UiPath Test Automation using UiPath Test Suite series, part 5
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAUHCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
HCL Notes und Domino Lizenzkostenreduzierung in der Welt von DLAU
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.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!