Due date: 21 Feb. 2010
A farmer wishes to transport a truckload of eggs from city 1 to city 2 through a road network as above. The truck will incur a certain amount of breakage on each road segment, where the % value shown on the network is the percentage of eggs broken if the truck passes the road arc. How should the truck be routed to minimize the total breakage?
(1) Formulate the problem as a shortest path problem (showing the resulted shortest path problem such as drawing the network and specifying arc costs).
(2) Solve the problem by Dijkstra’s algorithm.
************************************************************************
Optional Questions (no submission required)
Suppose that a shortest path from node 1 to node 2 has been found. Let the cost be C.
(1) If, for all arcs in the network, the cost is increased by k times, k>0, will the shortest path change?
(2) If, for all arcs in the network, the cost is increased by a constant k, k>0, will the shortest path change?
(3) If, for all arcs starting from node 1, the cost is increased by a constant k, k>0, will the shortest path change?
(4) If, for one arc on the shortest path, the cost is increased by a constant k, k>0, will the new shortest path cost be C+k?
(5) If, for one arc on the shortest path, the cost is decreased by a constant k, k>0, will the new shortest path cost be C-k?
Ans(1):
First convert the % lost into efficiency as below:
Then define the cost of each arc as –log(efficiency) as below:
Possible path 1: 1 -> 3 -> 2
{[-log(99%)]+[-log(95%)]} = 0.0044+0.0223 = 0.0267
Efficiency = (1-1%)*(1-5%) = 99%*95% = 94.05%
Possible path 2: 1 -> 3 -> 4 -> 2
{[-log(99%)]+[-log(97%)]+[-log(98%)]} = 0.0044+0.0132+0.0088 = 0.0264
Efficiency = (1-1%)*(1-3%)*(1-2%) = 99%*97%*98% = 94.11%
Possible path 3: 1 -> 3 -> 4 -> 6 -> 7-> 2
{[-log(99%)]+[-log(97%)]+[-log(98%)]+[-log(99%)]+[-log(99%)]} =
0.0044+0.0132+0.0088+0.0044+0.0044 = 0.0352
Efficiency =