Shortest Path Algorithm This is called “Dijkstra’s Algorithm” …pronounced “Dirk-stra”

Slides:



Advertisements
Similar presentations
Decision Maths Networks Kruskals Algorithm Wiltshire Networks A Network is a weighted graph, which just means there is a number associated with each.
Advertisements

Decision Maths Dijkstra’s Algorithm.
DIJKSTRA’s Algorithm. Definition fwd search Find the shortest paths from a given SOURCE node to ALL other nodes, by developing the paths in order of increasing.
Chapter 7: Transportation Models Skip Ship Routing & Scheduling (pp ) Service Selection Shortest Path Transportation Problem Vehicle Routing &
Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network using the lowest possible.
Management Science 461 Lecture 2b – Shortest Paths September 16, 2008.
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
1 Dijkstra's Shortest Path Algorithm Find shortest path from s to t. s 3 t
1 Dijkstra's Shortest Path Algorithm Find shortest path from s to t. s 3 t
Shortest Path Problems Directed weighted graph. Path length is sum of weights of edges on path. The vertex at which the path begins is the source vertex.
1 Routing Algorithms. 2 Outline zBellaman-Ford Algorithm zDijkstra Algorithm.
Algorithms on graphs In Decision Mathematics, a graph consists of points (called vertices or nodes) which are connected by lines (edges or arcs). Eg in.
The Shortest Path Problem
Quickest Route B St Li C La time matrix (minutes) Liskeard Launceston Callington St Austell Bodmin 32 What is the quickest route from.
NetworkModel-1 Network Optimization Models. NetworkModel-2 Network Terminology A network consists of a set of nodes and arcs. The arcs may have some flow.
Chapter 4: Finding the Shortest Path Lesson 1: Dijkstra’s Algorithm
Using Dijkstra’s Algorithm to Find a Shortest Path from a to z 1.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
Shortest Path. Dijkstra’s Algorithm finds the shortest path from the start vertex to every other vertex in the network. We will find the shortest path.
Shortest Path. What is Shortest Path In a network, there are often many possible paths from one node in a network to another. It is often desirable (for.
Networks.
The travelling Salesman problem involves visiting every town (node) on a graph and returning to the start in the shortest distance. The slides will show.
Minimum spanning trees Aims: To know the terms: tree, spanning tree, minimum spanning tree. To understand that a minimum spanning tree connects a network.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
TSP – Upper Bounds and Lower Bounds Initial problem : Upper Bound A salesman based in Stockton needs to visit shops based in Darlington, Billingham, Middlesbrough,
Liskeard Launceston Callington St Austell Bodmin Starter Find the quickest route from St Austell to Launceston.
Graphs A ‘Graph’ is a diagram that shows how things are connected together. It makes no attempt to draw actual paths or routes and scale is generally inconsequential.
4.7 Triangle Inequalities. Theorem 4.10 If one side of a triangle is longer than another side, then the angle opposite the longer side is larger than.
E E Module 5 © Wayne D. Grover 2002, (for non-negative edge weights only) Key concepts: “labelling”, “scanning” Label = {distance, predecessor}.
Decision Maths 1 Shortest path algorithm Dijkstra’s Algorithm A V Ali :
Dijkstra animation. Dijksta’s Algorithm (Shortest Path Between 2 Nodes) 2 Phases:initialization;iteration Initialization: 1. Included:(Boolean) 2. Distance:(Weight)
Chapter 14 Section 3 - Slide 1 Copyright © 2009 Pearson Education, Inc. AND.
DECISION 1. How do you do a Bubble Sort? Bubble Sort:  You compare adjacent items in a list;  If they are in order, leave them.  If they are not in.
Mjdah Al Shehri Hamdy A. Taha, Operations Research: An introduction, 8 th Edition Chapter 6: Network Models.
Unit 3 Chinese Postman. Non - Eulerian Semi - Eulerian Eulerian.
1 Data Structures and Algorithms Graphs. 2 Graphs Basic Definitions Paths and Cycles Connectivity Other Properties Representation Examples of Graph Algorithms:
Graphs – Part III CS 367 – Introduction to Data Structures.
Networks Teacher’s guide. Networks 2 Problem 1 – the Link The EMTV Company needs to install a new cable system that links the six major towns in its.
1 1 Slide © 2005 Thomson/South-Western Chapter 9 Network Models n Shortest-Route Problem n Minimal Spanning Tree Problem n Maximal Flow Problem.
St. Edward’s University
Shortest Path from G to C Using Dijkstra’s Algorithm
Dijkstra’s shortest path Algorithm
Minimum Spanning Tree Chapter 13.6.
Network Flow Problems – Shortest Path Problem
Chapter 12 Network Models 12-1
Party-by-Night Problem
Decision Maths Dijkstra’s Algorithm.
15.082J & 6.855J & ESD.78J Visualizations
Shortest Path.
Shortest Path.
Naming and Measuring Angles
Graphs.
Dijkstra’s Shortest Path Algorithm Neil Tang 03/25/2008
Chapter 4: Finding the Shortest Path Lesson 1: Dijkstra’s Algorithm
Floyd’s Algorithm (shortest-path problem)
Route Inspection Which of these can be drawn without taking your pencil off the paper and without going over the same line twice? If we introduce a vertex.
Minimum spanning trees
The travelling salesman problem
Networks Kruskal’s Algorithm
Shortest Path.
Dijkstra’s Shortest Path Algorithm Neil Tang 3/2/2010
Dijkstra’s Algorithm for Shortest Paths
and 6.855J Dijkstra’s Algorithm
Visualizations Dijkstra’s Algorithm
Graph Algorithms: Shortest Path
Implementation of Dijkstra’s Algorithm
Find the shortest path from a to z
Shortest Path Solutions
Shortest Route Problems
15.082J & 6.855J & ESD.78J Visualizations
Presentation transcript:

Shortest Path Algorithm This is called “Dijkstra’s Algorithm” …pronounced “Dirk-stra”

Problem: Find the shortest route from A to F

Step 1Label the start vertex S with a permanent label of 0 Step 2Put a temporary label on each vertex that can be reached directly from the vertex that has just received a permanent label. The temporary label must be equal to the sum of the permanent label and the weight of the arc linking it directly to the vertex. If there is already a temporary label at the vertex, it is only replaced if the new sum is smaller.

Step 3Select the minimum temporary label and make it permanent. Step 4Repeat steps 2 and 3 until the destination vertex T receives its permanent label. Step 5Trace back from T to S including an arc ABwhenever the permanent label of B  permanent label of A = the weight of AB, given that B already lies on the path.

Vertex Letter Order of Selection Final Values Working Values Each vertex will have a box like the one below which has to be filled in:

Problem: Find the shortest route from A to F On the exam paper your diagram will look like this:

A B C D E F First vertex is A 1 Label 0 0 Temporary Labels 7 4 Second vertex is C 2 Label Third vertex is B 3 Label but 15 > 13 so ignore Fourth vertex is E 4 Label Fifth vertex is D 5 Label Sixth vertex is F Label Now trace back from F 16 – 13 = 3 so use DF 13 – 9 = 4 so use CD 4 – 0 = 4 so use AC Shortest Path is ACDF of length 16