Download presentation
Presentation is loading. Please wait.
1
Facilities Planning Objectives and Agenda: 1. Examples of Shortest Path Problem 2. Finding shortest paths: Dijkstra’s method 3. Other applications of Shortest path problem
2
Example (Shortest Path Problem) What is the shortest route from Point A to Point B ? What if some roads are specified as 1-way only ?
3
A Graph-model of the Shortest Route problem Given a directed, weighted graph, G(V, E), start node s, end node v, Find the minimum total weight path from s to v Legend: Edge direct road weight road length nodes road intersections ust = HKUST tko = Tseung Kwan O kt = Kowloon Tong ch = Choi Hung tkw = To Kwa Wan pe = Prince Edward hh = Hung Hom
4
Finding shortest paths: Dijkstra’s method Strategy: Find shortest path to one node; [all other nodes remain] Find shortest path to one of the remaining nodes; Repeat … until done Key concept: Relaxation How? Upper bound on distance from s to u: d[u] If Node k has the MIN upper bound d[k] is the shortest distance from s to k Select node k to update upper bounds on remaining nodes
5
Relaxation.. 4 x y 10 18 4 x y 1014 Relax( x, y) 4 x y 1012 4 x y 10 12 Relax( x, y) cyan edge => current immediate predecessor of y is x Two cases of relaxation
6
Dijkstra’s method.. d[v i ] = for each vertex; d[s] = 0; Make two lists: S = { }; Q = V Find the node, u, in Q with minimum d[u] Remove u from Q, and add u to S For each edge (u, v), Relax (u, v); update IP(v) Q = { } no yes DONE
7
Dijkstra’s method, Example Find shortest path from ust to hh
8
Dijkstra’s method, Example.. S = set of nodes for which we know the shortest distance from s Q = remaining nodes in the graph d[ust] = d*[ust] = 0 relax ust
9
Dijkstra’s method, Example... mark IP’s of tko, ch MIN d[u] in Q is tko d*[tko] = 6 relax tko
10
Dijkstra’s method, Example…. MIN d[u] in Q is ch d*[ch] = 7 relax ch NOTE: what happens to IP of kt?
11
Dijkstra’s method, Example….. MIN d[u] in Q is kt d*[kt] = 9 relax kt
12
Dijkstra’s method, Example…... MIN d[u] in Q is pe d*[pe] = 10 relax pe NOTE: what happens to IP of hh?
13
Dijkstra’s method, Example ….... MIN d[u] in Q is tkw d*[tkw] = 11 relax tkw
14
Dijkstra’s method, Example…….. Shortest path: reverse(hh tkw ch ust) MIN d[u] in Q is hh d*[hh] = 12 relax hh DONE!
15
Dijkstra’s method, Proof PROPERTIES OF RELAXATION (i) d[u] is non-increasing: relaxation cannot increase d[u] (ii) d[u] cannot go below the shortest distance from s to u. connected graph there is a shortest distance from s to u = d*[u] d[u] ≥ d*[u] (i) and (ii) =>Once we have found the shortest path to node u, d[u] will never change.
16
Dijkstra’s method, Proof.. What are such nodes ? (2) Next candidate: select min d[u] node from nodes in set Q (1) The elements of set S why? Q Q Let: d[v] be minimum among all nodes in Q There are two possibilities for the shortest path from s to v so … ?
17
Dijkstra’s method, concluding remarks What if the graph is undirected ? Replace each undirected edge with two directed edges 4 x y 4 x y 4 What if the some edge weights are negative?
18
Shortest path, Applications - Telephone routes - Which communication links to activate when a user makes a phone call, e.g. from HK to New York, USA. - Road systems design Problem: how to determine the no. of lanes in each road? Given: expected traffic between each pair of locations Method: Estimate total traffic on each road link assuming each passenger will use shortest path - Many other applications, including: - Finance (arbitrage), - Assembly line inspection systems design, …
19
Prof Edsger Dijkstra [1930-2002] next topic: transportation flow planning – max flow
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.