Lecture 5 – Integration of Network Flow Programming Models

26
Lecture 5 – Integration of Network Flow Programming Models Topics • Min-cost flow problem (general model) • Mathematical formulation and problem characteristics • Pure vs. generalized networks

description

Lecture 5 – Integration of Network Flow Programming Models. Topics Min-cost flow problem (general model) Mathematical formulation and problem characteristics Pure vs. generalized networks. Distribution Problem. [supply / demand]. arc lower bounds = 0. arc upper bounds = 200. - PowerPoint PPT Presentation

Transcript of Lecture 5 – Integration of Network Flow Programming Models

Lecture 5 – Integration of Network Flow Programming Models

Topics

• Min-cost flow problem (general model)

• Mathematical formulation and problem characteristics

• Pure vs. generalized networks

GAINS

8

ATL

5

NY

6

DAL

4

CHIC

2

AUS

7

LA

3

PHOE

1

(6)

(3)

(5)

(7)

(4)

(2)

(4)

(5)

(5)(6)

(4)

(7)

(6)

(3)

[–150]

[200]

[–300]

[200]

[–200]

[–200]

(2)

(2)

(7)

[–250][700]

[supply / demand](shipping cost)

arc lower bounds = 0 arc upper bounds = 200

Distribution Problem

Min-Cost Flow Problem

•Warehouses store a particular commodity in Phoenix, Austin and Gainesville.

• Customers - Chicago, LA, Dallas, Atlanta, & New York

Supply [ si ] at each warehouse i

Demand [ dj ] of each customer j• Shipping links depicted by arcs, flow on each arc is

limited to 200 units.• Dallas and Atlanta - transshipment hubs• Per unit transportation cost (cij ) for each arc

Problem: Determine optimal shipping plan that minimizes transportation costs

Example: Distribution problem

Notation for Min-Cost Flow Problem

In general:[supply/demand] on nodes(shipping cost per unit) on arcs

In example:all arcs have an upper bound of 200nodes labeled with a number 1,...,8

• Must indicate notation that is included in model:

(cij ) unit flow cost on arc (i, j )

(uij ) capacity (or simple upper bound) on arc (i,

j )

(gij ) gain or loss on arc (i, j )

• All 3 could be included: (cij , uij , gij )

Spreadsheet Input Data

arcname

terminationnode cost gain

originnode

lowerbound

upperbound

xij i j lij

The origin node is the arc’s tail

The termination node is called the head

Supplies are positive and demands are negative

i j

uij cij gij

externalflow

si or -di

Data Entry Using Math Programming/Network Add-in.

And here is the solution ...

Network Model Name: dist_1 Solver: J ensen Network Ph. 1 Iter. 13

TRUE Type: Net Type: Linear Total Iter. 15FALSE Change Goal: Min Sens.: No Comp. Time 00:00TRUE Objective: 5300 Side: No Status OptimalFALSE Solve Select the Relink Buttons command from the OR_MM menu before clicking a button.FALSE

100 Arc Data and Flows Node Data and Balance Constraints100 Num. Name Flow Origin Term. Upper Cost Num. Name Fixed Balance0 1 Phoe-Chi 200 1 2 200 6 1 Phoe 700 060 2 Phoe-LA 200 1 3 200 3 2 Chi -200 0

FALSE 3 Phoe-Dal 200 1 4 200 3 3 LA -200 0FALSE 4 Phoe-Atl 100 1 5 200 7 4 Dal -300 0FALSE 5 Dal-LA 0 4 3 200 5 5 Atl -150 0

6 Dal-Chi 0 4 2 200 4 6 NY -250 07 Dal-NY 50 4 6 200 6 7 Aus 200 08 Dal-Atl 50 4 5 200 2 8 Gain 200 09 Atl-NY 0 5 6 200 510 Atl-Dal 0 5 4 200 211 Atl-Chi 0 5 2 200 412 Aus-LA 0 7 3 200 713 Aus-Dal 200 7 4 200 214 Aus-Atl 0 7 5 200 515 Gain-Dal 0 8 4 200 616 Gain-Atl 0 8 5 200 417 Gain-NY 200 8 6 200 7

GAINS

ATL

NY

DAL

CHIC

AUS

LA

PHOE

(200)

(200)

(200)

(200)

(50)

(200)

[-150]

[200]

[-300]

[200]

[-200]

[-200]

(50)

(100)

[-250]

[700]

[supply / demand] (flow)

Solution to Distribution Problem

Variable Analysis Objective Value: 5,300.

Num. Name Value StatusReduced

CostObjective

CoefficientRange

Lower LimitRange

Upper Limit

1 Phoe-Chi 200. Basic 0. 6. --- 9.2 Phoe-LA 200. Upper 0. 3. --- 3.3 Phoe-Dal 200. Upper -2. 3. --- 5.4 Phoe-Atl 100. Basic 0. 7. 7. ---5 Dal-LA 0. Lower 7. 5. -2. ---6 Dal-Chi 0. Lower 3. 4. 1. ---7 Dal-NY 50. Basic 0. 6. 5. 7.8 Dal-Atl 50. Basic 0. 2. 1. 2.9 Atl-NY 0. Lower 1. 5. 4. ---10 Atl-Dal 0. Lower 4. 2. -2. ---11 Atl-Chi 0. Lower 5. 4. -1. ---12 Aus-LA 0. Lower 7. 7. 0. ---13 Aus-Dal 200. Basic 0. 2. 1. 2.14 Aus-Atl 0. Lower 1. 5. 4. ---15 Gain-Dal 0. Lower 4. 6. 2. ---16 Gain-Atl 0. Lower 0. 4. 4. ---17 Gain-NY 200. Upper -1. 7. --- 8.

Constraint Analysis

Num. Name Value StatusShadow

PriceConstraint

LimitRange

Lower LimitRange

Upper Limit

1 Phoe 0. Equality 3. 700. 700. 700.2 Chi 0. Equality -3. -200. -200. -200.3 LA 0. Equality 0. -200. -200. -200.4 Dal 0. Equality -2. -300. -300. -300.5 Atl 0. Equality -4. -150. -150. -150.6 NY 0. Equality -8. -250. -250. -250.7 Aus 0. Equality 0. 200. 200. 200.8 Gain 0. Equality 0. 200. 200. 200.

Sensitivity Report for Max Flow Problem

Characteristics of Network Flow Problems

Conservation of flow at nodes. At each node flow in = flow out. At supply nodes there is an external inflow (positive)At demand nodes there is an external outflow (negative).

Flows on arcs must obey the arc bounds; i.e., lower bound & upper bound (capacity)

Each arc has a per unit cost & the goal is to minimize total cost.

Distribution Network Used in Formulation

8

5

6

4

2

7

3

1

(6)

(3)

(5)

(7)

(4)

(2)

(4)(5)

(5)(6)

(4)

(7)

(6)

(3)

[-150]

[200]

[-300]

[200]

[-200]

[-200]

(2)

(2)

(7)

[-250]

[700]

[external flow] (cost)

lower = 0, upper = 200

Notation

Pure network flow at each node is conserved

flow across an arc is conserved

no gains or losses can occur on arcs

Min 6x 12 + 3x 13 + 3x 14 + 7x 16 + + 4x 85 + 7x86

sit.

x21 + x23 + x24 + x

x23 + x43 x63 =

x41 + x43 + x46 + x47 + x24 + 54 + x 84 =

...x 84 + x85 + x86

xij 200, for all (i, j ) combinations which are arcs

s.t.

x12 x 42 x 52 = 200

x12+ x13 + x14 + x 15

= 700

x 13 + x 43 x 73 = 200

x 41 + x42 + x 43 + x

45 +

x46 x54 x 74

x84 = 300

Flow balance constraints for each of the 8 nodes

= 200

LP for Distribution Problem

Node 1Node 2 . . .

.

.

.

Decision variables are the flow variables xij

By examining the flow balance constraints we see that xij appears in exactly two of them:

xij 0. . . 0

+1 node i

(or in the other order if i > j)

0 . . . 0 1 node j0 . . . 0

i j

• If we add the constraints we obtain zero on the left-hand side so the right-hand side must also be zero for feasibility.

• In particular, this meanssum of supplies = sum of demands.

• Mathematically, we have one redundant constraint.

• Must be careful in interpreting shadow prices on the flow balance constraints.

• Cannot change only a supply or demand and have model make sense.

Observations from LP Model

Pure Minimum Cost Flow Problem

G = (N, A) network with node set N and arc set A

Indices i, j N denote nodes and (i, j ) A denote arcs

Originating set of arcs for node i (tails are i ) is the forward star of i

FS(i ) = { (i, j ) : (i, j ) A }

Terminating set of arcs for node i is the reverse star of i

RS(i ) = { (j,i ) : (j,i ) A }.

FS(1) = { (1,2), (1,3), (1,4), (1, 5) }

RS(1) = Ø

FS(4) = { (4,2), (4,3), (4,5), (4,6) }

RS(4) = { (1,4), (5, 4), (7,4), (8,4) }

xij – xji = bi

(i, j )FS(i )

where bi is positive for supply and negative for demand at node i.

(j,i )RS(i )

Flow Balance equation:

In our example:

Pure Min-Cost Flow Problem

Indices/setsi, j N nodes

arcsforward star of ireverse star of i

(i, j ) A

FS(i )RS(i )

Data cij unit cost of flow on (i, j )

lower bound on flow (i, j )

upper bound on flow (i, j )

external flow at node i

lijuij

bi

Decision Variables

xij = flow on arc (i, j )

Formulation

Min cijxij(i, j )A

s.t. xij xji = bi, i N (i, j )FS(i ) (j, i )RS(i )

lij xij uij, (i, j ) A

Generalized Minimum Cost Network Flow Model

• Only oneone modification to “pure” formulation

a possible gain (or loss) on each arc, denoted by gij

• If gij = 0.95 then 100 units of flow leaves node i and

95 units arrive at node j

Generalized Formulation

Min cijxij(i, j )A

s.t.

lij xij uij, (i, j )A

Note that if gij =1 (i, j ) A, then we obtain the “pure” model

xij gjixji = bi, i N(i, j )FS(i ) (j, i )RS(i )

Gains and Losses

• Might experience 5% spoilage of a perishable good during

transportation on a particular arc.

gij = 0.95 for the associated arc (i,j).

• In production of manufacturing formulations we might incur losses due to production defects.

• In financial examples we can have gains due to currency exchange or gains due to returns on investments.

US $

Swissfrancs

Year 1 Year 2

currencyexchange

15% returnon investment

Gain = 1.78

Gain = 1.15

Pure Network Problems vs. General Network Problems

FACT If bi, lij and uij are integer-valued then all

extreme points of the feasible region for a

pure network flow problem give integer

values for xij. (Same cannot be said for generalized network models.)

This integer property means that if we use the

simplex method to solve a pure network flow

problem then we are guaranteed that xij will be

integer at optimality.

This is critical when we formulate the assignment, shortest path problems, and other network problems.

Special cases of the pure min-cost flow model:

• Transportation problem

• Assignment problem

• Shortest path problem

• Maximum flow problem

Checking for Arbitrage Opportunities

US $ Yen(100) CHF D-Mark Brit £

1 US $ 1 1.05 1.45 1.72 .682 Yen(100) .95 1 1.41 1.64 .643 CHF .69 .71 1 1.14 .484 D-Mark .58 .61 0.88 1 .395 Brit £ 1.50 1.56 2.08 2.08 1

• The table is to be read as follows:

The 1.45 in row 1 column 3 means that $1 US will purchase 1.45 Swiss Francs (CHF).

• In addition, there is a 1% fee that is charged on each exchange.

Each arc has a gain of gij. For example,g12 = (1.05)(0.99)g51 = (1.50)(0.99)

Arbitrage Network: Generalized Min-Cost Flow Problem

5

43

2

1

[-1]

Brit £

US $

D-MarkCHF

Yen

Arc costs:cij = $ equivalent(first column of table)

For example:c14 = 1, c35 = 0.69

Solution to Arbitrage Network

1

4

5

3

30.473

0.674

34.986

Start with 13.801 £ 34.986 D-Mark 30.473 CHF 14.475 £

Remove 0.674 £ $1 leaving 13.801 £

Brit £

US $

CHF

D-Mark13

.801

g54 = 2.535

g43 = 0.871

g35 = 0.475

Note (£ $):g51 = 1.485

Arc gains in optimal cycle:

Total cycle gain: = 1.0488= 4.88%

What You Should Known About General Network Flow Problems

• How to formulate a general network flow problem as a linear program.

• What the relationship is between the maximum flow and the minimum cut in a network.

• What the implications are for a network flow problem with gains.

• How to solve general network flow problems using the Excel add-ins.