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?

Graph theory in network system
Graph theory in network systemGraph theory in network system
Graph theory in network systemManikanta satyala
 
Dijkstra’S Algorithm
Dijkstra’S AlgorithmDijkstra’S Algorithm
Dijkstra’S Algorithmami_01
 
Graph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanGraph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanChristian Kehl
 
CMSC 56 | Lecture 14: Representing Relations
CMSC 56 | Lecture 14: Representing RelationsCMSC 56 | Lecture 14: Representing Relations
CMSC 56 | Lecture 14: Representing Relationsallyn joy calcaben
 
Intro to Discrete Mathematics
Intro to Discrete MathematicsIntro to Discrete Mathematics
Intro to Discrete Mathematicsasad faraz
 
Dijkstra s algorithm
Dijkstra s algorithmDijkstra s algorithm
Dijkstra s algorithmmansab MIRZA
 
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
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Mohanlal Sukhadia University (MLSU)
 
Isomorphic graph
Isomorphic graphIsomorphic graph
Isomorphic graphumair khan
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithmsana younas
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's AlgorithmArijitDhali
 

Was ist angesagt? (20)

Maths Project Power Point Presentation
Maths Project Power Point PresentationMaths Project Power Point Presentation
Maths Project Power Point Presentation
 
Graph theory in network system
Graph theory in network systemGraph theory in network system
Graph theory in network system
 
Dijkstra’S Algorithm
Dijkstra’S AlgorithmDijkstra’S Algorithm
Dijkstra’S Algorithm
 
Graph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese PostmanGraph theory - Traveling Salesman and Chinese Postman
Graph theory - Traveling Salesman and Chinese Postman
 
CMSC 56 | Lecture 14: Representing Relations
CMSC 56 | Lecture 14: Representing RelationsCMSC 56 | Lecture 14: Representing Relations
CMSC 56 | Lecture 14: Representing Relations
 
Graph theory presentation
Graph theory presentationGraph theory presentation
Graph theory presentation
 
Intro to Discrete Mathematics
Intro to Discrete MathematicsIntro to Discrete Mathematics
Intro to Discrete Mathematics
 
Dijkstra s algorithm
Dijkstra s algorithmDijkstra s algorithm
Dijkstra s algorithm
 
Application of Discrete Mathematics in CSE
Application of Discrete Mathematics in CSE Application of Discrete Mathematics in CSE
Application of Discrete Mathematics in CSE
 
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
Shortest path (Dijkistra's Algorithm) & Spanning Tree (Prim's Algorithm)
 
Isomorphic graph
Isomorphic graphIsomorphic graph
Isomorphic graph
 
Graph theory
Graph  theoryGraph  theory
Graph theory
 
Ppt Project Math
Ppt Project MathPpt Project Math
Ppt Project Math
 
Graph theory
Graph theoryGraph theory
Graph theory
 
Trees
Trees Trees
Trees
 
Shortest path algorithm
Shortest path algorithmShortest path algorithm
Shortest path algorithm
 
Graphs - Discrete Math
Graphs - Discrete MathGraphs - Discrete Math
Graphs - Discrete Math
 
Graph theory
Graph theory Graph theory
Graph theory
 
Minimum spanning tree
Minimum spanning treeMinimum spanning tree
Minimum spanning tree
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's Algorithm
 

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
 
Applications of Discrete Structures
Applications of Discrete StructuresApplications of Discrete Structures
Applications of Discrete Structuresaviban
 
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 (15)

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

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

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

Kürzlich hochgeladen

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 

Kürzlich hochgeladen (20)

Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

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!