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

More Related Content

What's hot

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
 
Koningsberg bridge problem
Koningsberg  bridge  problemKoningsberg  bridge  problem
Koningsberg bridge problemSudiksha Joshi
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's AlgorithmTamzida_Azad
 
Intro to Discrete Mathematics
Intro to Discrete MathematicsIntro to Discrete Mathematics
Intro to Discrete Mathematicsasad faraz
 
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 AlgorithmArijitDhali
 
Application of discrete math in real life
Application of discrete math in real lifeApplication of discrete math in real life
Application of discrete math in real lifeMdArifHossain30
 
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmA presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmGaurav Kolekar
 
Graph isomorphism
Graph isomorphismGraph isomorphism
Graph isomorphismCore Condor
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph TheoryYosuke Mizutani
 
Applications of Discrete Structures
Applications of Discrete StructuresApplications of Discrete Structures
Applications of Discrete Structuresaviban
 
Cryptography - Discrete Mathematics
Cryptography - Discrete MathematicsCryptography - Discrete Mathematics
Cryptography - Discrete MathematicsACM-KU
 

What's hot (20)

Application of Discrete Mathematics in CSE
Application of Discrete Mathematics in CSE Application of Discrete Mathematics in CSE
Application of Discrete Mathematics in CSE
 
Koningsberg bridge problem
Koningsberg  bridge  problemKoningsberg  bridge  problem
Koningsberg bridge problem
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
Euler graph
Euler graphEuler graph
Euler graph
 
Trees and graphs
Trees and graphsTrees and graphs
Trees and graphs
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's Algorithm
 
Intro to Discrete Mathematics
Intro to Discrete MathematicsIntro to Discrete Mathematics
Intro to Discrete Mathematics
 
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
 
Unit 1 chapter 1 Design and Analysis of Algorithms
Unit 1   chapter 1 Design and Analysis of AlgorithmsUnit 1   chapter 1 Design and Analysis of Algorithms
Unit 1 chapter 1 Design and Analysis of Algorithms
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Application of discrete math in real life
Application of discrete math in real lifeApplication of discrete math in real life
Application of discrete math in real life
 
Planar graph
Planar graphPlanar graph
Planar graph
 
A presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithmA presentation on prim's and kruskal's algorithm
A presentation on prim's and kruskal's algorithm
 
Graph isomorphism
Graph isomorphismGraph isomorphism
Graph isomorphism
 
SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS SINGLE-SOURCE SHORTEST PATHS
SINGLE-SOURCE SHORTEST PATHS
 
Introduction to Graph Theory
Introduction to Graph TheoryIntroduction to Graph Theory
Introduction to Graph Theory
 
Applications of Discrete Structures
Applications of Discrete StructuresApplications of Discrete Structures
Applications of Discrete Structures
 
Hashing
HashingHashing
Hashing
 
Cryptography - Discrete Mathematics
Cryptography - Discrete MathematicsCryptography - Discrete Mathematics
Cryptography - Discrete Mathematics
 

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 Mathematicsblaircomp2003
 
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
 
Penal code
Penal codePenal code
Penal codeFAROUQ
 
Lecture 1 basic concepts2009
Lecture 1 basic concepts2009Lecture 1 basic concepts2009
Lecture 1 basic concepts2009barath 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 RULESBhargavi Bhanu
 
Probability powerpoint
Probability powerpointProbability powerpoint
Probability powerpointTiffany Deegan
 
Basic Concept Of Probability
Basic Concept Of ProbabilityBasic Concept Of Probability
Basic Concept Of Probabilityguest45a926
 
Probability Powerpoint
Probability PowerpointProbability Powerpoint
Probability Powerpointspike2904
 
PROBABILITY
PROBABILITYPROBABILITY
PROBABILITYVIV13
 

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

Dijkstra’S Algorithm
Dijkstra’S AlgorithmDijkstra’S Algorithm
Dijkstra’S Algorithmami_01
 
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 .pptxasimshahzad8611
 
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 AlgorithmsIRJET Journal
 
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 GRAPHacijjournal
 
Algo labpresentation a_group
Algo labpresentation a_groupAlgo labpresentation a_group
Algo labpresentation a_groupUmme habiba
 
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 .docxaryan532920
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentationSubid Biswas
 
Pathfinding - Part 3: Beyond the basics
Pathfinding - Part 3: Beyond the basicsPathfinding - Part 3: Beyond the basics
Pathfinding - Part 3: Beyond the basicsStavros 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 Graphacijjournal
 
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyiAstar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyi
Astar.ppt hjguyjgukyjgoyjgugukgulgoyulgyilglyikamaleshs183
 
An Introduction to Graph Databases
An Introduction to Graph DatabasesAn Introduction to Graph Databases
An Introduction to Graph DatabasesInfiniteGraph
 
(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 graphsWaqas Nawaz
 

Similar to 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
 
Dijkstra's algorithm presentation
Dijkstra's algorithm presentationDijkstra's algorithm presentation
Dijkstra's algorithm presentation
 
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
 

Recently uploaded

The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfFIDO Alliance
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctBrainSell Technologies
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform EngineeringMarcus Vechiato
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireExakis Nelite
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftshyamraj55
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jNeo4j
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsLeah Henrickson
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimaginedpanagenda
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGDSC PJATK
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Hiroshi SHIBATA
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfFIDO Alliance
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 

Recently uploaded (20)

The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdfThe Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
The Value of Certifying Products for FDO _ Paul at FIDO Alliance.pdf
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
Microsoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - QuestionnaireMicrosoft CSP Briefing Pre-Engagement - Questionnaire
Microsoft CSP Briefing Pre-Engagement - Questionnaire
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on ThanabotsContinuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
Continuing Bonds Through AI: A Hermeneutic Reflection on Thanabots
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Google I/O Extended 2024 Warsaw
Google I/O Extended 2024 WarsawGoogle I/O Extended 2024 Warsaw
Google I/O Extended 2024 Warsaw
 
Syngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdfSyngulon - Selection technology May 2024.pdf
Syngulon - Selection technology May 2024.pdf
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024Long journey of Ruby Standard library at RubyKaigi 2024
Long journey of Ruby Standard library at RubyKaigi 2024
 
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdfHow Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
How Red Hat Uses FDO in Device Lifecycle _ Costin and Vitaliy at Red Hat.pdf
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 

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!