SlideShare una empresa de Scribd logo
1 de 23
Descargar para leer sin conexión
DIJKSTRA'S ALGORITHM
By Laksman Veeravagu and Luis Barrera
THE AUTHOR: EDSGER WYBE DIJKSTRA
"Computer Science is no more about computers than
astronomy is about telescopes."
http://www.cs.utexas.edu/~EWD/
EDSGER WYBE DIJKSTRA
- May 11, 1930 – August 6, 2002
- Received the 1972 A. M. Turing Award, widely considered the
most prestigious award in computer science.
- The Schlumberger Centennial Chair of Computer Sciences at
The University of Texas at Austin from 1984 until 2000
- Made a strong case against use of the GOTO statement in
programming languages and helped lead to its deprecation.
- Known for his many essays on programming.
SINGLE-SOURCE SHORTEST PATH PROBLEM
Single-Source Shortest Path Problem - The problem of
finding shortest paths from a source vertex v to all other
vertices in the graph.
DIJKSTRA'S ALGORITHM
Dijkstra's algorithm - is a solution to the single-source
shortest path problem in graph theory.
Works on both directed and undirected graphs. However, all
edges must have nonnegative weights.
Approach: Greedy
Input: Weighted graph G={E,V} and source vertex v∈V, such
that all edge weights are nonnegative
Output: Lengths of shortest paths (or the shortest paths
themselves) from a given source vertex v∈V to all other
vertices
DIJKSTRA'S ALGORITHM - PSEUDOCODE
dist[s] ←0 (distance to source vertex is zero)
for all v ∈ V–{s}
do dist[v] ←∞ (set all other distances to infinity)
S←∅ (S, the set of visited vertices is initially empty)
Q←V (Q, the queue initially contains all vertices)
while Q ≠∅ (while the queue is not empty)
do u ← mindistance(Q,dist) (select the element of Q with the min. distance)
S←S∪{u} (add u to list of visited vertices)
for all v ∈ neighbors[u]
do if dist[v] > dist[u] + w(u, v) (if new shortest path found)
then d[v] ←d[u] + w(u, v) (set new value of shortest path)
(if desired, add traceback code)
return dist
DIJKSTRA ANIMATED EXAMPLE
DIJKSTRA ANIMATED EXAMPLE
DIJKSTRA ANIMATED EXAMPLE
DIJKSTRA ANIMATED EXAMPLE
DIJKSTRA ANIMATED EXAMPLE
DIJKSTRA ANIMATED EXAMPLE
DIJKSTRA ANIMATED EXAMPLE
DIJKSTRA ANIMATED EXAMPLE
DIJKSTRA ANIMATED EXAMPLE
DIJKSTRA ANIMATED EXAMPLE
IMPLEMENTATIONS AND RUNNING TIMES
The simplest implementation is to store vertices in an array
or linked list. This will produce a running time of
O(|V|^2 + |E|)
For sparse graphs, or graphs with very few edges and many
nodes, it can be implemented more efficiently storing the
graph in an adjacency list using a binary heap or priority
queue. This will produce a running time of
O((|E|+|V|) log |V|)
DIJKSTRA'S ALGORITHM - WHY IT WORKS
 As with all greedy algorithms, we need to make sure that it
is a correct algorithm (e.g., it always returns the right solution
if it is given correct input).
 A formal proof would take longer than this presentation, but
we can understand how the argument works intuitively.
 If you can’t sleep unless you see a proof, see the second
reference or ask us where you can find it.
 To understand how it works, we’ll go over the previous
example again. However, we need two mathematical
results first:
 Lemma 1: Triangle inequality
If δ(u,v) is the shortest path length between u and v,
δ(u,v) ≤ δ(u,x) + δ(x,v)
 Lemma 2:
The subpath of any shortest path is itself a shortest
path.
 The key is to understand why we can claim that anytime we
put a new vertex in S, we can say that we already know the
shortest path to it.
 Now, back to the example…
DIJKSTRA'S ALGORITHM - WHY IT WORKS
 As mentioned, Dijkstra’s algorithm calculates the
shortest path to every vertex.
 However, it is about as computationally expensive
to calculate the shortest path from vertex u to
every vertex using Dijkstra’s as it is to calculate the
shortest path to some particular vertex v.
 Therefore, anytime we want to know the optimal
path to some other vertex from a determined
origin, we can use Dijkstra’s algorithm.
DIJKSTRA'S ALGORITHM - WHY USE IT?
APPLICATIONS OF DIJKSTRA'S ALGORITHM
- Traffic Information Systems are most prominent use
- Mapping (Map Quest, Google Maps)
- Routing Systems
APPLICATIONS OF DIJKSTRA'S
ALGORITHM
 One particularly relevant this
week: epidemiology
 Prof. Lauren Meyers (Biology
Dept.) uses networks to model the
spread of infectious diseases and
design prevention and response
strategies.
 Vertices represent individuals,
and edges their possible contacts.
It is useful to calculate how a
particular individual is connected
to others.
 Knowing the shortest path
lengths to other individuals can be
a relevant indicator of the
potential of a particular individual
to infect others.
 Dijkstra’s original paper:
E. W. Dijkstra. (1959) A Note on Two Problems in Connection with
Graphs. Numerische Mathematik, 1. 269-271.
 MIT OpenCourseware, 6.046J Introduction to Algorithms.
< http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer-
Science/6-046JFall-2005/CourseHome/> Accessed 4/25/09
 Meyers, L.A. (2007) Contact network epidemiology: Bond percolation
applied to infectious disease prediction and control. Bulletin of the
American Mathematical Society 44: 63-86.
 Department of Mathematics, University of Melbourne. Dijkstra’s
Algorithm.
<http://www.ms.unimelb.edu.au/~moshe/620-
261/dijkstra/dijkstra.html > Accessed 4/25/09
REFERENCES

Más contenido relacionado

Similar a barrera.ppt

Dijkstra’s algorithm
Dijkstra’s algorithmDijkstra’s algorithm
Dijkstra’s algorithmfaisal2204
 
Dijkstra Shortest Path Visualization
Dijkstra Shortest Path VisualizationDijkstra Shortest Path Visualization
Dijkstra Shortest Path VisualizationIRJET Journal
 
04 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x204 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x2MuradAmn
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's AlgorithmTamzida_Azad
 
Algo labpresentation a_group
Algo labpresentation a_groupAlgo labpresentation a_group
Algo labpresentation a_groupUmme habiba
 
Ram minimum spanning tree
Ram   minimum spanning treeRam   minimum spanning tree
Ram minimum spanning treeRama Prasath A
 
Ijciras1101
Ijciras1101Ijciras1101
Ijciras1101zhendy94
 
Single source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstraSingle source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstraRoshan Tailor
 
Unit26 shortest pathalgorithm
Unit26 shortest pathalgorithmUnit26 shortest pathalgorithm
Unit26 shortest pathalgorithmmeisamstar
 
Connect-the-Dots in a Graph and Buffon's Needle on a Chessboard: Two Problems...
Connect-the-Dots in a Graph and Buffon's Needle on a Chessboard: Two Problems...Connect-the-Dots in a Graph and Buffon's Needle on a Chessboard: Two Problems...
Connect-the-Dots in a Graph and Buffon's Needle on a Chessboard: Two Problems...Vladimir Kulyukin
 
Dijkastra’s algorithm
Dijkastra’s algorithmDijkastra’s algorithm
Dijkastra’s algorithmPulkit Goel
 
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...KUSHDHIRRA2111026030
 
04 15029 active node ijeecs 1570310145(edit)
04 15029 active node ijeecs 1570310145(edit)04 15029 active node ijeecs 1570310145(edit)
04 15029 active node ijeecs 1570310145(edit)nooriasukmaningtyas
 
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final DraftMathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final DraftAlexanderCominsky
 
Comparative Analysis of Algorithms for Single Source Shortest Path Problem
Comparative Analysis of Algorithms for Single Source Shortest Path ProblemComparative Analysis of Algorithms for Single Source Shortest Path Problem
Comparative Analysis of Algorithms for Single Source Shortest Path ProblemCSCJournals
 
Bellman-Ford-Moore Algorithm and Dijkstra’s Algorithm
Bellman-Ford-Moore Algorithm and Dijkstra’s AlgorithmBellman-Ford-Moore Algorithm and Dijkstra’s Algorithm
Bellman-Ford-Moore Algorithm and Dijkstra’s AlgorithmFulvio Corno
 

Similar a barrera.ppt (20)

Dijkstra’s algorithm
Dijkstra’s algorithmDijkstra’s algorithm
Dijkstra’s algorithm
 
Dijkstra Shortest Path Visualization
Dijkstra Shortest Path VisualizationDijkstra Shortest Path Visualization
Dijkstra Shortest Path Visualization
 
04 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x204 greedyalgorithmsii 2x2
04 greedyalgorithmsii 2x2
 
Dijkstra's Algorithm
Dijkstra's AlgorithmDijkstra's Algorithm
Dijkstra's Algorithm
 
Algo labpresentation a_group
Algo labpresentation a_groupAlgo labpresentation a_group
Algo labpresentation a_group
 
Ram minimum spanning tree
Ram   minimum spanning treeRam   minimum spanning tree
Ram minimum spanning tree
 
Ijciras1101
Ijciras1101Ijciras1101
Ijciras1101
 
17 prims-kruskals (1)
17 prims-kruskals (1)17 prims-kruskals (1)
17 prims-kruskals (1)
 
Single source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstraSingle source stortest path bellman ford and dijkstra
Single source stortest path bellman ford and dijkstra
 
(148065320) dijistra algo
(148065320) dijistra algo(148065320) dijistra algo
(148065320) dijistra algo
 
Unit26 shortest pathalgorithm
Unit26 shortest pathalgorithmUnit26 shortest pathalgorithm
Unit26 shortest pathalgorithm
 
Connect-the-Dots in a Graph and Buffon's Needle on a Chessboard: Two Problems...
Connect-the-Dots in a Graph and Buffon's Needle on a Chessboard: Two Problems...Connect-the-Dots in a Graph and Buffon's Needle on a Chessboard: Two Problems...
Connect-the-Dots in a Graph and Buffon's Needle on a Chessboard: Two Problems...
 
Dijkastra’s algorithm
Dijkastra’s algorithmDijkastra’s algorithm
Dijkastra’s algorithm
 
Data structure and algorithm
Data structure and algorithmData structure and algorithm
Data structure and algorithm
 
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
APznzaZLM_MVouyxM4cxHPJR5BC-TAxTWqhQJ2EywQQuXStxJTDoGkHdsKEQGd4Vo7BS3Q1npCOMV...
 
04 15029 active node ijeecs 1570310145(edit)
04 15029 active node ijeecs 1570310145(edit)04 15029 active node ijeecs 1570310145(edit)
04 15029 active node ijeecs 1570310145(edit)
 
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final DraftMathematics Research Paper - Mathematics of Computer Networking - Final Draft
Mathematics Research Paper - Mathematics of Computer Networking - Final Draft
 
Comparative Analysis of Algorithms for Single Source Shortest Path Problem
Comparative Analysis of Algorithms for Single Source Shortest Path ProblemComparative Analysis of Algorithms for Single Source Shortest Path Problem
Comparative Analysis of Algorithms for Single Source Shortest Path Problem
 
Lausanne 2019 #4
Lausanne 2019 #4Lausanne 2019 #4
Lausanne 2019 #4
 
Bellman-Ford-Moore Algorithm and Dijkstra’s Algorithm
Bellman-Ford-Moore Algorithm and Dijkstra’s AlgorithmBellman-Ford-Moore Algorithm and Dijkstra’s Algorithm
Bellman-Ford-Moore Algorithm and Dijkstra’s Algorithm
 

Más de gopikahari7

Tema2_ArchitectureMIPS.pptx
Tema2_ArchitectureMIPS.pptxTema2_ArchitectureMIPS.pptx
Tema2_ArchitectureMIPS.pptxgopikahari7
 
cuckoosearchalgorithm-141028173457-conversion-gate02 (1).pptx
cuckoosearchalgorithm-141028173457-conversion-gate02 (1).pptxcuckoosearchalgorithm-141028173457-conversion-gate02 (1).pptx
cuckoosearchalgorithm-141028173457-conversion-gate02 (1).pptxgopikahari7
 
Final PPT.pptx (1).pptx
Final PPT.pptx (1).pptxFinal PPT.pptx (1).pptx
Final PPT.pptx (1).pptxgopikahari7
 
S12075-GPU-Accelerated-Video-Encoding.pptx
S12075-GPU-Accelerated-Video-Encoding.pptxS12075-GPU-Accelerated-Video-Encoding.pptx
S12075-GPU-Accelerated-Video-Encoding.pptxgopikahari7
 
S12075-GPU-Accelerated-Video-Encoding.pdf
S12075-GPU-Accelerated-Video-Encoding.pdfS12075-GPU-Accelerated-Video-Encoding.pdf
S12075-GPU-Accelerated-Video-Encoding.pdfgopikahari7
 
batalgorithm-160501121237 (1).pptx
batalgorithm-160501121237 (1).pptxbatalgorithm-160501121237 (1).pptx
batalgorithm-160501121237 (1).pptxgopikahari7
 
batalgorithm-170406072944 (4).pptx
batalgorithm-170406072944 (4).pptxbatalgorithm-170406072944 (4).pptx
batalgorithm-170406072944 (4).pptxgopikahari7
 
Copy of Parallel_and_Cluster_Computing.pptx
Copy of Parallel_and_Cluster_Computing.pptxCopy of Parallel_and_Cluster_Computing.pptx
Copy of Parallel_and_Cluster_Computing.pptxgopikahari7
 
MattsonTutorialSC14.pptx
MattsonTutorialSC14.pptxMattsonTutorialSC14.pptx
MattsonTutorialSC14.pptxgopikahari7
 
batalgorithm-170406072944 (4).pptx
batalgorithm-170406072944 (4).pptxbatalgorithm-170406072944 (4).pptx
batalgorithm-170406072944 (4).pptxgopikahari7
 
ELEMPowerPoint.pptx
ELEMPowerPoint.pptxELEMPowerPoint.pptx
ELEMPowerPoint.pptxgopikahari7
 
plantpresentation.ppt
plantpresentation.pptplantpresentation.ppt
plantpresentation.pptgopikahari7
 
2_2018_12_20!06_04_28_PM.ppt
2_2018_12_20!06_04_28_PM.ppt2_2018_12_20!06_04_28_PM.ppt
2_2018_12_20!06_04_28_PM.pptgopikahari7
 
abelbrownnvidiarakuten2016-170208065814 (1).pptx
abelbrownnvidiarakuten2016-170208065814 (1).pptxabelbrownnvidiarakuten2016-170208065814 (1).pptx
abelbrownnvidiarakuten2016-170208065814 (1).pptxgopikahari7
 
realtime_ai_systems_academia.pptx
realtime_ai_systems_academia.pptxrealtime_ai_systems_academia.pptx
realtime_ai_systems_academia.pptxgopikahari7
 
ppd_seminar_110202_talk_edward_freeman_introduction_to_programmable_logic_dev...
ppd_seminar_110202_talk_edward_freeman_introduction_to_programmable_logic_dev...ppd_seminar_110202_talk_edward_freeman_introduction_to_programmable_logic_dev...
ppd_seminar_110202_talk_edward_freeman_introduction_to_programmable_logic_dev...gopikahari7
 
BEC007 -Digital image processing.pdf
BEC007  -Digital image processing.pdfBEC007  -Digital image processing.pdf
BEC007 -Digital image processing.pdfgopikahari7
 

Más de gopikahari7 (20)

Tema2_ArchitectureMIPS.pptx
Tema2_ArchitectureMIPS.pptxTema2_ArchitectureMIPS.pptx
Tema2_ArchitectureMIPS.pptx
 
cuckoosearchalgorithm-141028173457-conversion-gate02 (1).pptx
cuckoosearchalgorithm-141028173457-conversion-gate02 (1).pptxcuckoosearchalgorithm-141028173457-conversion-gate02 (1).pptx
cuckoosearchalgorithm-141028173457-conversion-gate02 (1).pptx
 
Final PPT.pptx (1).pptx
Final PPT.pptx (1).pptxFinal PPT.pptx (1).pptx
Final PPT.pptx (1).pptx
 
S12075-GPU-Accelerated-Video-Encoding.pptx
S12075-GPU-Accelerated-Video-Encoding.pptxS12075-GPU-Accelerated-Video-Encoding.pptx
S12075-GPU-Accelerated-Video-Encoding.pptx
 
S12075-GPU-Accelerated-Video-Encoding.pdf
S12075-GPU-Accelerated-Video-Encoding.pdfS12075-GPU-Accelerated-Video-Encoding.pdf
S12075-GPU-Accelerated-Video-Encoding.pdf
 
batalgorithm-160501121237 (1).pptx
batalgorithm-160501121237 (1).pptxbatalgorithm-160501121237 (1).pptx
batalgorithm-160501121237 (1).pptx
 
batalgorithm-170406072944 (4).pptx
batalgorithm-170406072944 (4).pptxbatalgorithm-170406072944 (4).pptx
batalgorithm-170406072944 (4).pptx
 
Copy of Parallel_and_Cluster_Computing.pptx
Copy of Parallel_and_Cluster_Computing.pptxCopy of Parallel_and_Cluster_Computing.pptx
Copy of Parallel_and_Cluster_Computing.pptx
 
MattsonTutorialSC14.pptx
MattsonTutorialSC14.pptxMattsonTutorialSC14.pptx
MattsonTutorialSC14.pptx
 
batalgorithm-170406072944 (4).pptx
batalgorithm-170406072944 (4).pptxbatalgorithm-170406072944 (4).pptx
batalgorithm-170406072944 (4).pptx
 
ELEMPowerPoint.pptx
ELEMPowerPoint.pptxELEMPowerPoint.pptx
ELEMPowerPoint.pptx
 
Hayes2010.ppt
Hayes2010.pptHayes2010.ppt
Hayes2010.ppt
 
plantpresentation.ppt
plantpresentation.pptplantpresentation.ppt
plantpresentation.ppt
 
Plants.ppt
Plants.pptPlants.ppt
Plants.ppt
 
2_2018_12_20!06_04_28_PM.ppt
2_2018_12_20!06_04_28_PM.ppt2_2018_12_20!06_04_28_PM.ppt
2_2018_12_20!06_04_28_PM.ppt
 
abelbrownnvidiarakuten2016-170208065814 (1).pptx
abelbrownnvidiarakuten2016-170208065814 (1).pptxabelbrownnvidiarakuten2016-170208065814 (1).pptx
abelbrownnvidiarakuten2016-170208065814 (1).pptx
 
realtime_ai_systems_academia.pptx
realtime_ai_systems_academia.pptxrealtime_ai_systems_academia.pptx
realtime_ai_systems_academia.pptx
 
ppd_seminar_110202_talk_edward_freeman_introduction_to_programmable_logic_dev...
ppd_seminar_110202_talk_edward_freeman_introduction_to_programmable_logic_dev...ppd_seminar_110202_talk_edward_freeman_introduction_to_programmable_logic_dev...
ppd_seminar_110202_talk_edward_freeman_introduction_to_programmable_logic_dev...
 
FPGA-Arch.ppt
FPGA-Arch.pptFPGA-Arch.ppt
FPGA-Arch.ppt
 
BEC007 -Digital image processing.pdf
BEC007  -Digital image processing.pdfBEC007  -Digital image processing.pdf
BEC007 -Digital image processing.pdf
 

Último

Role of Consumer Insights in business transformation
Role of Consumer Insights in business transformationRole of Consumer Insights in business transformation
Role of Consumer Insights in business transformationAnnie Melnic
 
DATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etcDATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etclalithasri22
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfblazblazml
 
Statistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfStatistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfnikeshsingh56
 
Digital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfDigital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfNicoChristianSunaryo
 
Presentation of project of business person who are success
Presentation of project of business person who are successPresentation of project of business person who are success
Presentation of project of business person who are successPratikSingh115843
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBoston Institute of Analytics
 
Digital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksDigital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksdeepakthakur548787
 
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelDecoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelBoston Institute of Analytics
 
Non Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdfNon Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdfPratikPatil591646
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...Dr Arash Najmaei ( Phd., MBA, BSc)
 
IBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaIBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaManalVerma4
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...Jack Cole
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Boston Institute of Analytics
 

Último (17)

Insurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis ProjectInsurance Churn Prediction Data Analysis Project
Insurance Churn Prediction Data Analysis Project
 
Data Analysis Project: Stroke Prediction
Data Analysis Project: Stroke PredictionData Analysis Project: Stroke Prediction
Data Analysis Project: Stroke Prediction
 
2023 Survey Shows Dip in High School E-Cigarette Use
2023 Survey Shows Dip in High School E-Cigarette Use2023 Survey Shows Dip in High School E-Cigarette Use
2023 Survey Shows Dip in High School E-Cigarette Use
 
Role of Consumer Insights in business transformation
Role of Consumer Insights in business transformationRole of Consumer Insights in business transformation
Role of Consumer Insights in business transformation
 
DATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etcDATA ANALYSIS using various data sets like shoping data set etc
DATA ANALYSIS using various data sets like shoping data set etc
 
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdfEnglish-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
English-8-Q4-W3-Synthesizing-Essential-Information-From-Various-Sources-1.pdf
 
Statistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdfStatistics For Management by Richard I. Levin 8ed.pdf
Statistics For Management by Richard I. Levin 8ed.pdf
 
Digital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdfDigital Indonesia Report 2024 by We Are Social .pdf
Digital Indonesia Report 2024 by We Are Social .pdf
 
Presentation of project of business person who are success
Presentation of project of business person who are successPresentation of project of business person who are success
Presentation of project of business person who are success
 
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis ProjectBank Loan Approval Analysis: A Comprehensive Data Analysis Project
Bank Loan Approval Analysis: A Comprehensive Data Analysis Project
 
Digital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing worksDigital Marketing Plan, how digital marketing works
Digital Marketing Plan, how digital marketing works
 
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis modelDecoding Movie Sentiments: Analyzing Reviews with Data Analysis model
Decoding Movie Sentiments: Analyzing Reviews with Data Analysis model
 
Non Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdfNon Text Magic Studio Magic Design for Presentations L&P.pdf
Non Text Magic Studio Magic Design for Presentations L&P.pdf
 
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
6 Tips for Interpretable Topic Models _ by Nicha Ruchirawat _ Towards Data Sc...
 
IBEF report on the Insurance market in India
IBEF report on the Insurance market in IndiaIBEF report on the Insurance market in India
IBEF report on the Insurance market in India
 
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
why-transparency-and-traceability-are-essential-for-sustainable-supply-chains...
 
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
Data Analysis Project Presentation: Unveiling Your Ideal Customer, Bank Custo...
 

barrera.ppt

  • 1. DIJKSTRA'S ALGORITHM By Laksman Veeravagu and Luis Barrera
  • 2. THE AUTHOR: EDSGER WYBE DIJKSTRA "Computer Science is no more about computers than astronomy is about telescopes." http://www.cs.utexas.edu/~EWD/
  • 3. EDSGER WYBE DIJKSTRA - May 11, 1930 – August 6, 2002 - Received the 1972 A. M. Turing Award, widely considered the most prestigious award in computer science. - The Schlumberger Centennial Chair of Computer Sciences at The University of Texas at Austin from 1984 until 2000 - Made a strong case against use of the GOTO statement in programming languages and helped lead to its deprecation. - Known for his many essays on programming.
  • 4. SINGLE-SOURCE SHORTEST PATH PROBLEM Single-Source Shortest Path Problem - The problem of finding shortest paths from a source vertex v to all other vertices in the graph.
  • 5. DIJKSTRA'S ALGORITHM Dijkstra's algorithm - is a solution to the single-source shortest path problem in graph theory. Works on both directed and undirected graphs. However, all edges must have nonnegative weights. Approach: Greedy Input: Weighted graph G={E,V} and source vertex v∈V, such that all edge weights are nonnegative Output: Lengths of shortest paths (or the shortest paths themselves) from a given source vertex v∈V to all other vertices
  • 6. DIJKSTRA'S ALGORITHM - PSEUDOCODE dist[s] ←0 (distance to source vertex is zero) for all v ∈ V–{s} do dist[v] ←∞ (set all other distances to infinity) S←∅ (S, the set of visited vertices is initially empty) Q←V (Q, the queue initially contains all vertices) while Q ≠∅ (while the queue is not empty) do u ← mindistance(Q,dist) (select the element of Q with the min. distance) S←S∪{u} (add u to list of visited vertices) for all v ∈ neighbors[u] do if dist[v] > dist[u] + w(u, v) (if new shortest path found) then d[v] ←d[u] + w(u, v) (set new value of shortest path) (if desired, add traceback code) return dist
  • 17. IMPLEMENTATIONS AND RUNNING TIMES The simplest implementation is to store vertices in an array or linked list. This will produce a running time of O(|V|^2 + |E|) For sparse graphs, or graphs with very few edges and many nodes, it can be implemented more efficiently storing the graph in an adjacency list using a binary heap or priority queue. This will produce a running time of O((|E|+|V|) log |V|)
  • 18. DIJKSTRA'S ALGORITHM - WHY IT WORKS  As with all greedy algorithms, we need to make sure that it is a correct algorithm (e.g., it always returns the right solution if it is given correct input).  A formal proof would take longer than this presentation, but we can understand how the argument works intuitively.  If you can’t sleep unless you see a proof, see the second reference or ask us where you can find it.
  • 19.  To understand how it works, we’ll go over the previous example again. However, we need two mathematical results first:  Lemma 1: Triangle inequality If δ(u,v) is the shortest path length between u and v, δ(u,v) ≤ δ(u,x) + δ(x,v)  Lemma 2: The subpath of any shortest path is itself a shortest path.  The key is to understand why we can claim that anytime we put a new vertex in S, we can say that we already know the shortest path to it.  Now, back to the example… DIJKSTRA'S ALGORITHM - WHY IT WORKS
  • 20.  As mentioned, Dijkstra’s algorithm calculates the shortest path to every vertex.  However, it is about as computationally expensive to calculate the shortest path from vertex u to every vertex using Dijkstra’s as it is to calculate the shortest path to some particular vertex v.  Therefore, anytime we want to know the optimal path to some other vertex from a determined origin, we can use Dijkstra’s algorithm. DIJKSTRA'S ALGORITHM - WHY USE IT?
  • 21. APPLICATIONS OF DIJKSTRA'S ALGORITHM - Traffic Information Systems are most prominent use - Mapping (Map Quest, Google Maps) - Routing Systems
  • 22. APPLICATIONS OF DIJKSTRA'S ALGORITHM  One particularly relevant this week: epidemiology  Prof. Lauren Meyers (Biology Dept.) uses networks to model the spread of infectious diseases and design prevention and response strategies.  Vertices represent individuals, and edges their possible contacts. It is useful to calculate how a particular individual is connected to others.  Knowing the shortest path lengths to other individuals can be a relevant indicator of the potential of a particular individual to infect others.
  • 23.  Dijkstra’s original paper: E. W. Dijkstra. (1959) A Note on Two Problems in Connection with Graphs. Numerische Mathematik, 1. 269-271.  MIT OpenCourseware, 6.046J Introduction to Algorithms. < http://ocw.mit.edu/OcwWeb/Electrical-Engineering-and-Computer- Science/6-046JFall-2005/CourseHome/> Accessed 4/25/09  Meyers, L.A. (2007) Contact network epidemiology: Bond percolation applied to infectious disease prediction and control. Bulletin of the American Mathematical Society 44: 63-86.  Department of Mathematics, University of Melbourne. Dijkstra’s Algorithm. <http://www.ms.unimelb.edu.au/~moshe/620- 261/dijkstra/dijkstra.html > Accessed 4/25/09 REFERENCES