• Aucun résultat trouvé

Combinatorial Optimization and Graph Theory ORCO Execution of the Push-Relabel Algorithm

N/A
N/A
Protected

Academic year: 2022

Partager "Combinatorial Optimization and Graph Theory ORCO Execution of the Push-Relabel Algorithm"

Copied!
70
0
0

Texte intégral

(1)

Zolt´an Szigeti

(2)

1

4 t

s

2 4 3

4 b

Problem

Find in the network(D,g)ag-feasible (s,t)-flow ofmaximumvalue and an (s,t)-cut ofminimumcapacity!

(3)

(0,1)

(0,4) t

s

(0,2) (0,4) (3,3)

(4,4) b Initialization

Preflowx

(4)

(0,1)

(0,4) t

s

(0,2) (0,4) (3,3)

(4,4) b

s t

b Construction

Auxiliary graphDx

(5)

(0,1)

(0,4) t

s

(0,2) (0,4) (3,3)

(4,4) b

s t

b

0 0

4

Initialization

Labelling

(6)

(0,1)

(0,4) t

s

(0,2) (0,4) (3,3)

(4,4) b

s t

b

0 0

4

Looking for active vertex

fx(a) =dx(a)dx+(a)

= (3 + 0)(0 + 0) = 3>0

=ais x-active

(7)

(0,1)

(0,4) t

s

(0,2) (0,4) (3,3)

(4,4) b

s t

b

0 0

4

Looking for tight arc leaving a

ℓ(a) = 06= 1 =ℓ(b) + 1 =ℓ(t) + 1 6= 5 =(s) + 1

=no-tight arc leavingaexists

(8)

(0,1)

(0,4) t

s

(0,2) (0,4) (3,3)

(4,4) b

s t

b

0 0

4

Relabel at a

(a) = min{(v) + 1 :av Ax}

= min{0 + 1,0 + 1,4 + 1}= 1

(9)

(0,1)

(0,4) t

s

(0,2) (0,4) (3,3)

(4,4) b

s t

b

0 0

4

Relabel at a

(a) = min{(v) + 1 :av Ax}

= min{0 + 1,0 + 1,4 + 1}= 1

(10)

(0,1)

(0,4) t

s

(0,2) (0,4) (3,3)

(4,4) b

s t

b

0 0

4

Relabel at a

(a) = min{(v) + 1 :av Ax}

= min{0 + 1,0 + 1,4 + 1}= 1 arcatbecomes -tight

(11)

(0,1)

(0,4) t

s

(0,2) (0,4) (3,3)

(4,4) b

s t

b

0 0

4

Pushon at

ε =min{g(at),fx(a)}

= min{40 + 0,3}= 3 x(at)=x(at) +ε= 0 + 3 = 3 x(e) =x(e)∀eA\ {at}

(12)

(0,1)

(0,4) t

s

(0,2) (3,4) (3,3)

(4,4) b

Pushon at

ε =min{g(at),fx(a)}

= min{40 + 0,3}= 3 x(at)=x(at) +ε= 0 + 3 = 3 x(e) =x(e)∀eA\ {at}

ais notx-active anymore

(13)

(0,1)

(0,4) t

s

(0,2) (3,4) (3,3)

(4,4) b

Looking for active vertex

fx(b) =dx(b)dx+(b)

= (4 + 0)(0 + 0) = 4>0

=bisx-active

(14)

(0,1)

(0,4) t

s

(0,2) (3,4) (3,3)

(4,4) b

s t

b Construction

Auxiliary graphDx

(15)

(0,1)

(0,4) t

s

(0,2) (3,4) (3,3)

(4,4) b

s t

b

0 0

4

Previous labelling

(16)

(0,1)

(0,4) t

s

(0,2) (3,4) (3,3)

(4,4)

b 0

s t

b

0 4

Looking for tight arc leaving b

ℓ(b) = 06= 2 =ℓ(a) + 1 6= 1 =(t) + 1 6= 5 =(s) + 1

=no-tight arc leavingbexists

(17)

(0,1)

(0,4) t

s

(0,2) (3,4) (3,3)

(4,4)

b 0

s t

b

0 4

Relabel at b

(b) = min{(v) + 1 :bv Ax}

= min{1 + 1,0 + 1,4 + 1}= 1

(18)

(0,1)

(0,4) t

s

(0,2) (3,4) (3,3)

(4,4)

b 1

s t

b

0 4

Relabel at b

(b) = min{(v) + 1 :bv Ax}

= min{1 + 1,0 + 1,4 + 1}= 1

(19)

(0,1)

(0,4) t

s

(0,2) (3,4) (3,3)

(4,4)

b 1

s t

b

0 4

Relabel at b

(b) = min{(v) + 1 :bv Ax}

= min{1 + 1,0 + 1,4 + 1}= 1 arcbt becomes-tight

(20)

(0,1)

(0,4) t

s

(0,2) (3,4) (3,3)

(4,4)

b 1

s t

b

0 4

Pushon bt

ε =min{g(bt),fx(b)}

= min{20 + 0,4}= 2 x(bt)=x(bt) +ε= 0 + 2 = 2

(21)

(0,1)

(0,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

Pushon bt

ε =min{g(bt),fx(b)}

= min{20 + 0,4}= 2 x(bt)=x(bt) +ε= 0 + 2 = 2

(22)

(0,1)

(0,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

Pushon bt

ε =min{g(bt),fx(b)}

= min{20 + 0,4}= 2 x(bt)=x(bt) +ε= 0 + 2 = 2

bis stillx-active

(23)

(0,1)

(0,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

s t

b Construction

Auxiliary graphDx

(24)

(0,1)

(0,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

s t

b

0 1

4

Previous labelling

(25)

(0,1)

(0,4) t

s

(2,2) (3,4) (3,3)

(4,4)

b 1

s t

b

0 4

Looking for tight arc leaving b

ℓ(b) = 16= 2 =ℓ(a) + 1 6= 5 =(s) + 1

=no-tight arc leavingbexists

(26)

(0,1)

(0,4) t

s

(2,2) (3,4) (3,3)

(4,4)

b 1

s t

b

0 4

Relabel at b

(b) = min{(v) + 1 :bv Ax}

= min{1 + 1,4 + 1}= 2

(27)

(0,1)

(0,4) t

s

(2,2) (3,4) (3,3)

(4,4)

b 2

s t

b

0 4

Relabel at b

(b) = min{(v) + 1 :bv Ax}

= min{1 + 1,4 + 1}= 2

(28)

(0,1)

(0,4) t

s

(2,2) (3,4) (3,3)

(4,4)

b 2

s t

b

0 4

Relabel at b

(b) = min{(v) + 1 :bv Ax}

= min{1 + 1,4 + 1}= 2 arcbabecomes-tight

(29)

(0,1)

(0,4) t

s

(2,2) (3,4) (3,3)

(4,4)

b 2

s t

b

0 4

Pushon ba

ε =min{g(ba),fx(b)}

= min{40 + 0,2}= 2 ε =min{x(ab), ε}= min{0,2}= 0 x(ba)=x(ba) +εε = 0+2−0 = 2 x(ab)=x(ab)ε= 00 = 0

(30)

(0,1)

(2,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

Pushon ba

ε =min{g(ba),fx(b)}

= min{40 + 0,2}= 2 ε =min{x(ab), ε}= min{0,2}= 0 x(ba)=x(ba) +εε = 0+2−0 = 2 x(ab)=x(ab)ε= 00 = 0

(31)

(0,1)

(2,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

Pushon ba

ε =min{g(ba),fx(b)}

= min{40 + 0,2}= 2 ε =min{x(ab), ε}= min{0,2}= 0 x(ba)=x(ba) +εε = 0+2−0 = 2 x(ab)=x(ab)ε= 00 = 0

(32)

(0,1)

(2,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

Looking for active vertex

fx(a) =d

x(a)d+

x(a)

= (3 + 2)(3 + 0) = 2>0

=ais x-active

(33)

(0,1)

(2,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

s t

b Construction

Auxiliary graphDx

(34)

(0,1)

(2,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

s t

b

0 2

4

Previous labelling

(35)

(0,1)

(2,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

s t

b

0 2

4

Looking for tight arc leaving a

ℓ(a) = 1 =ℓ(t) + 1

(36)

(0,1)

(2,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

s t

b

0 2

4

Looking for tight arc leaving a

ℓ(a) = 1 =ℓ(t) + 1

=arcatis -tight

(37)

(0,1)

(2,4) t

s

(2,2) (3,4) (3,3)

(4,4) b

s t

b

0 2

4

Pushon at

ε =min{g(at),fx(a)}

= min{43 + 0,2}= 1 x(at)=x(at) +ε= 3 + 1 = 4

(38)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

Pushon at

ε =min{g(at),fx(a)}

= min{43 + 0,2}= 1 x(at)=x(at) +ε= 3 + 1 = 4

(39)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

Pushon at

ε =min{g(at),fx(a)}

= min{43 + 0,2}= 1 x(at)=x(at) +ε= 3 + 1 = 4 ais stillx-active

(40)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

s t

b Construction

Auxiliary graphDx

(41)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

s t

b

0 2

4

Previous labelling

(42)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

s t

b

0 2

4

Looking for tight arc leaving a

ℓ(a) = 16= 3 =ℓ(b) + 1 6= 5 =(s) + 1

=no-tight arc leavingaexists

(43)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

s t

b

0 2

4

Relabel at a

(a) = min{(v) + 1 :av Ax}

= min{2 + 1,4 + 1}= 3

(44)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

s t

b

0 2

4

Relabel at a

(a) = min{(v) + 1 :av Ax}

= min{2 + 1,4 + 1}= 3

(45)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

s t

b

0 2

4

Relabel at a

(a) = min{(v) + 1 :av Ax}

= min{2 + 1,4 + 1}= 3 arcabbecomes-tight

(46)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

s t

b

0 2

4

Pushon ab

ε =min{g(ab),fx(a)}

= min{10 + 2,1}= 1 ε =min{x(ba), ε}= min{2,1}= 1 x(ab)=x(ab) +εε= 0 + 1-1 = 0 x(ba)=x(ba)ε= 21 = 1

(47)

(0,1)

(1,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

Pushon ab

ε =min{g(ab),fx(a)}

= min{10 + 2,1}= 1 ε =min{x(ba), ε}= min{2,1}= 1 x(ab)=x(ab) +εε= 0 + 1-1 = 0 x(ba)=x(ba)ε= 21 = 1

(48)

(0,1)

(1,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

Pushon ab

ε =min{g(ab),fx(a)}

= min{10 + 2,1}= 1 ε =min{x(ba), ε}= min{2,1}= 1 x(ab)=x(ab) +εε= 0 + 1-1 = 0 x(ba)=x(ba)ε= 21 = 1

ais notx-active anymore

(49)

(0,1)

(1,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

Looking for active vertex

fx(b) =d

x(b)d+

x(b)

= (4 + 0)(1 + 2) = 1>0

=bisx-active

(50)

(0,1)

(1,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

s t

b Construction

Auxiliary graphDx

(51)

(0,1)

(1,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

s t

b

0 2

4

Previous labelling

(52)

(0,1)

(1,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 2

s t

b

0 4

Looking for tight arc leaving b

ℓ(b) = 26= 4 =ℓ(a) + 1 6= 5 =(s) + 1

=no-tight arc leavingbexists

(53)

(0,1)

(1,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 2

s t

b

0 4

Relabel at b

(b) = min{(v) + 1 :bv Ax}

= min{3 + 1,4 + 1}= 4

(54)

(0,1)

(1,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 4

s t

b

0 4

Relabel at b

(b) = min{(v) + 1 :bv Ax}

= min{3 + 1,4 + 1}= 4

(55)

(0,1)

(1,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 4

s t

b

0 4

Relabel at b

(b) = min{(v) + 1 :bv Ax}

= min{3 + 1,4 + 1}= 4 arcbabecomes-tight

(56)

(0,1)

(1,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 4

s t

b

0 4

Pushon ba

ε =min{g(ba),fx(b)}

= min{41 + 0,1}= 1 ε =min{x(ab), ε}= min{0,1}= 0 x(ba)=x(ba) +εε = 1 + 1-0 = 2 x(ab)=x(ab)ε= 00 = 0

(57)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

Pushon ba

ε =min{g(ba),fx(b)}

= min{41 + 0,1}= 1 ε =min{x(ab), ε}= min{0,1}= 0 x(ba)=x(ba) +εε = 1 + 1-0 = 2 x(ab)=x(ab)ε= 00 = 0

(58)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

Pushon ba

ε =min{g(ba),fx(b)}

= min{41 + 0,1}= 1 ε =min{x(ab), ε}= min{0,1}= 0 x(ba)=x(ba) +εε = 1 + 1-0 = 2 x(ab)=x(ab)ε= 00 = 0

bis notx-active anymore

(59)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

Looking for active vertex

fx(a) =d

x(a)d+

x(a)

= (3 + 2)(4 + 0) = 1>0

=ais x-active

(60)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4) b

s t

b Construction

Auxiliary graphDx

(61)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 4

s t

b

0 4

Previous labelling

(62)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 4

s t

b

0 4

Looking for tight arc leaving a

ℓ(a) = 36= 5 =ℓ(b) + 1 6= 5 =(s) + 1

=no-tight arc leavingaexists

(63)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 4

s t

b

0 4

Relabel at a

(a) = min{(v) + 1 :av Ax}

= min{4 + 1,4 + 1}= 5

(64)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 4

s t

b

0 4

Relabel at a

(a) = min{(v) + 1 :av Ax}

= min{4 + 1,4 + 1}= 5

(65)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 4

s t

b

0 4

Relabel at a

(a) = min{(v) + 1 :av Ax}

= min{4 + 1,4 + 1}= 5 arcas becomes-tight

(66)

(0,1)

(2,4) t

s

(2,2) (4,4) (3,3)

(4,4)

b 4

s t

b

0 4

Pushon as

ε =min{g(as),fx(a)}

= min{00 + 3,1}= 1 ε =min{x(sa), ε}= min{3,1}= 1 x(sa)=x(sa)ε= 31 = 2

(67)

(0,1)

(2,4) t

s

(2,2) (4,4) (2,3)

(4,4) b

Pushon as

ε =min{g(as),fx(a)}

= min{00 + 3,1}= 1 ε =min{x(sa), ε}= min{3,1}= 1 x(sa)=x(sa)ε= 31 = 2

(68)

(0,1)

(2,4) t

s

(2,2) (4,4) (2,3)

(4,4) b

Pushon as

ε =min{g(as),fx(a)}

= min{00 + 3,1}= 1 ε =min{x(sa), ε}= min{3,1}= 1 x(sa)=x(sa)ε= 31 = 2

Looking for active vertex

(69)

(0,1)

(2,4) t

s

(2,2) (4,4) (2,3)

(4,4) b

Optimal flow

=x is ag-feasible(s,t)-flow of maximum value

(70)

s (2,4) (0,1) t (2,2) (4,4) (2,3)

(4,4) b

s

4

t

b

0 4

Optimal flow

=x is ag-feasible(s,t)-flow of maximum value

Optimal cut

does not take1

Z ={v :ℓ(v)>1} is an(s,t)-cut of minimum capacity

Références

Documents relatifs

Abstract We investigate the push-relabel algorithm for solving the problem of finding a maximum cardinality matching in a bipartite graph in the context of the maximum

Our main motivation is the problem of finding a maximum transversal, i.e., obtaining a maximum number of nonzeros in the diagonal of a sparse matrix by permuting its rows and

In the G-PR-K RNL kernel, the proposed parallel push- relabel-based algorithm uses n GPU threads to traverse the active column vertices. However, thanks to the initial

Ex- perimental results on five instances show that when compared to the results obtained from the state-of-the-art methods that used weighted summation approach, the proposed

Figure 4: Small extracts of the OCR results obtained on scanned document images: (a) input image (no restoration); (b) k-means segmentation + restoration; (c) single MRF

Approximation of preferred solutions for decision models refining Pareto

1 Since the algorithm BFS is executed in Step 2, the algorithm always augments the flow on a shortest (s, t)-path in G x. 2 If the algorithm BFS is replaced in Step 2 by an

Advantage: local operation, not like flow augmentation. Disadvantage: does not preserve