15.082 and 6.855j the capacity scaling algorithm

27
1 15.082 and 6.855J The Capacity Scaling Algorithm

Upload: lily-davis

Post on 27-Dec-2015

222 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: 15.082 and 6.855J The Capacity Scaling Algorithm

1

15.082 and 6.855J

The Capacity Scaling Algorithm

Page 2: 15.082 and 6.855J The Capacity Scaling Algorithm

2

The Original Costs and Node Potentials

1

2

3 5

4

4

12

2

5

6

7

0

0 0

00

Page 3: 15.082 and 6.855J The Capacity Scaling Algorithm

3

The Original Capacities and Supplies/Demands

1

2

3 5

4

10

2020

25

25

20

30

23

5 -2

-7 -19

Page 4: 15.082 and 6.855J The Capacity Scaling Algorithm

4

Set = 16. This begins the -scaling phase.

1

2

3 5

4

10

2020

25

25

20

30

23

5 -2

-7 -19

We send flow from nodes with excess to nodes with deficit .

We ignore arcs with capacity .

Page 5: 15.082 and 6.855J The Capacity Scaling Algorithm

5

Select a supply node and find the shortest paths

1

2

3 5

4

4

12

2

5

6

7

7

0

6 8

8shortest path distance

The shortest path tree is marked in bold and blue.

Page 6: 15.082 and 6.855J The Capacity Scaling Algorithm

6

Update the Node Potentials and the Reduced Costs

1

2

3 5

4

4

12

2

5

6

7

0

-7 -8

-8-6

0

0

0

06

3

1

To update a node potential, subtract the shortest path distance.

Page 7: 15.082 and 6.855J The Capacity Scaling Algorithm

7

Send Flow Along a Shortest Path in G(x, 16)

1

2

3 5

4

1

Send flow from node 1 to node 5.

2020

25

25

20

30

23

5 -2

-7 -19

How much flow should be sent?

10

Page 8: 15.082 and 6.855J The Capacity Scaling Algorithm

8

Update the Residual Network

1

2

3 5

4

1

19 units of flow were sent from node 1 to node 5.

2020

6

25

1

3023

5 -2

-70

10

-19

4

19

19

Page 9: 15.082 and 6.855J The Capacity Scaling Algorithm

9

This ends the 16-scaling phase.

1

2

3 5

4

1

The -scaling phase continues whene(i) for some i.

e(j) - for some j.

There is a path from i to j.

2020

6

25

1

30

5 -2

-7 0

10

4

19

19

Page 10: 15.082 and 6.855J The Capacity Scaling Algorithm

10

This begins and ends the 8-scaling phase.

1

2

3 5

4

1

The -scaling phase continues whene(i) for some i.

e(j) - for some j.

There is a path from i to j.

2020

6

25

1

30

5 -2

-7 0

10

4

19

19

Page 11: 15.082 and 6.855J The Capacity Scaling Algorithm

11

This begins 4-scaling phase.

1

2

3 5

4

1 2020

6

25

1

30

5 -2

-7 0

10

4

19

19

What would we do if there were arcs with capacity at least 4 and negative reduced cost?

Page 12: 15.082 and 6.855J The Capacity Scaling Algorithm

12

Select a “large excess” node and find shortest paths.

1

2

3 5

4

1 10

-7 -8

-8-6

0

0

0

6

3

0

0 The shortest path tree is marked in bold and blue.0

Page 13: 15.082 and 6.855J The Capacity Scaling Algorithm

13

Update the Node Potentials and the Reduced Costs

1

2

3 5

4

1 00

-7 -8

-8-6

0

4

0

2

0

0

1

-11

-12-10

-4

To update a node potential, subtract the shortest path distance.

Note: low capacity arcs may have a negative reduced cost

Page 14: 15.082 and 6.855J The Capacity Scaling Algorithm

14

Send Flow Along a Shortest Path in G(x, 4).

1

2

3 5

4

1 2020

6

25

1

30

5 -2

-7 0

10

4

19

19

Send flow from node 1 to node 7

How much flow should be sent?

Page 15: 15.082 and 6.855J The Capacity Scaling Algorithm

15

Update the Residual Network

1

2

3 5

4

1 1620

10

25

1

26

5 -2

-3 0

6

4

19

15

4 units of flow were sent from node 1 to node 3

0

-7

4

4

4

Page 16: 15.082 and 6.855J The Capacity Scaling Algorithm

16

This ends the 4-scaling phase.

1

2

3 5

4

1 1620

10

25

1

26

5 -2

-3 0

6

19

15

There is no node j with e(j) -4.

0

4

4

4

Page 17: 15.082 and 6.855J The Capacity Scaling Algorithm

17

Begin the 2-scaling phase

1

2

3 5

4

1 1620

10

25

1

26

5 -2

-3 0

6

19

15

There is no node j with e(j) -4.

0

4

4

4 What would we do if there were arcs with capacity at least 4 and negative reduced cost?

Page 18: 15.082 and 6.855J The Capacity Scaling Algorithm

18

Send flow along a shortest path

1

2

3 5

4

1 1620

10

25

1

26

5 -2

-3 0

6

19

15

0

4

4

4

Send flow from node 2 to node 4

How much flow should be sent?

Page 19: 15.082 and 6.855J The Capacity Scaling Algorithm

19

Update the Residual Network

1

2

3 5

4

1 1620

10

25

1

26

5 -2

-3 0

4

19

15

0

4

6

4

2 units of flow were sent from node 2 to node 4

3 0

Page 20: 15.082 and 6.855J The Capacity Scaling Algorithm

20

Send Flow Along a Shortest Path

1

2

3 5

4

1 1620

10

25

1

26

-3 0

4

19

15

0

4

6

4

Send flow from node 2 to node 3

3 0

How much flow should be sent?

Page 21: 15.082 and 6.855J The Capacity Scaling Algorithm

21

Update the Residual Network

1

2

3 5

4

1 1320

13

25

1

26

-3 0

1

19

12

0

7

9

4

3 units of flow were sent from node 2 to node 3

3 0

0

0

Page 22: 15.082 and 6.855J The Capacity Scaling Algorithm

22

This ends the 2-scaling phase.

1

2

3 5

4

1 1320

13

25

1

26

0

1

19

12

0

7

9

4

Are we optimal?

0

0

0

Page 23: 15.082 and 6.855J The Capacity Scaling Algorithm

23

Begin the 1-scaling phase.

1

2

3 5

4

1 1320

13

25

1

26

0

1

19

12

0

7

9

4

Saturate any arc whose capacity is at least 1 and with negative reduced cost.

0

0

0

reduced cost is negative

Page 24: 15.082 and 6.855J The Capacity Scaling Algorithm

24

Update the Residual Network

1

2

3 5

4

1 1320

13

2526

0

1

20

12

-1

7

9

4

Send flow from node 3 to node 1.

0

1

0

Note: Node 1 is now a node with deficit

Page 25: 15.082 and 6.855J The Capacity Scaling Algorithm

25

Update the Residual Network

1

2

3 5

4

1 1420

12

2527

0

2

20

13

0

6

8

3

1 unit of flow was sent from node 3 to node 1.

0

0

0

Is this flow optimal?

Page 26: 15.082 and 6.855J The Capacity Scaling Algorithm

26

The Final Optimal Flow

1

2

3 5

4

10,8

20,620

25,13

25

20,20

30,3

23

5 -2

-7 -19

Page 27: 15.082 and 6.855J The Capacity Scaling Algorithm

27

The Final Optimal Node Potentials and the Reduced Costs

1

2

3 5

4

00

-7 -11

-12-10

0

-4

0

12

0

Flow is at upper bound

Flow is at lower bound.