Lecture 4 – Network Flow Programming

Slides:



Advertisements
Similar presentations
Outline LP formulation of minimal cost flow problem
Advertisements

1 Material to Cover  relationship between different types of models  incorrect to round real to integer variables  logical relationship: site selection.
1 Lecture 2 Shortest-Path Problems Assignment Problems Transportation Problems.
BU BU Decision Models Networks 1 Networks Models Summer 2013.
Network Flows. 2 Ardavan Asef-Vaziri June-2013Transportation Problem and Related Topics Table of Contents Chapter 6 (Network Optimization Problems) Minimum-Cost.
Transportation Problem (TP) and Assignment Problem (AP)
1 1 Slides by John Loucks St. Edward’s University Modifications by A. Asef-Vaziri.
1 1 Slide © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole.
Introduction to Algorithms
1 Network Models Chapter Introduction A network problem is one that can be represented by... Nodes Arcs Function on Arcs.
1Transportation ModelsLesson 4 LECTURE FOUR Transportation Models.
MS&E 211, Lecture 11 The dual of Min-Cost Flow Ashish Goel.
Chapter 6 Maximum Flow Problems Flows and Cuts Augmenting Path Algorithm.
Basic Feasible Solutions: Recap MS&E 211. WILL FOLLOW A CELEBRATED INTELLECTUAL TEACHING TRADITION.
1 1 Slide © 2006 Thomson South-Western. All Rights Reserved. Slides prepared by JOHN LOUCKS St. Edward’s University.
1 Maximum Flow Networks Suppose G = (V, E) is a directed network. Each edge (i,j) in E has an associated ‘capacity’ u ij. Goal: Determine the maximum amount.
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.
Linear Programming Applications
Chapter 7 Transportation, Assignment & Transshipment Problems Part 1 ISE204/IE252 Prof. Dr. Arslan M. ÖRNEK.
1 Ford-Fulkerson method Ford-Fulkerson(G) f = 0 while( 9 simple path p from s to t in G f ) f := f + f p output f Runs in time O(|f max | |E|) where f.
1 The Min Cost Flow Problem. 2 The Min Cost Flow problem We want to talk about multi-source, multi-sink flows than just “flows from s to t”. We want to.
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.
Two Discrete Optimization Problems Problem: The Transportation Problem.
Table 1. Shipping costs, Supply, and Demand for Powerco Example
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
1 1 Slide © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole.
Network Flow Programming Models
Chapter 5 Network Models. Thomson/South-Western 2007 © South-Western/Cengage Learning © 2012 Practical Management Science, 4e Winston/Albright Introduction.
Network Models (2) Tran Van Hoai Faculty of Computer Science & Engineering HCMC University of Technology Tran Van Hoai.
ENGM 732 Network Flow Programming Network Flow Models.
Section 2.9 Maximum Flow Problems Minimum Cost Network Flows Shortest Path Problems.
Modeling and Evaluation with Graph Mohammad Khalily Dermany Islamic Azad University, Khomein branch.
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.
Chapter 7 Transportation, Assignment & Transshipment Problems
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.
Chapter 7 Transportation, Assignment, and Transshipment Problems
EMIS 8373: Integer Programming “Easy” Integer Programming Problems: Network Flow Problems updated 11 February 2007.
Network Optimization Problems
1 1 Slide © 2009 South-Western, a part of Cengage Learning Slides by John Loucks St. Edward’s University.
DISTRIBUTION AND NETWORK MODELS (1/2)
1 1 © 2003 Thomson  /South-Western Slide Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
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)
EMIS 8374 Network Flow Models updated 29 January 2008.
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.
15.082J and 6.855J March 4, 2003 Introduction to Maximum Flows.
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved Slides by JOHN LOUCKS St. Edward’s University.
8/14/04J. Bard and J. W. Barnes Operations Research Models and Methods Copyright All rights reserved Lecture 5 – Integration of Network Flow Programming.
Network Flow Problems Example of Network Flow problems:
Chapter 8 Network Models to accompany Operations Research: Applications and Algorithms 4th edition by Wayne L. Winston Copyright (c) 2004 Brooks/Cole,
1 1 Slide © 2008 Thomson South-Western. All Rights Reserved © 2011 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or.
Problems in Combinatorial Optimization. Linear Programming.
Lecture 4 – Network Flow Programming Topics Terminology and Notation Network diagrams Generic problems (TP, AP, SPP, STP, MF) LP formulations Finding solutions.
1 Maximum Flows CONTENTS Introduction to Maximum Flows (Section 6.1) Introduction to Minimum Cuts (Section 6.1) Applications of Maximum Flows (Section.
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.
Lecture 5 – Integration of Network Flow Programming Models
Lecture 5 – Integration of Network Flow Programming Models
Routing and Logistics with TransCAD
Transportation, Assignment and Network Models
Chapter 7 Transportation, Assignment & Transshipment Problems
Introduction Basic formulations Applications
TRLabs & University of Alberta © Wayne D. Grover 2002, 2003, 2004
Flow Feasibility Problems
Lecture 12 Network Models.
Presentation transcript:

Lecture 4 – Network Flow Programming Topics Terminology and Notation Network diagrams Generic problems (TP, AP, SPP, STP, MF) LP formulations Finding solutions with Excel add-in

Network Optimization Network flow programming (NFP) is a special case of linear programming Important to identify problems that can be modeled as networks because: Network representations make optimization models easier to visualize and explain Very efficient algorithms are available

Example of (Distribution) Network

Terminology Nodes and arcs Arc flow (variables) Upper and lower bounds Cost Gains (and losses) External flow (supply an demand) Optimal flow

Network Flow Problems

Transportation Problem We wish to ship goods (a single commodity) from m warehouses to n destinations at minimum cost. Warehouse i has si units available i = 1,…,m and destination j has a demand of dj, j = 1,…,n . Goal: Ship the goods from warehouses to destinations at minimum cost. Example: Warehouse Supply Markets Demand San Francisco 350 New York 325 Los Angeles 600 Chicago 300 Austin 275 Unit Shipping Costs From/To NY SF 2.5 1.7 1.8 LA -- 1.4

The min-cost flow network for this transportation problem is given by (2.5) NY [-325] (1.7) [350] SF (0) DUM [-50] (1.8) CHI [-300] (M) (1.8) AUS (1.4) [-275] [600] LA Total supply = 950, total demand = 900 Transportation problem is defined on a bipartite network Arcs only go from supply nodes to destination nodes; to handle excess supply we can create a dummy destination with a demand of 50 and 0 shipment cost

Modeling Issues · Costs on arcs to dummy destination = 0 (In some settings it would be necessary to include a nonzero warehousing cost.) · The objective coefficient on the LA ® NY arc is M. This denotes a large value and effectively prohibits use of this arc (could eliminate arc). · We are assured of integer solutions because technological matrix A is totally unimodular. (important in some applications) · Decision variables: xij = amount shipped from warehouse i to destination j

å å å å The LP formulation of the transportation problem with m sources and n destinations is given by: m n å å Min cijxij i =1 j =1 n å s.t. xij  si , i = 1,…,m (no dummy node) j =1 m å xij = dj , j = 1,…,n i =1 0  xij  uij , i = 1,…,m, j = 1,…,n

Solution to Transportation Problem

Assignment Problem Special case of transportation problem: • same number of sources and destinations • all supplies and demands = 1 Example 4 ships to transport 4 loads from single port to 4 separate ports; Each ship will carry exactly 1 load; Associated shipping costs as shown. Port/load 1 2 3 4 1 5 4 6 7 2 6 6 7 5 Ship 3 7 5 7 6 4 5 4 6 6

{ 1, if ship i goes to port j 0, otherwise Problem: Find a one-to-one matching between ships and ports in such a way as to minimize the total shipping cost. (5) [1] 1 (4) 1 [-1] (6) (7) (6) (6) [1] 2 2 [-1] (7) (5) (7) (5) [1] 3 (7) 3 [-1] (6) (5) (4) (6) [1] 4 4 [-1] (6) { 1, if ship i goes to port j 0, otherwise Decision variables are xij =

Characteristics of Assignment Problem Note that from a feasibility perspective it could be possible to have x11 = x12 = x13 = x14 = ¼. But we know that a pure network flow problem guarantees that the simplex method will yield an integer solution. In this case we know that each xij will either take on 0 or 1. If a particular ship cannot carry a particular load then we can use M as in the transportation problem. Other types of assignments: a. workers to jobs b. tasks to machines c. swimmers to events (in a relay) d. students to internships

Shortest Path Problem Given a network with “distances” on the arcs, our goal is to find the shortest path from the origin to the destination. These distances might be length, time, cost, etc, and the values can be positive or negative. (A negative cij can arise if we earn revenue by traversing an arc.) The shortest path problem may be formulated as a special case of the pure min-cost flow problem.

Example (cij) = cost/length (2) 2 4 (4) (3) (1) (2) (1) [1] [-1] 1 6 (6) (7) (2) 3 5 We wish to find the shortest path from node 1 to node 6. To do so we place one unit of supply at node 1 and push it through the network to node 6 where there is one unit of demand. All other nodes in the network have external flows of zero.  SP Tree Solution

Shortest Path Problem Solution x * * = 1, x * = 1, x * = 1, x = 0 for all other arcs 12 24 46 ij Total length (objective value) = 9

Network Notation A = set of Arcs, N = set of nodes Forward Star for node i : FS(i ) = { (i, j ) : (i, j ) Î A } Reverse Star for node i : RS(i ) = { (j,i ) : (j,i ) Î A } FS(i ) RS(i ) i i

{ Shortest Path Model å å å In general, if node s is the source node and node t is the termination node then the shortest path problem may be written as follows. å Min cijxij (i, j )ÎA { 1, i = s –1, i = t 0, i Î N \ {s, t} å å s .t. xij - xji = (i, j )ÎFS(i ) (j, i )ÎRS(i ) xij ³ 0, " (i, j ) Î A

General Solution to Shortest Path Problem { 1, if (i,j) is on the shortest path 0, otherwise In general, x* = ij As in the assignment problem, the integer nature of the solution is key to this shortest path formulation. Examples of shortest path problems: a. airline scheduling b. equipment replacement c. routing in telecommunications networks d. reliability problems e. traffic routing

Shortest Path Tree Problem It is sometimes useful to find the shortest path from node s to all other m - 1 nodes in the network. We could do this by solving a collection of shortest path problems, but it is simpler to use a single min-cost flow formulation: å cijxij Min (i,j )ÎA { m – 1, i = s –1, i Î N \ {s} å xij - s.t. å xji = (i, j )ÎFS(i ) (j, i )ÎRS(i ) xij ³ 0, " (i, j ) Î A where m = |N| = number of nodes

In our example, the shortest path tree is 4 (2) 6 2 4 (4) (3) (1) 9 1 6 (6) 3 5 6 5 Each node is labeled with its shortest-path distance to node 1.

Application: Network Reliability Consider a communications network in which the probability that arc (i, j ) is “up” is pij. If the arcs fail independently then the probability that all arcs on a path from the origin s to the termination node t are “up” is the product of the individual arc probabilities. Routing a message/call from origin to destination so that the probability it arrives is maximized is equivalent to picking P from the set Path so that we have: where “Path ” is the set of feasible paths through the network.

Equivalent Formulation We can turn a “Max” into a “Min” via Now we must introduce network variables xij and constraints.

Another Application: Knapsack Problem A hiker must choose among n items to place in a knapsack for a trip. Each item has a weight of wi (in pounds) and value of vi. The goal is to maximize the total value of the items in the knapsack subject to the total weight of the knapsack not exceeding W pounds. Problem can be formulated as a shortest (or longest) path problem. Example: i 1 2 3 4 . vi 40 15 20 10 Four items with their weights and values wi 4 2 3 1

Network for Knapsack Example Our knapsack has a weight limit of W = 6 Stage 0 Stage 1 Stage 2 Stage 3 Stage 4 Stage 5

Notation for Knapsack Network The nodes have the form (stage, state) where stage corresponds to the item # just selected or rejected (except for artificial stages s and t ) state corresponds to the weight capacity consumed so far. We solve the knapsack problem by finding the longest path from s to t. (This can be converted into a shortest path problem by multiplying all costs by –1). This is an example of a dynamic programming problem.

Maximum Flow Problem In the maximum flow problem our goal is to send the largest amount of flow possible from a specified origin node to a specified destination node subject to arc capacities. This is a pure network flow problem (i.e., gij = 1) in which all the (real) arc costs are zero (cij = 0) and at least some of the arc capacities are finite. Example (2) 2 4 (4) (3) (uij) = arc capacity (1) (1) (2) 6 1 (6) (2) (7) 3 5  Max-cut

Max Flow Example Our goal is to send as much flow as possible from node 1 to node 6. (This is the same network we used in the shortest path discussion but now the arc labels represent capacities not costs.) Solution [2] (2) [3] (4) [2] (3) 2 4 [xij] (uij) flow capacity [1] (1) [0] (1) 6 1 [0] (2) [5] (¥) [2] (6) [3] (7) 3 5 [2] (2) Maximum flow = 5 MF Excel Solution 

Max Flow Problem Formulation There are several different linear programming formulations. The one we will use is based on the idea of a “circulation.” We suppose an artificial return arc from the destination to the origin with uts = +¥ and cts = 1. External flows (supplies and demands) are zero at all nodes. s t

Max Flow LP Model Max xts å xij å xji = 0, " i Î N - " (i,j ) Î A s.t. - (i,j )ÎFS(i ) (j,i )ÎRS(i ) 0 £ xij £ uij " (i,j ) Î A where xts is the flow on the circulation arc (t,s).

Examples of cuts in the network above are: Min-Cut Problem Cut: A partition of the nodes into two sets S and T. The origin node must be in S and the destination node must be in T. Examples of cuts in the network above are: S1 = {1} T1 = {2,3,4,5,6} S2 = {1,2,3} T2 = {4,5,6} S3 = {1,3,5} T3 = {2,4,6} The value of a cut V(S,T) is the sum of all the arc capacities that have their tails in S and their heads in T. V(S2,T2) = 5 V(S1,T1) = 10 V(S3,T3) = 14

Max-Flow Min-Cut Theorem The value of the maximum flow = value of the minimum cut. In our problem, S = {1,2,3} / T = {4,5,6} is a minimum cut. The arcs that go from S to T are (2,4), (2,5) and (3,5). Note that the flow on each of these arcs is at its capacity. As such, they may be viewed as the bottlenecks of the system.

Identifying the Min Cut Identify minimum cut from sensitivity report: If the reduced cost for xij has value 1 then arc (i,j ) has its tail (i ) in S and its head (j ) in T. Reduced costs are the shadow prices on the simple bound constraint xij £ uij. Value of another unit of capacity is 1 or 0 depending on whether or not the arc is part of the bottleneck Note that the sum of the arc capacities with reduced costs of 1 equals the max flow value.

Max Flow Problem Solution  MF Example

Sensitivity Report for Max Flow Problem Adjustable Cells Final Reduced Objective Allowable Allowable Cell Name Value Cost Coefficient Increase Decrease $E$9 Arc1 Flow 3 1E+30 $E$10 Arc2 Flow 2 1 $E$11 Arc3 Flow 1E+30 $E$12 Arc4 Flow 2 1 1E+30 1 $E$13 Arc5 Flow 1 1 1E+30 1 $E$14 Arc6 Flow 2 1 1E+30 1 $E$15 Arc7 Flow 1E+30 $E$16 Arc8 Flow 2 1 $E$17 Arc9 Flow 3 1E+30 $E$18 Arc10 Flow 5 1 1E+30 1 Constraints Final Shadow Constraint Allowable Allowable Cell Name Value Price R.H. Side Increase Decrease $N$9 Node1 Balance 3 $N$10 Node2 Balance 1E+30 $N$11 Node3 Balance 3 $N$12 Node4 Balance 1 2 $N$13 Node5 Balance 1 3 $N$14 Node6 Balance 1 3

What You Should Know About Network Flow Programming How to formulate a network flow problem. How to distinguish between the different network-type problems. How to construct a network diagram for a particular program. How to find a solution to a problem using the network Excel add-in.