ME 9Q Network Flow Programming Final Exam, Summer 00. ( Points) The figure below shows an undirected network. The parameters on the edges are the edge lengths. Find the shortest path tree using Dijkstra s algorithm. Show in the table the order in which the nodes and edges are added to the tree along with the distance to each node. The root node is node. () () () () () () () 9 () 0 () (0) () () 9 0 () () The figure shows the correct tree, The tree is directed out from the root node. The nontree edges should not be directed. () () [] () () [] 0 () () [] () [] 9 (0) [] () () 9 [] [] () () [9] 0 [] () Sequence 9 0 Node 9 0 added Edge 9 0 added Distance to Node 0 9 () []
( Points) Consider the shortest tree path problem. a. Given an undirected network with n nodes similar to the one on page. All the edge lengths are positive. Say we have a partial shortest path tree obtained by Dijkstra s algorithm consisting of k of the n nodes (k < n). The partial tree describes the shortest paths from the root node to each of the k nodes. When we apply Dikstra s procedure to add the (k + ) st node to the tree, how can we be sure that the path to the new node is the optimum (shortest) path? Give a brief proof that it must be the shortest path. It is given that the tree is optimum for the k nodes already determined. We add node k + by selecting the edge with the least length from amount those that leave nodes already in the tree and go to nodes not in the tree. Say the edge selected is e k and the edges from which the selection was made was E k. The length of the path is k+. The resultant path to node k + includes edge e k and must be the shortest path to node k + because any other path must pass through some other edge in E k, all of which have lengths at least as great as e k. Since all edge lengths are positive, all other paths must have length no less than k+. b. Say we have completely solved the network on page to find the shortest path tree? Someone changes the length of one edge not in the shortest path tree. Suggest a procedure that you can use to test whether the current tree is still optimum. You don t want to start the algorithm over. Let the edge with the changed length be k(i, j) with length c k. Let the path length to node i in the current tree be i. Note that the edge is undirected. The shortest path tree is optimum if both of the two conditions below are satisfied. i + c k j and j + c k i. If one of the conditions is not satisfied, edge k should be part of the shortest path tree. The conditions come from the error correcting method of finding shortest paths. Note that it is necessary to do the test in both directions since the edge is undirected.
. ( Points) The heavy lines in the figure below show a basis for the pure network flow problem. The dotted lines show arcs with flow at the upper bounds. The lines that are neither dashed nor heavy carry no flow. n B = {,,,, 9,,,,, }. a. ( points) Show on the figure, the primal variables, x k, and dual variables, i, associated with this basis. (cost) [external flow] all upper bounds and gains = () () () () [] 0 [-] () () () () () 9 (0) () () () 9 () 0 {flow} (cost) [] [] [π] {} {} () () () () [0] {} [] 0 [-] () {} () {0} [9] () () () {} [] [] {} 9 (0) {} () [] {} {} () [] {} {} () 9 () 0 [] [] b. ( points) Determine if this basis provides an optimal solution. If not which arc should enter the basis?
d = 0 d = d = d = d0 = - d = d = d = Arcs and 0 are candidates to enter the basis. c. ( points) Say arc 0 is chosen to enter the basis. Which arc should leave the basis? If there is more than one candidate, list them all. C = {, -, -, -.. 0} Del = Min(0,,,,, ). Arc should leave that basis by going to its upper bound.
. ( Points) Say we are doing the primal simplex algorithm on a pure-minimal cost network flow problem. We have computed the dual variables i for the nodes of the network and the values of d k for the nonbasic arcs using the usual rules of the primal simplex method. a. At some iteration we find d k > 0 for some arc with flow at its upper bound. We compute the dual variable k with k = Max{0, -d k }. What optimality condition from the LP primal-dual theory tells us that the solution we have is not optimum? I want you to use the values of k in your discussion. The dual constraint associated with the variable x k is: - + -c i j k k. We call this the dual constraint in the discussion. For this solution d k > 0 or i + c k - j > 0 This implies that i - j > -c k. Since k = Max{0, -d k }. = 0, the dual constraint is loose, i - j + k > -c k.. Complementary slackness requires that if this constraint is loose, x k = 0. But it is given that the flow is at the upper bound, so x k = u k > 0. This means complementary slackness is not satisfied, so we cannot say that the solution is optimum. We have selected k with the rule above, but the constraint is loose for any nonnegative value of k. If we choose k = -d k, the dual constraint is tight, but the dual solution would be infeasible since the values of k are restricted to be nonnegative.. b. At some iteration we find d k > 0 for some arc with flow at its upper bound. When we do the procedure for finding the arc to leave the basis we discover that f, the maximum flow change on the cycle, is 0. How is this possible? How will the primal and dual solutions change in the next iteration? It must be that a basic arc on the cycle must be degenerate (flow at its upper or lower bound). In the next iteration, the primal solution will remain the same. The dual solution will change, because the basis tree will change. c. At some iteration we find d k > 0 for some arc with flow at its upper bound. When following the rules for the primal simplex, we discover that the set of arcs in the basis do not change. How is this possible? How will the primal and dual solutions change in the next iteration? It must be that the entering arc is also the leaving arc. In this case the primal solution changes in the next iteration for the arcs on the cycle. The dual solution remains the same because the basis tree does not change.
. ( Points) The figure below shows a maximum flow problem with flows assigned to the arcs. Based on these flows show with heavy lines the arcs that form a basis. Show on the figure the values of π for each node. Is this basis optimum? If not find an arc to enter the basis, and find the corresponding arc that will leave the basis. If the solution is optimum identify the arcs in the minimal cut. (flow, upper) all costs equal 0 except arc 9. (,) (,) (,) (,) (,) (,) (,) (0,) 9 (,) (0,) (,) 0 (,) (,) (,0) 9 (,) (,) (0,) (0,) 0 (, 00) cost = - 9
[] [] (,) (,) (,) (0,) (,) [0] [0] 0 [] (,) (,) (,) [] (,) (,) (,) (,0) 9 [] [] (,) (,) (,) (0,) (0,) 9 [] [] (0,) 0 (, 00) cost = - [] d = - d = - d = - d = - d0 = 0 d = 0 d = 0 d = 0 d = 0 9 Note that this basis is not unique. At least one of the arcs {9,, } must be chosen. Solutions that did not chose one are penalized. The choice will not change the min. cut. The solution is optimum. The minimal cust is {,,, } with capacity.
. ( Points) Consider the generalized network below. [external flow] (upper, cost, gain) (,,) (,,) (,,) (,0,0.) (,0,0.9) (,,) 9 (,,) 0 [-.] (,,) (,,0.) (,,0.9) (,0,) (,,) (,,0.) The basis considered for this problem is shown in the figure below. The heavy arcs are the basic arcs. The dashed arcs have flows at their upper bounds, and the arcs not shown have flows at zero. Node is the slack node. a. ( points) Show the columns for nodes, and of the basis inverse matrix for the selection of arcs shown. Note that you don t have to show all the columns. There are two possible representations of the basis. The results for each are below. Cycle: (, -9, -), β=., η = 9. Cycle: (-,, 9), β=0.9, η = -.. Node Node Node - -0.9 0 0 - -0.9 0 0-0.9 0 - -9 - -0 - -. -. - -9 -. -. - 0 0 0 Node Node Node - -0.9 0 0 - -0.9 0 0-0.9 0 - -.. 9 9 9 0 9.. 0 0 0
b. ( points) Compute the primal and dual solutions and show them on the figure provided. [π] (x) [0] () [π] (x) () (0) [.] [] () () (0.) [.] [] [] (.) () (0.9) [] [9] Arcs ((, ) and (, ) are candidates to enter. c. ( points) Say arc 0(, ) enters the basis and arc 9(, ) leaves. Show the triple-pointer representation of the new basis below. Pointer Representation Node P B 0 - - - - 0 P F 0 0 P R or PF = and PR = 9
. ( Points) We are planning the production schedule for a heat-treating process in a production plant. There are two kinds of product A and B. The products are placed in the process and must remain there for a fixed time. Product A remains in the process for days, and product B remains for days. You are to make a planning schedule for the next days. The planning schedule (which you are to determine) will specify how many products of each type will start processing on each day. Because of staffing, maintenance and other considerations, the capacity of the process is not constant. In particular, the capacity of the process in day i is c i, where i runs from to. The process is currently empty and it is to end the -day period empty. The values of the products are not equal. Product A has a value of a, and product B has a value of b. On any given day, at most 0 of product A and of product B can be started. There are no restrictions on the total of amounts of A and B treated during the -day period. Construct a network model that would determine the planning schedule that will maximize the total value of the units processed. You don t have to show the entire model. Day 9 0 Capacity (c i ) 0 0 0 Day 9 0 Capacity (c i ) 9 9 0 9 The value for the two products is a =, b = 9. (, -b) (, -b) (, -b) (upper, cost) 0 (c, 0) (c, 0) (c, 0) (c0, 0) 9 0 (0, -a) (0, -a) (0, -a) This model is a generalization of the problem in an earlier exam. Models that use two networks and side constraints are penalized because the pure network model above is available. 0
. ( Points) Say you are a salesperson located in New York City on the east coast of the United States. You are assigned to visit each capital city of the contiguous states of the US. Your final destination is at Los Angeles on the west coast. You have a table of the air flight costs between every pair of the capital cities and also the costs of flights leaving NY or terminating at LA. You decide that you will only take a flight that terminates at a point further west than its origin point. Thus each flight you take will move you closer to your destination on the west coast. Of course, this restriction on flights may make it impossible or very expensive to visit all the cities. For each city not included on your route, you decide to hire a local representative to make the visit. The cost of hiring a local representative is $00. Construct a network flow programming model to find the route from NY to LA that minimizes the total of your flight costs plus the cost of hiring local representatives. One way to handle this is through the assignment model. Since the salesperson only goes from E to W on a flight, there can be no cycles. A cycle would require a W to E flight. In the figure below we list the cities from E to W, with NY at the first column and LA at the last. The C's refer to the capitals, numbered in the order of their westward progression. For flight costs we number NY as 0 and LA as 9. All the entries below the main diagonal are impossible since they go from W to E. The numbers on the main diagonal is the cost of serving the city with a local representative. NY C C C C LA Req. NY x c 0 c 0 c 0 c 0, c 0,9 C x 00 C x x 00 C x x x 00 : C x x x x 00 LA x x x x x x 0 Req 0
[external flow] (cost) [] NY (c0) NY [0] [] C (c0) (c0) (00) C [-] [] C (00) C [-] [] C (00) C [-] [] C C [-] [0] LA LA [-] Other formulations There are two other pure formulations that I have seen. One involves splitting the city nodes and putting a minimum and maximum flow of on the splitting arc. A Then an arc goes in the opposite direction to the splitting arc with a cost of 00. If the route does not pass through the city, the flow must come from that arc. Other arcs represent the transportation between cities and carry the flight cost. Only arcs going west are included. NY has a fixed flow of entering and LA a fixed flow of. A second approach does not require splitting the nodes and this is really the simplest approach. The arc from city i to city j has the cost of c ij 00. The c ij accounts for the cost of the flight and the 00 is the savings obtained from visiting the city. NY has a fixed flow of entering and LA a fixed flow of. Approaches that use integer variables and /or side constraints are penalized because these features are not necessary for this problem. Many persons put a fixed external flow of at each city and provide an input arc to NY with capacity 9. This does not work because transportation away from NY is multiplied by the number of cities visited. Other transportation costs a similarly inflated. The model
weights the transportation cost and the costs of hiring representatives incorrectly. The model would be OK if a separate trip were taken from NY to each city. This is not allowed by the problem since an eastward trip would have to precede each trip out of NY (except the first). The problem indicates that we are looking for a route from NY to LA. A route would not involve returning to NY before every trip. Some solutions used external flows of on each city and arcs with a gain of. This might work if integer flows were guaranteed, but since this is not a pure network, integrality is not automatically assured. One would have to prove that the solution would have an integer flows. Adding integer constraints to the flows would involve a penalty since there exist pure network models for this problem.