Shortest Path Problems

Download Report

Transcript Shortest Path Problems

Shortest Path Problems

Modeling and Applications

Find a path with the lowest radiation

Find a path with the lowest radiation (A nontrivial example)

Shortest Path Problem

• A general network structure • A given node as the source, and another given node as destination • Each arc has a cost • Decision: find a path from the source to the destination with the minimum total cost – The cost of a path is the sum of costs on all arcs on the path 1 Source 1 (2) 5 costs (7) (3) (2) (3) 3 (2) 4 6 (8) (1) 7 (2) (1) (5) 2 Destination 1

Shortest Path Modeling

• Given a particular application (not obviously like a shortest path problem) • We construct a shortest path problem – To define a network (nodes, arcs, and arc costs) • Solving the shortest path problem gives the optimal solution of the application – Assuming we know how to solve a shortest path problem

Power Transmission Problem

3% 2 4 4% 2 % 1 3 % 3 % 3 5 Transmission efficiency = 1 - percentage lost e.g., from node 1 to 3, efficiency = 1-3%=97% 2 % 2 % Percentage loss 6 Final transmission efficiency received at the destination = multiplication of efficiency along the path.

For example, for path 1  2  4  6, the final transmission efficiency received at node 6 = (1-4%)*(1-3%)*(1-2%)=96%*97%*98%=91.258%.

Relating Power Transmission to Shortest Path

Differences

Path Evaluation Objective

Power Transmission

Multiplication of arc efficiency A maximization problem

Shortest Path

Summation of arc cost A minimization problem Observations: For some positive numbers a 1 ,…,a n a 1 × … × a n ≥ b 1 × … × b and b 1 ,…,b m , inequality m is equivalent to log(a 1 × … × a n ) ≥ log( b 1 × … × b m ), further equivalent to log(a 1 ) + … +log( a n ) ≥ log( b 1 )+… +log( b m ), and finally equivalent to -log(a 1 ) … -log( a n ) ≤ -log( b 1 ) … -log( b m ).

Max. Efficiency Power Transmission

• Convert the % lost into efficiency first as below.

97% 2 4 98 % 96% 98 % 1 6 97 % 98 % 97 % 3 5

Shortest Path Modeling

• In the network, define the cost of each arc as log(efficiency) as below.

-log(97%) 2 4 -log(98%) -log(96%) -log(98%) 1 6 -log(97%) -log(98%) -log(97%) 3 5 • Now we can find the shortest path under the given costs

Solution Analysis

• • •

Possible path 1:

1  2  4  6 – {[-log(96%)]+[-log(97%)]+[-log(98%)]}=0.0397

– Efficiency = 91.258%

Possible path 2:

1  2  5  6 – {[-log(96%)]+[-log(98%)]+[-log(98%)]}=0.0353

– Efficiency = 92.198%

Optimal path:

1  3  5  6 – {[-log(97%)]+[-log(97%)]+[-log(98%)]}=0.0352 (Min.) – Efficiency = 92.208% (Max.)

Another similar example

• A farmer wishes to transport a truckload of eggs from one city to another city through a given road network.

– The truck will incur a certain amount of breakage on each road segment – Let

w ij

be the percentage of eggs broken if the truck passes the road segment (

i

,

j

). – How should the truck be routed to minimize the total breakage? • Formulate the problem as a shortest path problem.

On-call Driver Schedule for a Bus Co.

Duty Hour Cost (HKD) 9am 1pm 300 9am 12pm 260 12nn 3pm 210 12nn 5pm 450 2pm 5pm 200 1pm 4pm 260 • Available on-call driver shifts and costs in the above table • Requirement: At least one on-call driver is on duty any time from 9am to 5pm.

• Question: the minimum-cost schedule 4pm 5pm 160

Shortest Path Model

Time 9 10 11 12 1 2 3 4 5 Model: each node corresponds to a time point, each arc to a possible shift Justification: Each path from 9 to 5 corresponds to a feasible schedule, e.g., path 9  1  4  5 means a schedule (9am-1pm)+(1pm-4pm)+(4pm-5pm) A feasible schedule with overlapped shifts: (9-12)+(12-3)+(2-5) ???

represented by path 9  12  3  2  5

Duty Hour Cost (HKD) 9am 1pm 300 9am 12pm 260 12nn 3pm 210 12nn 5pm 450 2pm 5pm 200 1pm 4pm 260 4pm 5pm 160 260 Time 9 260 0 10 0 11 0 12 0 1 0 2 0 3 200 160 0 4 0 5 450 210 Schedule 1: 9am  1pm,1pm  4pm,4pm  5pm, cost=HKD720 Schedule 2: 9am  1pm,12nn  5pm, cost=HKD750 Schedule 3: 9am  1pm,1pm  4pm, 2pm  5pm, cost=HKD760 Which is the shortest path?

Dynamic Shortest Paths

Suppose that the time it takes to travel in arc (i, j) depends on when one starts. (e.g., rush hour vs. other hours in road networks.) Let c ij (t) be the time it takes to travel in (i, j) starting at time t. What is the minimum time it takes to travel from node 1 to node n starting at 7:00 AM?

(1,2) (1,3) (2,3) (3,4) … 7 20 10 20 10 7:10 30 10 20 20 Start time 7:20 30 10 20 20 7:30 20 10 20 10 7:40 … … … … 7:50 … … … … … … … … … travel time in minutes

Time expanded network (time-space network) (1,2) (1,3) (2,4) (3,4) 10 10 10 10 7 10 10 20 10 7:10 20 10 20 30 7:20 20 10 20 30 7:30 … … … … 7:40 … … … … 7:50 1 1 1 1 … The shortest path from 1 to 4 depends on when to start.

2 2 2 2 2 2 … 3 4 3 4 3 4 3 4 3 4 3 … 4 Time T

Find a path with the lowest radiation

Modeling: (1)Partitioning the space as a k*k grid  with desired accuracy (2)Between any two points, calculating the total radiation received, assuming direct walking  arc costs (3)Finding the shortest path