linear programming: chapter 13 network flows: theoryanitescu/teaching/atkinson/m1100new.dir/… ·...

50
Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21, 2000 Operations Research and Financial Engineering Princeton University Princeton, NJ 08544 http://www.princeton.edu/rvdb

Upload: others

Post on 13-Jul-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

Linear Programming: Chapter 13Network Flows: Theory

Robert J. Vanderbei

May 21, 2000

Operations Research and Financial Engineering

Princeton University

Princeton, NJ 08544

http://www.princeton.edu/∼rvdb

Page 2: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

1 Networks

Basic elements:

• N Nodes (let m denote number of them).

• A Directed Arcs

– subset of all possible arcs: {(i, j) : i, j ∈ N , i 6= j}.

– arcs are directed: (i, j) 6= (j, i).

Page 3: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

1 Networks

Basic elements:

• N Nodes (let m denote number of them).

• A Directed Arcs

– subset of all possible arcs: {(i, j) : i, j ∈ N , i 6= j}.

– arcs are directed: (i, j) 6= (j, i).

Page 4: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

1 Networks

Basic elements:

• N Nodes (let m denote number of them).

• A Directed Arcs

– subset of all possible arcs: {(i, j) : i, j ∈ N , i 6= j}.

– arcs are directed: (i, j) 6= (j, i).

Page 5: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

1 Networks

Basic elements:

• N Nodes (let m denote number of them).

• A Directed Arcs

– subset of all possible arcs: {(i, j) : i, j ∈ N , i 6= j}.

– arcs are directed: (i, j) 6= (j, i).

Page 6: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

1 Networks

Basic elements:

• N Nodes (let m denote number of them).

• A Directed Arcs

– subset of all possible arcs: {(i, j) : i, j ∈ N , i 6= j}.

– arcs are directed: (i, j) 6= (j, i).

Page 7: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

2 Network Flow Data

• bi, i ∈ N , supply at node i

• cij, (i, j) ∈ A, cost of shipping 1 unit along arc (i, j).

Note: demands are recorded as negative supplies.

Page 8: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

2 Network Flow Data

• bi, i ∈ N , supply at node i

• cij, (i, j) ∈ A, cost of shipping 1 unit along arc (i, j).

Note: demands are recorded as negative supplies.

Page 9: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

2 Network Flow Data

• bi, i ∈ N , supply at node i

• cij, (i, j) ∈ A, cost of shipping 1 unit along arc (i, j).

Note: demands are recorded as negative supplies.

Page 10: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

2 Network Flow Data

• bi, i ∈ N , supply at node i

• cij, (i, j) ∈ A, cost of shipping 1 unit along arc (i, j).

Note: demands are recorded as negative supplies.

Page 11: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

3 Network Flow Problem

Decision Variables:

• xij, (i, j) ∈ A, quantity to ship along arc (i, j).

Objective:

minimize∑

(i,j)∈A

cijxij

Page 12: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

3 Network Flow Problem

Decision Variables:

• xij, (i, j) ∈ A, quantity to ship along arc (i, j).

Objective:

minimize∑

(i,j)∈A

cijxij

Page 13: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

4 Network Flow Problem–Cont.

Constraints:

• Mass conservation (aka flow balance):

inflow(k) − outflow(k) = demand(k) = −supply(k), k ∈ N

m∑i :

(i, k) ∈ A

xik −∑j :

(k, j) ∈ A

xkj = −bk, k ∈ N

• Nonnegativity:

xij ≥ 0, (i, j) ∈ A

Page 14: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

4 Network Flow Problem–Cont.

Constraints:

• Mass conservation (aka flow balance):

inflow(k) − outflow(k) = demand(k) = −supply(k), k ∈ N

m∑i :

(i, k) ∈ A

xik −∑j :

(k, j) ∈ A

xkj = −bk, k ∈ N

• Nonnegativity:

xij ≥ 0, (i, j) ∈ A

Page 15: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

4 Network Flow Problem–Cont.

Constraints:

• Mass conservation (aka flow balance):

inflow(k) − outflow(k) = demand(k) = −supply(k), k ∈ N

m∑i :

(i, k) ∈ A

xik −∑j :

(k, j) ∈ A

xkj = −bk, k ∈ N

• Nonnegativity:

xij ≥ 0, (i, j) ∈ A

Page 16: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

5 Matrix Notation

minimize cT x

subject to Ax = −b

x ≥ 0

where

cT =[

2 4 9 11 4 3 8 7 0 15 16 18]

A =

−1 −1 1 1 1

1 1 1

−1 −1

1 1 1 1

−1 −1 −1 1

−1 −1 1

−1 −1 −1

, b =

0

−19

16

−33

0

0

36

Page 17: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

6 Notes

• A is called node-arc incidence matrix.

• A is large and sparse.

Page 18: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

6 Notes

• A is called node-arc incidence matrix.

• A is large and sparse.

Page 19: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

6 Notes

• A is called node-arc incidence matrix.

• A is large and sparse.

Page 20: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

7 Dual Problem

maximize −bT y

subject to AT y + z = c

z ≥ 0

In network notation:

maximize −∑

i∈N biyi

subject to yj − yi + zij = cij (i, j) ∈ A

zij ≥ 0 (i, j) ∈ A

Page 21: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

8 Complementarity Relations

• The primal variables must be nonnegative.

• Therefore the associated dual constraints are inequalities.

• The dual slack variables are complementary to the primal variables:

xijzij = 0, (i, j) ∈ A

• The primal constraints are equalities.

• Therefore they have no slack variables.

• The corresponding dual variables, the yi’s, are free variables.

• No complementarity conditions apply to them.

Page 22: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

8 Complementarity Relations

• The primal variables must be nonnegative.

• Therefore the associated dual constraints are inequalities.

• The dual slack variables are complementary to the primal variables:

xijzij = 0, (i, j) ∈ A

• The primal constraints are equalities.

• Therefore they have no slack variables.

• The corresponding dual variables, the yi’s, are free variables.

• No complementarity conditions apply to them.

Page 23: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

8 Complementarity Relations

• The primal variables must be nonnegative.

• Therefore the associated dual constraints are inequalities.

• The dual slack variables are complementary to the primal variables:

xijzij = 0, (i, j) ∈ A

• The primal constraints are equalities.

• Therefore they have no slack variables.

• The corresponding dual variables, the yi’s, are free variables.

• No complementarity conditions apply to them.

Page 24: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

8 Complementarity Relations

• The primal variables must be nonnegative.

• Therefore the associated dual constraints are inequalities.

• The dual slack variables are complementary to the primal variables:

xijzij = 0, (i, j) ∈ A

• The primal constraints are equalities.

• Therefore they have no slack variables.

• The corresponding dual variables, the yi’s, are free variables.

• No complementarity conditions apply to them.

Page 25: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

8 Complementarity Relations

• The primal variables must be nonnegative.

• Therefore the associated dual constraints are inequalities.

• The dual slack variables are complementary to the primal variables:

xijzij = 0, (i, j) ∈ A

• The primal constraints are equalities.

• Therefore they have no slack variables.

• The corresponding dual variables, the yi’s, are free variables.

• No complementarity conditions apply to them.

Page 26: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

8 Complementarity Relations

• The primal variables must be nonnegative.

• Therefore the associated dual constraints are inequalities.

• The dual slack variables are complementary to the primal variables:

xijzij = 0, (i, j) ∈ A

• The primal constraints are equalities.

• Therefore they have no slack variables.

• The corresponding dual variables, the yi’s, are free variables.

• No complementarity conditions apply to them.

Page 27: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

8 Complementarity Relations

• The primal variables must be nonnegative.

• Therefore the associated dual constraints are inequalities.

• The dual slack variables are complementary to the primal variables:

xijzij = 0, (i, j) ∈ A

• The primal constraints are equalities.

• Therefore they have no slack variables.

• The corresponding dual variables, the yi’s, are free variables.

• No complementarity conditions apply to them.

Page 28: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

8 Complementarity Relations

• The primal variables must be nonnegative.

• Therefore the associated dual constraints are inequalities.

• The dual slack variables are complementary to the primal variables:

xijzij = 0, (i, j) ∈ A

• The primal constraints are equalities.

• Therefore they have no slack variables.

• The corresponding dual variables, the yi’s, are free variables.

• No complementarity conditions apply to them.

Page 29: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

9 Definition: Subnetwork

Network

Page 30: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

9 Definition: Subnetwork

Network Subnetwork

Page 31: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

10 Connected vs. Disconnected

Connected

Page 32: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

10 Connected vs. Disconnected

Connected Disconnected

Page 33: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

11 Cyclic vs. Acyclic

Cyclic

Page 34: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

11 Cyclic vs. Acyclic

Cyclic Acyclic

Page 35: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

12 Trees

Tree = Connected + Acyclic

Page 36: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

12 Trees

Tree = Connected + Acyclic Not Trees

Page 37: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

13 Spanning Trees

Spanning Tree–A tree touching every node

Tree Solution

xij = 0 for (i, j) 6∈ Tree Arcs

Note: Tree solutions are easy to compute—start at the leaves and work inward...

Page 38: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

13 Spanning Trees

Spanning Tree–A tree touching every node

Tree Solution

xij = 0 for (i, j) 6∈ Tree Arcs

Note: Tree solutions are easy to compute—start at the leaves and work inward...

Page 39: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

13 Spanning Trees

Spanning Tree–A tree touching every node

Tree Solution

xij = 0 for (i, j) 6∈ Tree Arcs

Note: Tree solutions are easy to compute—start at the leaves and work inward...

Page 40: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

14 Online Pivot Tool–Notations

Data:

• Costs on arcs shown above arcs.

• Supplies at nodes shown above nodes.

Variables:

• Primal flows shown on tree arcs.

• Dual slacks shown on nontree arcs.

• Dual variables shown below nodes.

Page 41: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

14 Online Pivot Tool–Notations

Data:

• Costs on arcs shown above arcs.

• Supplies at nodes shown above nodes.

Variables:

• Primal flows shown on tree arcs.

• Dual slacks shown on nontree arcs.

• Dual variables shown below nodes.

Page 42: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

14 Online Pivot Tool–Notations

Data:

• Costs on arcs shown above arcs.

• Supplies at nodes shown above nodes.

Variables:

• Primal flows shown on tree arcs.

• Dual slacks shown on nontree arcs.

• Dual variables shown below nodes.

Page 43: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

14 Online Pivot Tool–Notations

Data:

• Costs on arcs shown above arcs.

• Supplies at nodes shown above nodes.

Variables:

• Primal flows shown on tree arcs.

• Dual slacks shown on nontree arcs.

• Dual variables shown below nodes.

Page 44: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

14 Online Pivot Tool–Notations

Data:

• Costs on arcs shown above arcs.

• Supplies at nodes shown above nodes.

Variables:

• Primal flows shown on tree arcs.

• Dual slacks shown on nontree arcs.

• Dual variables shown below nodes.

Page 45: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

14 Online Pivot Tool–Notations

Data:

• Costs on arcs shown above arcs.

• Supplies at nodes shown above nodes.

Variables:

• Primal flows shown on tree arcs.

• Dual slacks shown on nontree arcs.

• Dual variables shown below nodes.

Page 46: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

15 Tree Solutions–An Example

data

variables

• Fix a root node, say a.

• Primal flows on tree arcs calculated re-

cursively from leaves inward.

• Dual variables at nodes calculated recur-

sively from root node outward along tree

arcs using:

yj − yi = cij

• Dual slacks on nontree arcs calculated

using:

zij = yi − yj + cij.

Page 47: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

15 Tree Solutions–An Example

data

variables

• Fix a root node, say a.

• Primal flows on tree arcs calculated re-

cursively from leaves inward.

• Dual variables at nodes calculated recur-

sively from root node outward along tree

arcs using:

yj − yi = cij

• Dual slacks on nontree arcs calculated

using:

zij = yi − yj + cij.

Page 48: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

15 Tree Solutions–An Example

data

variables

• Fix a root node, say a.

• Primal flows on tree arcs calculated re-

cursively from leaves inward.

• Dual variables at nodes calculated recur-

sively from root node outward along tree

arcs using:

yj − yi = cij

• Dual slacks on nontree arcs calculated

using:

zij = yi − yj + cij.

Page 49: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

15 Tree Solutions–An Example

data

variables

• Fix a root node, say a.

• Primal flows on tree arcs calculated re-

cursively from leaves inward.

• Dual variables at nodes calculated recur-

sively from root node outward along tree

arcs using:

yj − yi = cij

• Dual slacks on nontree arcs calculated

using:

zij = yi − yj + cij.

Page 50: Linear Programming: Chapter 13 Network Flows: Theoryanitescu/TEACHING/ATKINSON/m1100new.dir/… · Linear Programming: Chapter 13 Network Flows: Theory Robert J. Vanderbei May 21,

15 Tree Solutions–An Example

data

variables

• Fix a root node, say a.

• Primal flows on tree arcs calculated re-

cursively from leaves inward.

• Dual variables at nodes calculated recur-

sively from root node outward along tree

arcs using:

yj − yi = cij

• Dual slacks on nontree arcs calculated

using:

zij = yi − yj + cij.