190 likes | 454 Views
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. Example (Shortest Path Problem). What is the shortest route from Point A to Point B ?.
E N D
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
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 ?
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
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 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 Key concept: Relaxation
Relaxation.. Two cases of relaxation x x y y 4 4 18 10 10 12 Relax( x, y) Relax( x, y) x x y y 4 4 12 10 14 10 cyan edge => current immediate predecessor of y is x
Q = { } Dijkstra’s method.. d[vi] = 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) yes no DONE
Dijkstra’s method, Example Find shortest path from ust to hh
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
Dijkstra’s method, Example... mark IP’s of tko, ch MIN d[u] in Q is tko d*[tko] = 6 relax tko
Dijkstra’s method, Example…. MIN d[u] in Q is ch d*[ch] = 7 relax ch NOTE: what happens to IP of kt?
Dijkstra’s method, Example….. MIN d[u] in Q is kt d*[kt] = 9 relax kt
Dijkstra’s method, Example…... MIN d[u] in Q is pe d*[pe] = 10 relax pe NOTE: what happens to IP of hh?
Dijkstra’s method, Example….... MIN d[u] in Q is tkw d*[tkw] = 11 relax tkw
Dijkstra’s method, Example…….. MIN d[u] in Q is hh d*[hh] = 12 relax hh DONE! Shortest path: reverse(hh tkw ch ust)
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.
Q Q Dijkstra’s method, Proof.. What are such nodes ? (1) The elements of set S why? (2) Next candidate: select min d[u] node from nodes in set Q Let: d[v] be minimum among all nodes in Q There are two possibilities for the shortest path from s to v so … ?
x x y y 4 4 4 Dijkstra’s method, concluding remarks What if the graph is undirected ? Replace each undirected edge with two directed edges What if the some edge weights are negative?
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, …
Prof Edsger Dijkstra [1930-2002] next topic: transportation flow planning – max flow