Push–relabel maximum flow algorithm: Difference between revisions

Content deleted Content added
Changed the markup language to "math" in the "Definitions and notations" section
Added new Initialization subsection to the Operations section. Performed minor updates.
Line 57:
 
===Operations===
 
====Initialization====
 
The algorithm starts by creating a residual graph, initializing the preflow values to zero and performing a set of saturating push operations on residual edges exiting the source, {{nowrap|(''s'', ''v'') where ''v'' ∈ ''V'' \ {''s''}}}. Similarly, the label heights are initialized such that the height at the source is in the number of vertices in the graph, {{nowrap|''h''(''s'') {{=}} {{!}}''V''{{!}}}}, and all other vertices are given a height of zero. Once the initialization is complete, the algorithm repeatedly performs either the push or relabel operations against active vertices until no applicable operation can performed.
 
====Push====
The push operation applies on an admissible out-edge {{nowrap|(''u'', ''v'')}} of an active vertex ''u'' in {{nowrap|''G<sub>f</sub>''}}. It moves {{nowrap|<math> \min\{'' e''(''u''), ''c<sub>f</sub>''c_f(''u'', ''v'')\}}} </math> units of flow from ''u'' to ''v''.
 
push(u, v):
Line 69 ⟶ 73:
e[v] += Δ
 
A push operation that causes {{nowrap|''f''(''u'', ''v'')}} to reach {{nowrap|''c''(''u'', ''v'')}} is called a ''saturating'' push; otherwise,since it uses up all the available capacity of the residual edge. Otherwise, all of the excess at the vertex is calledpushed anacross ''unsaturating''the pushresidual edge. AfterThis anis unsaturatingcalled push,an {{nowrap|''eunsaturating''( or ''unon-saturating'') {{=}} 0}}push.
 
====Relabel====
The relabel operation applies on an active vertex ''u'' without any admissible out-edges in {{nowrap|''G<sub>f</sub>''}}. It modifies {{nowrap|''h''(''u'')}} to the minimum value such that an admissible out-edge is created. Note that this always increases {{nowrap|''h''(''u'')}} and never creates a steep edge, which is (an edge {{nowrap|(''u'', ''v'')}} such that {{nowrap|''c<sub>f</sub>''(''u'', ''v'') > 0}}, and {{nowrap|''h''(''u'') > ''h''(''v'') + 1}}).
 
relabel(u):