Download - 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

Transcript
Page 1: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

15.082J and 6.855J and ESD.78J

Network Simplex Animations

Page 2: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

2

Calculating A Spanning Tree Flow

1

3 6

4 5

2 7

1

3-6

-41

2 3

A tree with

supplies and

demands.

(Assume that all

other arcs have a

flow of 0)

What is the flow

in arc (4,3)?

Page 3: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

3

Calculating A Spanning Tree Flow

1

3 6

4 5

2 7

1

3-6

-41

2 3

To calculate

flows, iterate up

the tree, and find

an arc whose flow

is uniquely

determined.

What is the flow

in arc (5,3)?

2

Page 4: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

4

Calculating A Spanning Tree Flow

1

3 6

4 5

2 7

1

3-6

-41

2 3

What is the flow

in arc (3,2)?

2 3

Page 5: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

5

Calculating A Spanning Tree Flow

1

3 6

4 5

2 7

1

3-6

-41

2 3

What is the flow

in arc (2,6)?

2 3

6

Page 6: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

6

Calculating A Spanning Tree Flow

1

3 6

4 5

2 7

1

3-6

-41

2 3

What is the flow

in arc (7,1)?

2 3

6 4

Page 7: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

7

Calculating A Spanning Tree Flow

1

3 6

4 5

2 7

1

3-6

-41

2 3

What is the flow

in arc (1,6)?

2 3

6 4

3

Page 8: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

8

Calculating A Spanning Tree Flow

1

3 6

4 5

2 7

1

3-6

-41

2 3

Note: there are two

different ways of

calculating the flow

on (1,2), and both

ways give a flow of

4. Is this a

coincidence?2 3

6 4

4 3

Page 9: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

9

Calculating Simplex Multipliers

for a Spanning Tree

1

3 6

4 5

2 7

5-6

-2

-4

1

3

Here is a spanning

tree with arc costs.

How can one

choose node

potentials so that

reduced costs of

tree arcs is 0?

Recall: the

reduced cost of

(i,j) is

cij - πi + πj

Page 10: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

10

1

3 6

4 5

2 7

5-6

-2

-4

1

3

One can set π1

arbitrarily. We will

let πi = 0.

What is the

simplex multiplier

for node 2?

There is a

redundant

constraint in the

minimum cost flow

problem.

0

Calculating Simplex Multipliers

for a Spanning Tree

Page 11: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

11

Calculating Simplex Multipliers

for a Spanning Tree

1

3 6

4 5

2 7

5-6

-2

-4

1

3

What is the

simplex multiplier

for node 7?

0The reduced cost

of (1,2) is

c12 - π1 + π2 = 0.

Thus 5 - 0 + π2 = 0.

-5

Page 12: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

12

Calculating Simplex Multipliers

for a Spanning Tree

1

3 6

4 5

2 7

5-6

-2

-4

1

3

What is the

simplex multiplier

for node 3?

0The reduced cost

of (1,2) is

c71 - π7 + π1 = 0.

Thus -6 - π2 +0 = 0.

-5

-6

Page 13: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

13

Calculating Simplex Multipliers

for a Spanning Tree

1

3 6

4 5

2 7

5-6

-2

-4

1

3

What is the

simplex multiplier

for node 6?

0

-5

-6

-2

Page 14: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

14

Calculating Simplex Multipliers

for a Spanning Tree

1

3 6

4 5

2 7

5-6

-2

-4

1

3

What is the

simplex multiplier

for node 4?

0

-5

-6

-2 -1

Page 15: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

15

Calculating Simplex Multipliers

for a Spanning Tree

1

3 6

4 5

2 7

5-6

-2

-4

1

3

What is the

simplex multiplier

for node 5?

0

-5

-6

-2 -1

-4

Page 16: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

16

Calculating Simplex Multipliers

for a Spanning Tree

1

3 6

4 5

2 7

5-6

-2

-4

1

3

These are the

simplex multipliers

associated with

this tree. They do

not depend on arc

flows, nor on costs

of non-tree arcs.

0

-5

-6

-2 -1

-4 -1

Page 17: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

17

Network Simplex Algorithm

1

2

4

5

3

2 -42, $4

4, $21, $4

5, $5

3, $5 4, $1

4, $2 3, $4

5 -3

The minimum Cost Flow

Problem

T

L

U

Page 18: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

18

Spanning tree flows

1

2

4

5

3

2 -41

00

3

2 0

13

5 -3

An Initial Spanning Tree

Solution

T

L

U

Page 19: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

19

Simplex Multipliers and Reduced Costs

1

2

4

5

3

0 -40

?4

0

0 -2

0 2

3 -2

The initial simplex multipliers

and reduced costs

T

L

U

c45 = 2

What arcs

are

violating?

3

Page 20: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

20

Add a violating arc to the spanning tree,

creating a cycle

1

2

4

5

33,2

4,0

4,1 3,3

Arc (2,1) is added to the tree

T

L

U

What is the

cycle, and

how much

flow can be

sent?

2, 1

4, 01, 0

5, 3

u14, x14

Page 21: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

21

Send Flow Around the Cycle

1

2

4

5

33,0

4,2

4,3 3,3

2 units of flow were sent

along the cycle.

T

L

U

What is the

next

spanning

tree?

2, 1

4, 01, 0

5, 3

u14, x14

Page 22: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

22

After a pivot

1

2

4

5

33,0

4,2

4,3 3,3

The Updated Spanning Tree

T

L

U

In a pivot, an

arc is added to

T and an arc is

dropped from T.

2, 1

4, 01, 0

5, 3

u14, x14

Page 23: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

23

Updating the Multipliers

1

2

4

5

3

The current multipliers and

reduced costs

T

L

U0 -40

44

0

0 -2

0 2

3 -2

3

How can we

make c21 = 0

and have

other tree

arcs have a 0

reduced

cost?

Page 24: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

24

Deleting (2,1) from T splits T into two parts

1

2

4

5

3

Adding Δ to multipliers on

one side of the tree does not

effect the reduced costs of

any tree arc except (2,1).

Why?

T

L

U0 -40

44

0

0 -2

0 2

3+Δ -2+Δ

3

What value of

Δ should be

chosen to

make the

reduced cost

of (2,1) = 0?

Page 25: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

25

The updated multipliers and reduced costs

1

2

4

5

3

The updated multipliers and

reduced costs

T

L

U0 -40

22

0

2 0

0 2

1 -4

3

Is this tree

solution

optimal?

Page 26: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

26

Add a violating arc to the spanning tree,

creating a cycle

1

2

4

5

3

Add arc (3,4) to the spanning

tree

T

L

U

3,0 4,2

4,3 3,3

2, 1

4, 01, 0

5, 3What is the

cycle, and

how much

flow can be

sent?

Page 27: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

27

Send Flow Around the Cycle

1

2

4

5

3

1 unit of flow was sent

around the cycle.

T

L

U

3,0 4,2

4,2 3,2

2, 2

4, 01, 0

5, 3What is the

next

spanning

tree

solution?

Page 28: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

28

The next spanning tree solution

1

2

4

5

3

Here is the updated spanning

tree solution

T

L

U

3,0 4,2

4,2 3,2

2, 2

4, 01, 0

5, 3

Page 29: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

29

Updated the multipliers

1

2

4

5

3

Here are the current

multipliers

T

L

U0 -40

22

0

2 0

0 2

1 -4

3

How should

we modify

the

multipliers?

Page 30: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

30

Updated the multipliers

1

2

4

5

3

Here are the current

multipliers

T

L

U0 -4 +Δ0

22

0

2 0

0 2

1 -4

3

What value

should Δ

be?

Page 31: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

31

The updated multipliers

1

2

4

5

3

Here are the updated

multipliers.

T

L

U0 -6-2

42

0

2 0

0 0

1 -4

3

Is the

current

spanning

tree solution

optimal?

Page 32: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

32

The Optimal Solution

1

2

4

5

3

Here is the optimal solution.

T

L

U0 -6-2

42

0

2 0

0 0

1 -4

3

No arc

violates the

optimality

conditions.

Page 33: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

33

Finding the Cycle

1

3 6

10 11

8 7

9 12

5

2

Page 34: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

34

Use Depth and Predecessor

1

3 6

10 11

8 7

9 12

5

2

0

2

4

depth(5) = 4;

depth(3) = 2;

replace node

5 by pred(5)

Page 35: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

35

Use Depth and Predecessor

1

3 6

10 11

8 7

9 12

5

2

0

2

3

depth(9) = 3;

depth(3) = 2;

replace node

9 by pred(9)

Page 36: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

36

Use Depth and Predecessor

1

3 6

10 11

8 7

9 12

5

2

0

2 2

depth(2) = 2;

depth(3) = 2;

replace node

2 by pred(2);

replace node

3 by pred(3)

Page 37: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

37

Use Depth and Predecessor

1

3 6

10 11

8 7

9 12

5

2

0

1 1depth(8) = 1;

depth(7) = 1;

replace node

8 by pred(8);

replace node

7 by pred(1)

Page 38: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

38

Use Depth and Predecessor

1

3 6

10 11

8 7

9 12

5

2

0

The least

common

ancestor of

nodes 3

and 5 has

been

found.

Page 39: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

39

Updating the multipliers:

use the thread and depth

1

3 6

10 11

8 7

9 12

5

2

Suppose

that arc

(1,8) will

drop out of

the tree.

What is the

subtree

rooted at

node 8?

Page 40: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

40

Follow the thread starting with node 8

1

3 6

10 11

8 7

9 12

5

2

What is

thread(8)?

Page 41: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

41

Follow the thread starting with node 8

1

3 6

10 11

8 7

9 12

5

2

What is

thread(3)?

Page 42: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

42

Follow the thread starting with node 8

1

3 6

10 11

8 7

9 12

5

2

What is

thread(10)?

Page 43: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

43

Follow the thread starting with node 8

1

3 6

10 11

8 7

9 12

5

2

What is

thread(11)?

Page 44: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

44

Follow the thread starting with node 8

1

3 6

10 11

8 7

9 12

5

2

What is

thread(6)?

Page 45: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

45

The stopping rule

1

3 6

10 11

8 7

9 12

5

2

Stopping rule: stop

when

depth(current node) ≤

depth(8)depth = 1

depth =

1

Page 46: 15.082J Network Optimization Animations, Network simplex ...24 Deleting (2,1) from T splits T into two parts 1 2 4 5 3 Adding Δto multipliers on one side of the tree does not effect

MIT OpenCourseWarehttp://ocw.mit.edu

15.082J / 6.855J / ESD.78J Network Optimization

Fall 2010

For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.