Download presentation
Presentation is loading. Please wait.
Published byDouglas Boone Modified over 9 years ago
1
1 Minimum Cost Flows Goal: Minimize costs to meet all demands in a network subject to capacities (combines elements of both shortest path and max flow problems) Attributes of the directed network G = (V, E): 1.x ij = flow along i to j 2.c ij = cost to send 1 unit of flow through i to j (nonnegative) 3.u ij = capacity along i to j 4.b(i) = net flow at vertex i (>0 => supply; demand; = 0 => transshipment) 5.All demands can be met 6.Total demand = total supply
2
2 Linear Programming Formulation minimize ∑ ∑c ij x ij subject to ∑x ij - ∑ x ji = b(i) for all i V 0 ≤ x ij ≤ u ij for all (i,j) E More generally: allow lower bounds: l ij ≤ x ij ≤ u ij
3
3 Several models of cars are manufactured at various plants and are shipped to retail centers all over the country. Each retail center requests specific numbers of cars of each model. Determine a production plan for each model at each plant and a shipping pattern that satisfies the demands of each retail center and minimizes the overall cost of production and transportation. 4 types of vertices: 1. plant – representing the various plants. 2. plant/model – corresponding to each model at a plant. 3. retailer/model – corresponding to each model needed by a retailer. 4. retailer – representing each retailer. 3 types of edges: 1. production edges (plant-plant/model) with production costs and possible bounds. 2. transportation edges (plant/model-retailer/model) with shipping costs and bounds. 3. demand edges (retailer/model-retailer) with 0 cost but lower bounds corresponding to the demand of the model at that retailer. Example – Distribution Problem
4
4 P11 P12 P1 P2 R1 R2 Example: two plants, three car models, two retailers (plant 1: makes models 1 &2; plant 2 makes models 1, 2, &3; retailer 1 requires 1, 2, &3; retailer 2 requires models 1 &2) P21 P22 P23 R11 R12 R13 R21 R22
5
5 Ford produces cars in Detroit and Dallas. The Detroit plant can produce up to 6500 cars, and the Dallas plant can produce up to 6000 cars. Producing a car costs $2000 in Detroit. Producing a car costs $1800 in Dallas until 5500 cars have been produced, at which time overtime is paid and the car production costs rises to $2100. Cars are shipped to three cities. City 1 must receive 5000 cars, city 2 must receive 4000 cars, and city 3 must receive 3000 cars. However, transportation considerations allow for no more than 1000 cars from Detroit to City 3 and no more than 1500 from Detroit to City 2. The cost of shipping a car from each plant to each city is given below: Example – 1 car model From/toCity 1City 2City 3 Detroit$800$600$300 Dallas$500$200 Formulate a minimal cost network flow problem that can be used to minimize the cost of meeting demand.
6
6 1 Network for Ford 234 All lower bounds are 0. All edges with one number represent total cost with infinite capacity. All edges with two numbers represent (total cost, capacity). Total cost = production cost + transport cost
7
7 Example – Inventory Management A particular material is used in manufacturing a product. An initial inventory of 10 units is on hand. The maximum inventory capacity is 20 units. An inventory of 8 units is requires at the end of the next four month planning period. Costs: 1. unit price of material – currently $6 but is expected to increase by 1 in each of the next several months. 2. unit cost of storage is 0.25 per month. Demands: 1. production demands 12, 19, 15, 20 units of material in the next four months, respectively. 2. early shipment is possible but production has bounds of [14,18]. How much raw material should be purchased in each month to minimize total cost?
8
8 M1 M2 II S Network Representation: all edges have (lower bound, upper bound, unit cost) values of (0, ∞, 0) unless labeled otherwise. M3 M4 P1 P2 P3 P4 R1 R2 R3 R4 FI Initial inventory: 10 Purchase: unlimited MONTHPRODUCTIONREQUIREMENTS Final inventory: -8 -20 -15 -19 -12 14, 18, 0 0, ∞, 7 0, ∞, 8 0, ∞, 9 0, ∞, 6 0, 10, 0 0, 20, 0.25
9
9 Min Cost Example – Finding a Feasible Flow 1 3 2 4 8,6 11,5 7,3 12,53,9 1 9-7 -3 Each vertex has demand/supply. Each edge has (cost, capacity) 1 3 2 4 6 5 3 59 1 9 7 3 s t 1 3 2 4 6 5 1 4 5 1 9 7 3 s t 4 Edges from s and to t are saturated. Feasible flow exists. Feasible flow: X12 = 5 X13 = 4 X24 = 6 X32 = 0 X34 = 1 3
10
10 Min Cost Example – Is it optimal? 1 3 2 4 8,6 11,5 7,3 12,53,9 1 9-7 -3 1 3 2 4 6 5 0 14 1 9-7 -3 Each vertex has demand/supply. Each edge has (cost, capacity) Feasible flow along each edge. Cost of meeting demands for this flow: 11(5)+3(4)+7(0)+8(6)+12(1) =127 Is it optimal? Feasible flow: X12 = 5 X13 = 4 X24 = 6 X32 = 0 X34 = 1
11
11 Residual Networks Use residual network to identify opportunities for readjusting flow. Associated costs on edges indicate the effect on the objective function. For any flow x, the residual network G(x) is defined by: If (i,j) in E and x ij < u ij, then G(x) contains edge (i, j) with cost c ij and residual capacity r ij = u ij – x ij. If (i,j) in E and x ij >0, then G(x) contains edge (j, i) with cost c ji = -c ij and residual capacity r ji = x ij.
12
12 Example 1 3 2 4 8,6 11,5 7,3 12,53,9 1 9-7 -3 1 3 2 4 6 5 0 14 1 9-7 -3 Negative length cycle: 1-3-2-1 Cost: 3 + 7 + (-11) = -1 Most flow through cycle: min{5, 3, 5} = 3 Push 3 units through and update. New objective function value = 127 + 3(-1) = 124 1 3 2 4 3 42 1 9-7 -3 2 7 3 6 1 1 3 2 4 11 123 9-7 -3 -11 -3 -7 -8 -12 1 3 2 4 45 1 9-7 -3 5 4 3 6 1 1 3 2 4 123 9-7 -3 -11 -3 7 -8 -12 1 3 2 4 1 9-7 -3 Flows Cost, Capacity Residual Cost Residual Capacity
13
13 In the previous example, a negative cycle in the residual network G(x) was an indication that the cost of the flow x can be reduced by augmenting along that cycle. Cycle Optimality Conditions The feasible flow x* is optimal iff G(x*) contains no negative cost cycle. Negative Cycle Conditions
14
14 algorithm cycle-canceling; begin find a feasible flow x; while G(x) contains a negative cost cycle do begin W = Find_Cycle(G(x)); δ (W) := min{r ij : (i,j) W}; augment δ (W) units of flow along W; update G(x); end; where Find_Cycle is some algorithm (label-correcting) that detects negative cycles. Cycle-Canceling Algorithm
15
15 Example 1 3 2 4 3,3 2,4 1,2 1,52,2 0 4-4 0 1 3 2 4 3 3 0 11 Negative length cycle: Cycle Cost: Most flow through cycle: min{,, } = Push units through and update. New objective function value = Flows Cost, Capacity Residual Network 1 3 2 4 -3,3 2,1 1,2 -1,1 2,1 -2,3 -2,1 1,4 Cost = 3(2)+1(2)+3(3)+1(1) = 18
16
16 Example 1 3 2 4 3,3 2,4 1,2 1,52,2 0 4-4 0 1 3 2 4 1 3 2 31 Negative length cycle: Cycle Cost: Most flow through cycle: min{,,, } = Push unit through and update. New objective function value = Flows Cost, Capacity Residual Network 1 3 2 4 -3,1 2,1 -1,2 -1,3 2,1 -2,3 -2,1 1,2 Cost = 16 3,2
17
17 Example 1 3 2 4 3,3 2,4 1,2 1,52,2 0 4-4 0 1 3 2 4 0 2 2 42 Negative length cycle: Cycle Cost: Most flow through cycle: New objective function value = Flows Cost, Capacity Residual Network 1 3 2 4 2,2 -1,2 -1,4 -2,2 1,1 Cost = 14 3,3
18
18 First Example – re-examined Negative length cycle: Cost: Most flow through cycle: min{,,, } = Push units through and update. New objective function value = 1 3 2 4 3 42 1 9-7 -3 2 7 3 6 1 1 3 2 4 11 123 9-7 -3 -11 -3 -7 -8 -12 1 3 2 4 6 2 3 17 1 9-7 -3 Residual CostResidual Capacity 1 3 2 4 5 2 1 9-7 -3 9 3 4 3 1 3 2 4 11 12 9-7 -3 -7 -8 -12 2 8 1 1 Negative length cycle: 1 3 2 4 1 9-7 -3
19
19 Other Algorithms Generic Cycle-Canceling not the most efficient algorithm. Choice of cycle can improve upon this (resulting in polynomial-time algorithms): 1. always choose the cycle with maximum possible improvement 2. always choose cycle with minimum mean cost Successive Shortest Path – moves flow along shortest paths from excess vertices to deficit vertices Network Simplex – LP simplex method for networks; use spanning trees to move from basis to basis and negative length cycles to determine entering and leaving variables.
20
20 Facility Location Problem Suppose there are r existing facilities, located at distinct points on the x-y plane. You want to locate p new facilities in a way that will minimize transportation costs between the new facilities and between the new and existing facilities. The transportation costs are directly proportional to the rectilinear distances between the two facilities. i th existing facility located at (u i, v i ) j th new facility located at (x j, y j ) – the decision variables for j = 1, …, p Rectilinear distance between two points (x j, y j ) and (x k, y k ) = |x j -x k |+|y j -y k |. a jk and d ij are cost per unit distance between facilities 1. How to transform this into a linear programming problem? 2. Then, how to transform that into a min cost flow problem?
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.