15.082 and 6.855j

29
1 15.082 and 6.855J Min Global Cut Animation

Upload: maggy-mooney

Post on 31-Dec-2015

57 views

Category:

Documents


4 download

DESCRIPTION

15.082 and 6.855J. Min Global Cut Animation. 1. 4. 1. 5. 4. 1. 3. 6. 6. 3. 1. 2. 5. Initialize. Saturate the arcs out of node 1. Update the residual network. 1. 1. 5. 4. 1. 4. 5. 4. 4. 3. 1. 2. 5. 3. 6. 1. 1. 3. 6. 6. 3. 0. 1. 2. 5. 1. Initialize. 1. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: 15.082 and 6.855J

1

15.082 and 6.855J

Min Global Cut Animation

Page 2: 15.082 and 6.855J

2

Initialize

1

3

2 5

6

41

1

1

5

3

4

6

Saturate the arcs out of node 1.

Update the residual network

Page 3: 15.082 and 6.855J

3

Initialize

0

5

4

3

2

1

2

4

53

6

1

Compute distances to node 2

Determine admissible arcs

1

1

3

2 5

6

41

1

1

5

3

4

6

51

6

4

1

3

We will never push from node 1 again or into node 1.

Page 4: 15.082 and 6.855J

4

Push/Relabel

0

5

4

3

2

1

2

4

53

6

1

Select an active node

1

Carry out push/relabel

1

3

2 5

6

4

1

13

4

6

51

6

4

1

3

32

Page 5: 15.082 and 6.855J

5

Push/Relabel

0

5

4

3

2

1

2

4

53

6

1

Select an active node

1

Relabel. There are no admissible arcs.

1

3

2 5

6

4

1

16

4

6

51

6

4

1

32

3

3

Page 6: 15.082 and 6.855J

6

Push/Relabel

0

5

4

3

2

1

2

4

5

6

1

Select an active node

1

Push from node 3.

1

3

2 5

6

4

1

16

4

6

51

6

4

1

32

3

1 1

Page 7: 15.082 and 6.855J

7

Push/Relabel

0

5

4

3

2

1

2

4

5

6

1

Select an active node

1

Relabel node 3. Rule: no empty levels permitted.

1

3

2 5

6

4

16

4

6

52

6

4

1

32

3

1 1

Page 8: 15.082 and 6.855J

8

Gaps

Let t denote the current sink node.

Let dmax be the maximum distance label of a node other than the source node.

An empty level is a value k with d(t) < k < dmax such that there is no node j with d(j) = k.

If we increase d(3) to 7, we create a gap. In such a case, we increase d(j) to dmax + 1.

Page 9: 15.082 and 6.855J

9

Push/Relabel

0

5

4

3

2

1

2

4

5

6

1

Relabel node 3 so no empty level is created.

1

1

3

2 5

6

4

16

4

6

52

6

4

1

32

3

1 1

3

3

Page 10: 15.082 and 6.855J

10

Cut Level

0

5

4

3

2

1

2

4

5

6

1

A cut level is a level with exactly one node that needs to be relabeled.

1

1

3

2 5

6

4

16

4

6

52

6

4

1

21 1

3

There is no path in the residual network from a node in a cut level to a node below it.

Page 11: 15.082 and 6.855J

11

Cut-level rule

Always select an active node that is below the lowest cut-level.

If each active node is at or above a cut level, then stop with the max preflow/ min cut.

Page 12: 15.082 and 6.855J

12

Push/Relabel

0

5

4

3

2

1

2

4

5

6

1

Select an active node below the lowest cut level.

1

1

3

2 5

6

4

16

4

6

52

6

4

1

21 1

3

Push from node 4.

4

Page 13: 15.082 and 6.855J

13

Push/Relabel

0

5

4

3

2

1

2

4

5

6

1

Select an active node below the lowest cut level.

1

3

2 5

6

4

16

3

6

52

6

5

1

21

3

Push from node 6.

26

Page 14: 15.082 and 6.855J

14

Push/Relabel

0

5

4

3

2

1

2

4

5

6

1

Select an active node below the lowest cut level.

1

3

2 5

6

4

16

3

4

52

8

5

1

21

3

Push from node 5.

25

Page 15: 15.082 and 6.855J

15

Push/Relabel

0

5

4

3

2

1

2

4

5

6

1

Select an active node below the lowest cut level.

1

3

2 5

6

4

26

3

4

52

8

5

21

3

Relabel node 5 if it will not create an empty level.

15

Page 16: 15.082 and 6.855J

16

End of finding the first cut

0

5

4

3

2

1

2

4

5

6

1

There is no active node below the lowest cut level.

1

3

2 5

6

4

26

3

4

52

8

5

21

3

The max preflow and min cut have been found.

1

Let T be all nodes that can reach the sink node.

Page 17: 15.082 and 6.855J

17

End of finding the first cut

0

5

4

3

2

1

2

4

5

6

1

Here is the first minimum cut.

31

3

2 5

6

41

1

1

5

3

4

6

Page 18: 15.082 and 6.855J

18

Beginning of the second cut

0

5

4

3

2

1

2

4

5

6

1

Choose a new sink node at the lowest level

1

3

2 5

6

4

26

3

4

52

8

5

21

3

Make node 2 a source node

1

Saturate arcs out of node 2.

2 5

5

Page 19: 15.082 and 6.855J

19

Beginning of the second cut

0

5

4

3

2

1

2

4

5

6

1

We will not push from node 2 or into node 2 again.

1

3

2 5

6

4

3

4

52

8

5

27

3

There is no need to physically merge nodes 1 and 2.

52

Page 20: 15.082 and 6.855J

20

Push/Relabel

0

5

4

3

2

1

2

4

5

6

1

Select an active node

1

3

2 5

6

4

3

4

52

8

5

27

3

Relabel node 3 if it will not create an empty level.

52

3

Page 21: 15.082 and 6.855J

21

Push/Relabel

0

5

4

3

2

1

2

4

5

6

1

Level 4 becomes a cut level

1

3

2 5

6

4

3

4

52

8

5

27

3

There is no active node below a cut level.

52

The second cut has been found.

Let T be all nodes that can reach the sink node.

Page 22: 15.082 and 6.855J

22

Push/Relabel

0

5

4

3

2

1

2

4

5

6

1

Here is the 2nd cut.

31

3

2 5

6

41

1

1

5

3

4

6

Page 23: 15.082 and 6.855J

23

Starting the 3rd cut

0

5

4

3

2

1

2

4

5

6

1

Make node 5 a source node

1

3

2 5

6

4

3

4

52

8

5

27

3

Node 6 becomes the new sink node

52

Saturate arcs out of node 5.

5

5

66

Page 24: 15.082 and 6.855J

24

Starting the 3rd cut

0

5

4

3

2

1

2

4

5

6

1

Level 3 is still a cut level

1

3

2 5

6

4

3

52

5

27

3

There are still no active nodes below a cut level

52

We have found the 3rd cut

Let T be all nodes that can reach the sink node.

Page 25: 15.082 and 6.855J

25

The 3rd cut

0

5

4

3

2

1

2

4

5

6

1

The above cut is the best cut with 1, 2, 5 on one side and with node 6 on the other side.

31

3

2 5

6

41

1

1

5

3

4

6

Page 26: 15.082 and 6.855J

26

Starting the 4th cut

0

5

4

3

2

1

2

4

5

6

1

Node 6 becomes a source node

1

3

2 5

6

4

3

52

5

27

3

Node 4 becomes the next source node

52

Saturate arcs out of node 6

66

4

4

Page 27: 15.082 and 6.855J

27

We have found the 4th and 5th cuts

0

5

4

3

2

1

2

4

5 61

1

3

2 5

6

4

529

3

52

The only arcs in the network are out of source nodes

We can stop the algorithm and identify the remaining cuts.

Page 28: 15.082 and 6.855J

28

Here are cuts 4 and 5

1

3

2 5

6

41

1

1

5

3

4

6

1

3

2 5

6

41

1

1

5

3

4

6

Cut 4 Cut 5

Page 29: 15.082 and 6.855J

29

The global min cut was cut number 2

0

5

4

3

2

1

2

4

5

6

1

31

3

2 5

6

41

1

1

5

3

4

6

The algorithm ends with the minimum cut with node 1 on the source side.