18
15.082 and 6.855J The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem

15.082 and 6.855J

Embed Size (px)

DESCRIPTION

15.082 and 6.855J. The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow Problem. Preflow Push. 4. 2. 5. 1. 3. 1. 1. 2. 4. s. 4. t. 3. 2. 1. 3. This is the original network, and the original residual network. 5. 4. 3. 2. 1. 0. Initialize Distances. 4. 2. 2. - PowerPoint PPT Presentation

Citation preview

Page 1: 15.082 and 6.855J

15.082 and 6.855J

The Goldberg-Tarjan Preflow Push Algorithm for the Maximum Flow

Problem

Page 2: 15.082 and 6.855J

Preflow Push

4

11

4

21

2

3

3

1

s

2

4

5

3

t

This is the original network, and the original residual network.

Page 3: 15.082 and 6.855J

Initialize Distances

4

11

4

21

2

3

3

1

s

2

4

5

3

t

The node label henceforth will be the distance label.

0

5

4

3

2

1

t

4 53

s2

d(j) is at most the distance of j to t in G(x)

02

2

1

1

1

Page 4: 15.082 and 6.855J

Saturate Arcs out of node s

4

11

4

21

2

3

3

1

s

2

4

5

3

t

Saturate arcs out of node s.

0

5

4

3

2

1

t

4 53

s2

Move excess to the adjacent arcs

02

2

1

1

1

3

2

12

13

6s

s

Relabel node s after all incident arcs have been saturated.

2

3 4

Page 5: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

3

t

Select an active node, that is, one with excess

0

5

4

3

2

1

t

4 53

s2

Push/Relabel

02

2

1

1

1

3

2

12

13

6s

s

Update excess after a push

11

Page 6: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

3

t

Select an active node, that is, one with excess

0

5

4

3

2

1

t

4 53

s202

2

1

1

1

3

2

12

1

6s

s

No arc incident to the selected node is admissible. So relabel.

11

23

3

Page 7: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node, that is, one with excess

0

5

4

3

2

1

t

4 5

s202

2

1

1

3

2

26

s

s

Push/Relabel

1

2

3

21

31

2

3

Page 8: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node.

0

5

4

3

2

1

t

4 5

s202

2

1

1

3

2

26

s

s

Push/Relabel

1

2

3

21

31

2

3 31

32

2

1

5

Page 9: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node.

0

5

4

3

2

1

t

4 5

s202

2

1

12

26

s

s

Push/Relabel

1

2

3

21

31

2

31

3

2

1

Page 10: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node.

0

5

4

3

2

1

t

4 5

s202

2

1

12

26

s

s

There is no incident admissible arc. So Relabel.

1

2

3

21

31

2

31

3

2

12

5

5

Page 11: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node.

0

5

4

3

2

1

t

4

5s202

2

1

12

26

s

s

Push/Relabel

1

2

3

21

3

2

31

3

2

22

1

41

Page 12: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node.

0

5

4

3

2

1

t

4

5s202

2

1

12

26

s

s

There is no incident admissible arc. So relabel.

1

2

3

21

3

2

31

3

2

22

1

41

3

5

5

Page 13: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node.

0

5

4

3

2

1

t

4 5

s202

2

1

12

26

s

s

Push/Relabel

1

2

3

21

3

2

31

3

2

22

1

41

3

5

5

3

Page 14: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node.

0

5

4

3

2

1

t

4 5

s202

2

1

12

26

s

s

Push/Relabel

1

2

3

21

3

22

222

41

3

5

5

3

1

141

4

Page 15: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node.

0

5

4

3

2

1

t

4 5

s202

2

1

12

26

s

s

Push/Relabel

1

2

3

21

3

22

222

41

3

5

5

3

1

4

24

2

2

Page 16: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node.

0

5

4

3

2

1

t

4 5

s02

2

1

12

26

s

s

Push/Relabel

1

2

3

21

3

22

222

41

3

5

5

3

1

4

4

2

4

Page 17: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

Select an active node.

0

5

4

3

2

1

t

4 5

s02

2

1

12

26

s

s

Push/Relabel

1

2

3

21

3

21

322

41

3

5

5

3

1

4

4

2

4 35

5

5

Page 18: 15.082 and 6.855J

Select, then relabel/push

4

11

4

21

2

3

3

1

s

2

4

5

t

One can keep pushing flow between nodes 2 and 5 until eventually all flow returns to node s.

0

5

4

3

2

1

t

4 5

s02

2

1

12

26

s

s

There are no paths from nodes 2 and 5 to t, and there are ways to speed up the last iterations.

1

2

3

21

3

21

322

41

3

5

5

3

1

4

4

2

4 35

5

5