SlideShare ist ein Scribd-Unternehmen logo
1 von 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!

Weitere ähnliche Inhalte

Was ist angesagt?

Discrete Math in Real Life
Discrete Math in Real LifeDiscrete Math in Real Life
Discrete Math in Real Lifesulaiman hridoy
 
Intro & Applications of Discrete Math
Intro & Applications of Discrete MathIntro & Applications of Discrete Math
Intro & Applications of Discrete MathBilal Khan
 
Linear Algebra Applications
Linear Algebra ApplicationsLinear Algebra Applications
Linear Algebra ApplicationsRamesh Shashank
 
Harsh math ppt number system
Harsh math ppt number systemHarsh math ppt number system
Harsh math ppt number systemMohit Kumar Singh
 
Applications of linear algebra
Applications of linear algebraApplications of linear algebra
Applications of linear algebraPrerak Trivedi
 
Cs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer KeyCs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer Keyappasami
 
math in daily life
math in daily lifemath in daily life
math in daily lifesudharsan11
 
Application of mathematics in CSE
Application of mathematics in CSEApplication of mathematics in CSE
Application of mathematics in CSETareque Rahman
 
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
 
A study on number theory and its applications
A study on number theory and its applicationsA study on number theory and its applications
A study on number theory and its applicationsItishree Dash
 
Applications of maths in our daily life
Applications of maths in our daily lifeApplications of maths in our daily life
Applications of maths in our daily lifeAbhinav Somani
 
Fuzzy mathematics:An application oriented introduction
Fuzzy mathematics:An application oriented introductionFuzzy mathematics:An application oriented introduction
Fuzzy mathematics:An application oriented introductionNagasuri Bala Venkateswarlu
 
Applications of mathematics in real life
Applications of mathematics in real lifeApplications of mathematics in real life
Applications of mathematics in real lifeThasneemRazia
 

Was ist angesagt? (20)

Discrete Math in Real Life
Discrete Math in Real LifeDiscrete Math in Real Life
Discrete Math in Real Life
 
Intro & Applications of Discrete Math
Intro & Applications of Discrete MathIntro & Applications of Discrete Math
Intro & Applications of Discrete Math
 
Maths Project Power Point Presentation
Maths Project Power Point PresentationMaths Project Power Point Presentation
Maths Project Power Point Presentation
 
Linear Algebra Applications
Linear Algebra ApplicationsLinear Algebra Applications
Linear Algebra Applications
 
Harsh math ppt number system
Harsh math ppt number systemHarsh math ppt number system
Harsh math ppt number system
 
Graph theory
Graph  theoryGraph  theory
Graph theory
 
Applications of linear algebra
Applications of linear algebraApplications of linear algebra
Applications of linear algebra
 
Cs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer KeyCs6660 compiler design may june 2016 Answer Key
Cs6660 compiler design may june 2016 Answer Key
 
Maths in daily life
Maths in daily lifeMaths in daily life
Maths in daily life
 
Shortest path algorithms
Shortest path algorithmsShortest path algorithms
Shortest path algorithms
 
math in daily life
math in daily lifemath in daily life
math in daily life
 
Zero
ZeroZero
Zero
 
Graph Theory
Graph TheoryGraph Theory
Graph Theory
 
Application of mathematics in CSE
Application of mathematics in CSEApplication of mathematics in CSE
Application of mathematics in CSE
 
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 study on number theory and its applications
A study on number theory and its applicationsA study on number theory and its applications
A study on number theory and its applications
 
Applications of maths in our daily life
Applications of maths in our daily lifeApplications of maths in our daily life
Applications of maths in our daily life
 
Fuzzy mathematics:An application oriented introduction
Fuzzy mathematics:An application oriented introductionFuzzy mathematics:An application oriented introduction
Fuzzy mathematics:An application oriented introduction
 
Applications of mathematics in real life
Applications of mathematics in real lifeApplications of mathematics in real life
Applications of mathematics in real life
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
 

Andere mochten auch

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
 

Andere mochten auch (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
 

Ähnlich wie 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
 
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
 
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
 

Ähnlich wie 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
 
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...
 

Kürzlich hochgeladen

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DaySri Ambati
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 

Kürzlich hochgeladen (20)

The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo DayH2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
H2O.ai CEO/Founder: Sri Ambati Keynote at Wells Fargo Day
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 

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!