Presentation is loading. Please wait.

Presentation is loading. Please wait.

MIT and James Orlin © 2003 1 The minimum cost flow problem Note for instructors: this lecture was developed to follow the two lectures that are labeled.

Similar presentations


Presentation on theme: "MIT and James Orlin © 2003 1 The minimum cost flow problem Note for instructors: this lecture was developed to follow the two lectures that are labeled."— Presentation transcript:

1 MIT and James Orlin © 2003 1 The minimum cost flow problem Note for instructors: this lecture was developed to follow the two lectures that are labeled Chapter 8

2 MIT and James Orlin © 2003 2 Network Models Networks 1: Introduction to Networks –Paths, Cycles, Trees –The shortest path problem –Dijkstra’s Algorithm –LP Formulation of Shortest Path Problem node arc incidence matrix Networks 2: CPM and extensions –Arcs as precedence relation –CPM algorithm –LP Formulation of CPM Transpose of Node-Arc Matrix Networks 3: flows on arcs –Large number of diverse applications

3 MIT and James Orlin © 2003 3 Outline of Lecture Shortest Path Problem The shortest path problem is a special case of something known as the minimum cost flow problem We’ll introduce it soon, but first a couple of special cases. A transportation problem. Assignment Problem

4 MIT and James Orlin © 2003 4 Directed and Undirected Networks 2 34 1 a b c d e An Undirected Graph 2 34 1 a b c d e A Directed Graph  The field of Network Optimization concerns optimization problems on networks  Networks are used to transport commodities physical goods (products, liquids) communication electricity, etc.

5 MIT and James Orlin © 2003 5 1 2 3 4 5 6 The constraint matrix is the node arc incidence matrix 1100000001=111000000=1 0 000000=1 0000000=11 000000= 0000000 =x 12 x 13 x 23 x 25 x 24 x 35 x 46 x 54 x 56 The shortest path problem

6 MIT and James Orlin © 2003 6 Applications Physical analog of nodes Physical analog of arcs Flow Communication systems phone exchanges, computers, transmission facilities, satellites Cables, fiber optic links, microwave relay links Voice messages, Data, Video transmissions Hydraulic systems Pumping stations Reservoirs, Lakes Pipelines Water, Gas, Oil, Hydraulic fluids Integrated computer circuits Gates, registers, processors WiresElectrical current Mechanical systemsJoints Rods, Beams, Springs Heat, Energy Transportation systems Intersections, Airports, Rail yards Highways, Airline routes Railbeds Passengers, freight, vehicles, operators Applications of Network Optimization

7 MIT and James Orlin © 2003 7 A Transportation Problem 1 2 3 W 4 5 6 R 6 7 2 4 8 3 0 1 1 0 1 1 1 1 2 3 warehouses: nodes 1, 2, 3 3 retailers: nodes 4, 5, 6 Supplies of goods at the warehouses (6, 7 and 2) : Upper bound on flow Demand for goods at the warehouses (4, 8 and 3) Lower bound on flow Costs on shipping from each warehouse to each retailer Objective: send at most the supply, send at least the demand, and minimize cost. What is the linear program for this transportation problem?

8 MIT and James Orlin © 2003 8 The constraints for the transportation problem 1 2 3 4 5 6 WR 6 7 2 4 8 3 0 1 1 0 1 1 1 1 2 1000=7100010100=4010010010=810100x 26 x 34 x 35 x 36 x 25 x 14 x 15 x 16 x 24 0000=6011101001=3000100111=200000 This graph is “bipartite.” That is, the nodes are partitioned into two parts and arcs have one endpoint in each part.

9 MIT and James Orlin © 2003 9 The constraint matrix is a node-arc incidence matrix in disguise 1 2 3 4 5 6 WR 6 7 2 4 8 3 0 1 1 0 1 1 1 1 2 1000=7100010100=4010010010=810100x 26 x 34 x 35 x 36 x 25 x 14 x 15 x 16 x 24 0000=6011101001=3000100111=200000 Multiply the constraints for nodes 4, 5, 6 by -1 000=-4000 00 0=-80 00 00 =-30000 The matrix becomes a node-arc incidence matrix

10 MIT and James Orlin © 2003 10 Features of this transportation problem The constraint matrix is (or can be made to be) the node arc incidence matrix of the network If supplies/demands are integral, then the flows are also integral. If the total supply is equal to the total demand, then all supply and demand constraints hold with equality Very efficient special purpose solution techniques exist Applications to shipment of goods Transportation Problem

11 MIT and James Orlin © 2003 11 On the integrality Property The fact that solutions to the transportation problem are integral is an amazing property. In general, solutions to IP are fractional. Consider x + y = 1, x – y = 0. Unique solution (.5,.5) But solutions to this transportation problem are integral. In general, if there is at most one 1 and at most one –1 in any column of the constraint matrix, then every basic feasible solution is integer (so long as RHS is integral.) For many applications, we want to restrict variables to be integer valued. Transportation Problem

12 MIT and James Orlin © 2003 12 A special case: supplies and demands are all 1. 1 1 1 1 2 3 4 5 6 WR 1 1 1 0 1 1 0 1 1 1 1 2 Note the special structure of the integral solutions. WR 1 14 1 1 There will be three arcs with 1 unit of flow. 2 6 1 1 1 3 5 1 1 1 A solution may be viewed as an “Assignment”

13 MIT and James Orlin © 2003 13 A special case: supplies and demands are all 1. 1 2 3 4 5 6 WR 1 1 1 1 1 1 0 1 1 0 1 1 1 1 2 WR 1 14 1 1 Every feasible integral solution has three arcs with a flow of 1. And the LP produces integral solutions. 2 1 1 5 1 6 1 3 1 1 Each node on the left is “assigned” to a node on the right

14 MIT and James Orlin © 2003 14 The Assignment Problem 1 2 3 P 4 5 6 T 1 1 1 1 1 1 1 0 1 1 0 1 1 1 2 Formulate this as an Integer Program. (Require all variables to be integer). 3 persons: nodes 1, 2, 3 3 tasks: nodes 4, 5, 6 Each person must be assigned to a task Each task has a person assigned Utility of assigning a person to a task Objective: meet constraints while maximizing total utility Assignment Problem

15 MIT and James Orlin © 2003 15 Assignment Problem Suppose that n persons (labeled 1 to n) are assigned to n tasks (also labeled 1 to n) Let x ij = 1 if person i is assigned to task j Let x ij = 0 if person i is not assigned to task j Let u ij be the utility of assigning person i to task j Formulate the assignment problem

16 MIT and James Orlin © 2003 16 The Assignment Problem In general the LP formulation is given as Minimize Each supply is 1 Each demand is 1

17 MIT and James Orlin © 2003 17 The Transportation Problem In general the LP formulation is given as Minimize S: Supply nodes D: Demand nodes All arcs are from a node in S to a node in D, and uncapacitated.

18 MIT and James Orlin © 2003 18 Comments on the Assignment Problem The Air Force has used this for assigning thousands of people to jobs. This is a classical problem. Research on the assignment problem predates research on LPs. Very efficient special purpose solution techniques exist. –10 years ago, Yusin Lee and J. Orlin solved a problem with 2 million nodes and 40 million arcs in ½ hour.

19 MIT and James Orlin © 2003 19 Some More on the Assignment Problem There are 6! different assignments. There are n! different assignments in an n x n assignment problem. 17 28 39 410 511 612 There are n! different assignments in an n x n assignment problem. Diverse applications.

20 MIT and James Orlin © 2003 20 An Application of the Assignment Problem Suppose that there are moving targets in space. You can identify each target as a pixel on a radar screen. Given two successive pictures, identify how the targets have moved. This may be the most efficient way of tracking items.

21 MIT and James Orlin © 2003 21 The minimum cost flow problem Assignment problem, transportation problem, and the shortest path problem. –All are efficiently solvable –All have constraint matrices that are the node-arc incidence matrix (or are equivalent) –All have integer value solutions when solved by simplex We next consider the minimum cost flow problem –includes assignment, transportation, and shortest path as special cases –Has a constraint matrix that is the node arc incidence matrix –Has integer valued solutions when solved by simplex

22 MIT and James Orlin © 2003 22 The Minimum Cost Flow Problem 1 2 3 4 -$3, $8,$7, $3, $2, 3 4 -5 -2 A network with costs, capacities, supplies, demands Supply/demand b i for node i. e.g. b 1 = 4 (supply) b 3 = -5 (demand) Network G = (N, A) Node set N = {1, 2, 3, 4} Arc set A = {(1,2), (1,3), (2,3), (2,4), (3,4)} Capacities u ij on arc (i,j) e.g., u 12 = 6 Cost c ij on arc (i,j) e.g., c 12 = $3 6 52 4 7 Send flow in each arc Satisfy “supply/demand” constraints” Satisfy flow bound constraints Minimize cost

23 MIT and James Orlin © 2003 23 The Minimum Cost Flow Problem 1 2 3 4 -$3, $8,$7, $3, $2, 3 4 -5 -2 A network with costs, capacities, supplies, demands 6 52 4 7 Min z = the cost of sending flow s.t. Flow out of i - Flow into i = b i for each i 0  x ij  u ij for all arcs (i,j) in A Let x ij be the flow on arc (i,j).

24 MIT and James Orlin © 2003 24 The constraint matrix is the node arc incidence matrix 0  x 12  6, 0  x 13  5, 0  x 23  2, 0  x 24  4, 0  x 34  7, Supply/Demand constraints Lower and upper bounds on variables The LP Formulation 11000=400110=300 01=-50000 =-20x 12 x 13 x 23 x 24 x 34 -z -38732=01 1 2 3 4 -$3, $8,$7, $3, $2, 3 4 -5 -2 6 52 4 7

25 MIT and James Orlin © 2003 25 On Network Flow Problems If the constraint matrix is a node-arc incidence matrix, then the LP is a network flow problem. ** The solution values are all integer valued. ** Upper bound constraints on variables may be treated similarly to lower bound constraints, and are not viewed as part of the constraint matrix.

26 MIT and James Orlin © 2003 26 The Minimum Cost Flow Problem Let x ij be the flow on arc (i,j). Minimize the cost of sending flow s.t. Flow out of i - Flow into i = b i 0  x ij  u ij 0  x ij  u ij for all (i,j) Minimize s.t.

27 MIT and James Orlin © 2003 27 Some Information on the Min Cost Flow Problem Reference text: Network Flows: Theory, Algorithms, and Applications by Ahuja, Magnanti, and Orlin This is one of the few problems for which there is a provably efficient implementation of the simplex algorithm (Orlin [1997]) Basic feasible solutions of a minimum cost flow problem are integer valued (assuming that the data is integer valued) Very efficient solution techniques in practice 15.082J/6.885J: Network Optimization

28 MIT and James Orlin © 2003 28 Baseball Elimination Problem BosChiAtl.Den. Bos Chi Atl. Den. --171 1 03 70 1 1310 Bos Chi Atl. Denver 82 79 77 76 Games Won Games Left 9 4 8 5 Has Chicago already been eliminated from winning in this hypothetical season finale? Has Atlanta? http://riot.ieor.berkeley.edu/~basket/

29 MIT and James Orlin © 2003 29 Modeling as an optimization problem BosChiAtl.Den. Bos Chi Atl. Den. --171 1 03 70 1 1310 x AB = number of wins by Atlanta over Boston x AD = number of wins by Atlanta over Denver x BC = … x BD = … x CD = … 7- x AB = number of wins by Boston over Atlanta 1- x AD = number of wins by Denver over Atlanta 7 7 1 1

30 MIT and James Orlin © 2003 30 Determining whether Chicago can win the championship, assuming Chicago wins all of its games, and thus has 83 wins. ABADBD.RHSBos7-x AB ++x BD  1Chi-- Atl.x AB +x AD  6Den. 1-x AD +1 - x BD  7 Bos Chi Atl. Denver 82 79 77 76 Games Won Games Left 9 4 8 5 8 0 6 7 and also upper and lower bound constraints.

31 MIT and James Orlin © 2003 31 The constraint matrix is a node-arc incidence matrix ABADBD Bos Atl. Den. 7-x AB ++x BD x AB +x AD 1-x AD +1 - x BD.    RHS 1 6 7 x AB x AD x BD.RHSBos0+1  -6Atl.110  6Den.0  5 The baseball elimination problem is a minimum cost flow problem in disguise.

32 Another Application of the Minimum Cost Flow Problem Customers 6 7 400 180 Demands 200 300 100 Supplies Ship from suppliers to customers, possibly through warehouses, at minimum cost to meet demands. Plants 2222 3333 1111 1 Warehouses 5 4

33 MIT and James Orlin © 2003 33 Matrix Fill In ???1 1??? ?251 13?? 51?1 2 1 ? 1 ? Is it possible to fill in the missing data with non-negative integers and have the row sums and column sums as specified? If so, how large or small can be the element in position 2,3? 16 11 20 6 16 Row sums 191317713 Column sums How is this a transportation problem? ?

34 MIT and James Orlin © 2003 34 Matrix Fill In 1913177 16 13 20 6 ???1 1??? ?251 13?? 1651?1 13 2 1 ? 1 ? RowsColumns 13 11 12 1 9 7 49 1 1 251 13 511 2 1 1 9 Determine the row and column sums for unknown entries. Formulate a transportation problem entry in (i,j) is “flow” Minimize entry (2,3) 13 9 12 9 1 7 9 4 1 2 3 4 5 1 2 3 4 5 Transportation Problem

35 MIT and James Orlin © 2003 35 Conclusions. Advantages of the transportation problem and the minimum cost flow problem –Integer solutions –Very fast solution methods –Extremely common in modeling

36 MIT and James Orlin © 2003 36 Multicommodity Flows: a brief glimpse at an important problem 1 2 3 4 5 6 3355 $5, 4 $2, 4 $6, 4 $0, 8 Send 6 units of commodity 1 from node 1 to node 4. The costs and capacities are given. What is the minimum cost multicommodity flow? Send 3 units of commodity 2 from node 3 to node 6. Two minimum cost flows on a shared network

37 MIT and James Orlin © 2003 37 Multicommodity Flows 1 2 3 4 5 6 33 66 $5, 4 $2, 4 $6, 4 $0, 8 Send 5 units of commodity 1 from node 1 to node 4. Send 3 units of commodity 2 from node 3 to node 6. 4 2 1 2 The shared arc capacities make the problem much more complex. Optimum flows may be fractional.

38 MIT and James Orlin © 2003 38 Multicommodity flow Problems can be large Consider a communication network with 1000 nodes, and 10,000 arcs. Suppose each node wants to send a different message to each other node. 1,000,000 messages. 1,000,000 commodities 10 billion variables. (10,000 variables per commodity)

39 MIT and James Orlin © 2003 39 Multicommodity Flow Problems are important in practice Manufacturing Networks Road and Rail Transportation Networks Air Transportation Networks Communication Networks

40 MIT and James Orlin © 2003 40 Final comments on multicommodity flows We mention them because they are important extensions of the minimum cost flow problem Much harder to solve in practice Lots of applications Lots of Research at MIT –Cynthia Barnhart –Jim Orlin

41 MIT and James Orlin © 2003 41 Summary Minimum Cost Flows –shortest paths –transportation problem –assignment problem –plus more –important subproblem of many optimization problems, including multicommodity flows


Download ppt "MIT and James Orlin © 2003 1 The minimum cost flow problem Note for instructors: this lecture was developed to follow the two lectures that are labeled."

Similar presentations


Ads by Google