Party-by-Night Problem

Slides:



Advertisements
Similar presentations
and 6.855J Dijkstras Algorithm with simple buckets (also known as Dials algorithm)
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.
Lecture 6 Shortest Path Problem. s t Dynamic Programming.
Management Science 461 Lecture 2b – Shortest Paths September 16, 2008.
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
1 Routing Algorithms. 2 Outline zBellaman-Ford Algorithm zDijkstra Algorithm.
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.
1 1 Slide © 2000 South-Western College Publishing/ITP Slides Prepared by JOHN LOUCKS.
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.
Dijkstra’s Algorithm. 2 Shortest-path Suppose we want to find the shortest path from node X to node Y It turns out that, in order to do this, we need.
Shortest Path Algorithm This is called “Dijkstra’s Algorithm” …pronounced “Dirk-stra”
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.
Dijkstra’s algorithm N: set of nodes for which shortest path already found Initialization: (Start with source node s) n N = {s}, D s = 0, “s is distance.
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
6/10/01Network Problems: DJK1 Network Problems Chapters 9 and 10.
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.
Graph Theory. undirected graph node: a, b, c, d, e, f edge: (a, b), (a, c), (b, c), (b, e), (c, d), (c, f), (d, e), (d, f), (e, f) subgraph.
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)
Network Problems A D O B T E C
Spanning Trees Dijkstra (Unit 10) SOL: DM.2 Classwork worksheet Homework (day 70) Worksheet Quiz next block.
SHORTEST ROUTE PROBLEM A Networking Model Report for DPA 702 QUANTITATIVE METHODS OF RESEARCH By: ALONA M. SALVA Cebu Technological University.
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
Network Flow Problems – Shortest Path Problem
EMIS 8374 Dijkstra’s Algorithm Updated 18 February 2008
Party-by-Night Problem
Dijkstra’s Algorithm with two levels of buckets
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
Decision Maths Dijkstra’s Algorithm.
15.082J & 6.855J & ESD.78J Visualizations
Dijkstra’s Algorithm for the Shortest Path Problem
15.082J & 6.855J & ESD.78J Visualizations
Lecture 6 Shortest Path Problem.
Shortest Path.
Shortest Path.
Dijkstra’s Algorithm for the Shortest Path Problem
MATS Quantitative Methods Dr Huw Owens
Shortest-Paths Trees Kun-Mao Chao (趙坤茂)
Lecture 24 CSE 331 Oct 29, 2012.
Chapter 4: Finding the Shortest Path Lesson 1: Dijkstra’s Algorithm
Spanning Tree Algorithms
Primal-Dual Algorithm
Chapter 6 Network Flow Models.
Shortest Path Algorithm for Weighted Non-negative Undirected Graphs
Shortest Path.
15.082J & 6.855J & ESD.78J Radix Heap Animation
Min Global Cut Animation
Dijkstra’s Algorithm for Shortest Paths
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
The Shortest Augmenting Path Algorithm for the Maximum Flow Problem
and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem Obtain a network, and use the same network to illustrate the.
and 6.855J Dijkstra’s Algorithm
Visualizations Dijkstra’s Algorithm
and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem Obtain a network, and use the same network to illustrate the.
15.082J & 6.855J & ESD.78J Visualizations
Dijkstra's Shortest Path Algorithm
Implementation of Dijkstra’s Algorithm
Shortest Path Solutions
Dijkstra Algorithm examples
Prim’s algorithm for minimum spanning trees
15.082J & 6.855J & ESD.78J Visualizations
Presentation transcript:

Party-by-Night Problem Dijkstra’s Algorithm Party-by-Night Problem

[node1 node2 node3 node4 … node14 ] To illustrate Dijkstra’s algorithm, we will find the shortest path from node 1 (Engineering Building) to node 14 (Springbok’s). We begin with the following labels; where a * represents a permanent label, and the ith number is the distance to the node i (i = 1;2;3;…;14). [0* 1200 1400 1100 ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞] [node1 node2 node3 node4 … node14 ] We label node 1 with a permanent label 0*. Then we label each node i that is connected to node 1 by a single arc with a “temporary” label equal to the length of the arc joining node 1 and node i. As there is no direct paths (nodes connected by a single arc) between node 1 and node 4;…;14 these distances are represented by ∞

Step 2: Node 4 has the smallest temporary label. We therefore make node 4’s label permanent and obtain the following labels: [0* 1200 1400 1100* ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞ ∞] We now know that node 4 is the closest node to node 1. We next compute temporary labels for all nodes that are connected to node 4 by a single arc. Node: Temporary Label Node 5 min{∞; 1100 + 50} = 1150* Node 7 min{∞; 1100 + 950} = 2050 Node 8 min{∞; 1100 + 350} = 1450 We obtain the following labels: [0* 1100* 1150 ∞ 2050 1450 ∞ ∞ ∞ ∞ ∞ ∞]

Step 3: Node 5 has the smallest temporary label. We therefore make node 5’s label permanent and obtain the following labels: [0* 1100* 1150* ∞ 2050 1450 ∞ ∞ ∞ ∞ ∞ ∞] We now know that node 5 is the second closest node to node 1. We next compute temporary labels for all nodes that are connected to node 5 by a single arc. Node: Temporary Label Node 9 min{∞; 1150 + 240} = 1390* We obtain the following labels: [0* 1100* 1150* 1390* ∞ ∞ ∞ ∞ ∞]

Step 4: Node 9 has the only temporary label as it’s the only node with a direct path from node 5. We therefore make node 9’s label permanent and obtain the following labels: [0* 1100* 1150* 1390* ∞ ∞ ∞ ∞ ∞] We next compute temporary labels for all nodes that are connected to node 9 by a single arc. Node: Temporary Label Node 11 min{∞; 1390 + 500} = 1890 Node 12 min{∞; 1390 + 350} = 1740 Node 13 min{∞; 1390 + 130} = 1520* We obtain the following labels: [0* 1100* 1150* 1390* ∞ 1890 1740 1520 ∞]

Step 5: Node 13 has the smallest temporary label. We therefore make node 13’s label permanent and obtain the following labels: [0* 1100* 1150* 1390* ∞ 1890 1740 1520* ∞] We now only have one node left. We compute temporary labels for the node that connects the last node, node 14, by a single arc. Node: Temporary Label Node 14 min{∞; 1520 + 390} = 1910* We obtain the following labels: [0* 1100* 1150* 1390* 1520* 1910]

[Node1 Node4 Node5 Node9 Node13 Node14] Conclusion: Our final set of labels is: [0* 1100* 1150* 1390* 1520* 1910*] We can now work backwards and find the shortest path from node 1 to node 14. The permanent label for node 14 represents the length of the shortest path, thus 1970m. The difference between the permanent labels of the nodes represents the lengths of the arc (path) between the nodes. E.g. Node 13 – Node 9 1520 – 1390 = 130 the distance between node 9 and node 13 is 130m. Our final labels thus represents the following path (in this order) through the nodes as the shortest path: [Node1 Node4 Node5 Node9 Node13 Node14]