The minimum cost flow problem

Slides:



Advertisements
Similar presentations
Thursday, March 14 Introduction to Network Flows
Advertisements

Outline LP formulation of minimal cost flow problem
1 Lecture 2 Shortest-Path Problems Assignment Problems Transportation Problems.
Introduction to Algorithms
Management Science 461 Lecture 6 – Network Flow Problems October 21, 2008.
Computational Methods for Management and Economics Carla Gomes Module 8a The transportation model.
MIT and James Orlin © Networks II Quick Review of Shortest Path Problem The Critical Path Method (CPM) Topological Sort.
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
MIT and James Orlin © Introduction to Networks Eulerian Tours Hamiltonian Tours The Shortest Path Problem Dijkstra’s Algorithm for Solving the Shortest.
Computational Methods for Management and Economics Carla Gomes Module 9a Network Models Terminology (Slides adapted from J.Orlin’s)
Network Optimization Models: Maximum Flow Problems In this handout: The problem statement Solving by linear programming Augmenting path algorithm.
Computer Algorithms Integer Programming ECE 665 Professor Maciej Ciesielski By DFG.
Chapter 7 Transportation, Assignment & Transshipment Problems Part 1 ISE204/IE252 Prof. Dr. Arslan M. ÖRNEK.
Princeton University COS 423 Theory of Algorithms Spring 2002 Kevin Wayne Greed: Shortest Path s 3 t
1 Discrete Optimization. 2 The relationship between counting techniques/graph theory and discrete optimization Adding a goal (objective function) to a.
Max-flow/min-cut theorem Theorem: For each network with one source and one sink, the maximum flow from the source to the destination is equal to the minimal.
1 Lecture 4 Maximal Flow Problems Set Covering Problems.
15.082J and 6.855J and ESD.78J November 2, 2010 Network Flow Duality and Applications of Network Flows.
15.082J, 6.855J, and ESD.78J September 21, 2010 Eulerian Walks Flow Decomposition and Transformations.
Graph Theory Chapter 6 from Johnsonbaugh Article(6.1, 6.2)
Table 1. Shipping costs, Supply, and Demand for Powerco Example
Lecture 3 Transshipment Problems Minimum Cost Flow Problems
Algorithms CISC 4080/CISC 5825 Linear Programming, Simplex Method and Duality Theory Dr Kamesam Graduate School Of Business Fordham University.
Maximum Flow Chapter 26.
Network Optimization Models
15.082J and 6.855J and ESD.78J November 30, 2010 The Multicommodity Flow Problem.
1 ESI 6417 Linear Programming and Network Optimization Fall 2003 Ravindra K. Ahuja 370 Weil Hall, Dept. of ISE
Network Models Tran Van Hoai Faculty of Computer Science & Engineering HCMC University of Technology Tran Van Hoai.
Modeling and Evaluation with Graph Mohammad Khalily Dermany Islamic Azad University, Khomein branch.
Minimum Cost Flows. 2 The Minimum Cost Flow Problem u ij = capacity of arc (i,j). c ij = unit cost of shipping flow from node i to node j on (i,j). x.
Quantitative Methods Linear Programming. Definitions Linear Programming is one of the important Techniques of OR It is useful in solving decision making.
Chapter 1 Introduction Introduction  Networks: mathematical models of real systems like electrical and power/ telecom/ logistics/ highway/ rail/
. 1 Transportation and Assignment Problems. . 2 Applications Physical analog of nodes Physical analog of arcs Flow Communication systems phone exchanges,
15.082J and 6.855J and ESD.78J Lagrangian Relaxation 2 Applications Algorithms Theory.
Hub Location Problems Chapter 12
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
Graphs Discrete Structure CS203. Adjacency Matrix We already saw a way of representing relations on a set with a Boolean matrix: R digraph(R) M R1234.
1 Network Models Transportation Problem (TP) Distributing any commodity from any group of supply centers, called sources, to any group of receiving.
Maximum Flow Problem (Thanks to Jim Orlin & MIT OCW)
Network Optimization Network optimization models: Special cases of linear programming models Important to identify problems that can be modeled as networks.
Lecture 5 – Integration of Network Flow Programming Models Topics Min-cost flow problem (general model) Mathematical formulation and problem characteristics.
Overview of Graph Theory. Some applications of Graph Theory Models for communications and electrical networks Models for computer architectures Network.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
8/14/04J. Bard and J. W. Barnes Operations Research Models and Methods Copyright All rights reserved Lecture 5 – Integration of Network Flow Programming.
Flow in Network. Graph, oriented graph, network A graph G =(V, E) is specified by a non empty set of nodes V and a set of edges E such that each edge.
Chapter 8 Network Models to accompany Operations Research: Applications and Algorithms 4th edition by Wayne L. Winston Copyright (c) 2004 Brooks/Cole,
8/14/04 J. Bard and J. W. Barnes Operations Research Models and Methods Copyright All rights reserved Lecture 6 – Integer Programming Models Topics.
Shortest Path Algorithm 2 Prof. Sin-Min Lee Department of Computer Science.
Lecture 6 – Integer Programming Models Topics General model Logic constraint Defining decision variables Continuous vs. integral solution Applications:
1 Chapter 2 Notation and Definitions Data Structures Transformations.
CSCE 3110 Data Structures & Algorithm Analysis Graphs (I) Reading: Chap.9, Weiss.
Introduction to Integer Programming Integer programming models Thursday, April 4 Handouts: Lecture Notes.
Tuesday, March 19 The Network Simplex Method for Solving the Minimum Cost Flow Problem Handouts: Lecture Notes Warning: there is a lot to the network.
::Network Optimization:: Minimum Spanning Trees and Clustering Taufik Djatna, Dr.Eng. 1.
Minimum Cost Flow Algorithms and Networks. Algorithms and Networks: Minimum Cost Flow2 This lecture The minimum cost flow problem: statement and applications.
Maximum Flow Chapter 26.
The minimum cost flow problem
The assignment problem
Lecture 5 – Integration of Network Flow Programming Models
Max Flow – Min Cut Problem
Lecture 5 – Integration of Network Flow Programming Models
1.3 Modeling with exponentially many constr.
1.206J/16.77J/ESD.215J Airline Schedule Planning
Routing and Logistics with TransCAD
Introduction Basic formulations Applications
1.3 Modeling with exponentially many constr.
Chapter 5 Transportation, Assignment, and Transshipment Problems
Flow Feasibility Problems
INTRODUCTION TO NETWORK FLOWS
Lecture 12 Network Models.
Presentation transcript:

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

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 MIT and James Orlin © 2003

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 MIT and James Orlin © 2003

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

The shortest path problem 1 2 3 4 5 6 The shortest path problem x12 x13 x23 x25 x24 x35 x46 x54 x56 1 = 1 -1 = 1 -1 = 1 -1 = 1 -1 = -1 = The constraint matrix is the node arc incidence matrix MIT and James Orlin © 2003

Applications of Network Optimization 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 Wires Electrical current Mechanical systems Joints Rods, Beams, Springs Heat, Energy Transportation systems Intersections, Airports, Rail yards Highways, Airline routes Railbeds Passengers, freight, vehicles, operators MIT and James Orlin © 2003

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

The constraints for the transportation problem 1 2 3 4 5 6 W R 7 8 x26 x34 x35 x36 x25 x14 x15 x16 x24 = 6 1 1 = 7 1 = 2 1 = 4 1 = 8 1 = 3 This graph is “bipartite.” That is, the nodes are partitioned into two parts and arcs have one endpoint in each part. MIT and James Orlin © 2003

The constraint matrix is a node-arc incidence matrix in disguise 1 2 3 4 5 6 W R 7 8 x26 x34 x35 x36 x25 x14 x15 x16 x24 = 6 1 1 = 7 1 = 2 1 = 4 -1 = -4 1 = 8 -1 = -8 1 = 3 -1 = -3 Multiply the constraints for nodes 4, 5, 6 by -1 The matrix becomes a node-arc incidence matrix MIT and James Orlin © 2003

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 MIT and James Orlin © 2003

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 MIT and James Orlin © 2003

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

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

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

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

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

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

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. MIT and James Orlin © 2003

Some More on the Assignment Problem 1 7 2 8 3 9 4 10 5 11 6 12 There are 6! different assignments. There are n! different assignments in an n x n assignment problem. There are n! different assignments in an n x n assignment problem. Diverse applications. MIT and James Orlin © 2003

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. MIT and James Orlin © 2003

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 MIT and James Orlin © 2003

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

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

Supply/Demand constraints -1 1 = 3 2 3 4 -$3, $8, $7, $3, $2, -5 -2 6 5 7 The LP Formulation x12 x13 x23 x24 x34 -z -3 8 7 3 2 = 1 1 = 4 Supply/Demand constraints -1 1 = 3 -1 1 = -5 -1 = -2 0  x12  6, 0  x13  5, 0  x23  2, 0  x24  4, 0  x34  7, Lower and upper bounds on variables The constraint matrix is the node arc incidence matrix MIT and James Orlin © 2003

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. MIT and James Orlin © 2003

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

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 MIT and James Orlin © 2003

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

Modeling as an optimization problem xAB = number of wins by Atlanta over Boston 7- xAB = number of wins by Boston over Atlanta xAD = number of wins by Atlanta over Denver 1- xAD = number of wins by Denver over Atlanta xBC = … xBD = … xCD = … Bos Chi Atl. Den. -- 1 7 3 7 1 MIT and James Orlin © 2003

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

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

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

Matrix Fill In 16 11 20 6 Row sums ? 1 2 5 3 ? 19 13 17 7 Column sums 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? How is this a transportation problem? MIT and James Orlin © 2003

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

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

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

Multicommodity Flows $5, 4 6 1 4 6 $0, 8 $0, 8 $2, 4 2 5 $0, 8 $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 $5, 4 6 1 4 6 2 $0, 8 $0, 8 $2, 4 2 5 2 $0, 8 $0, 8 $6, 4 3 6 3 3 1 The shared arc capacities make the problem much more complex. Optimum flows may be fractional. MIT and James Orlin © 2003

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) MIT and James Orlin © 2003

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

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 MIT and James Orlin © 2003

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