FIFO preflow-push: Difference between revisions
Line 15: | Line 15: | ||
Conceptually, we may partition the iterations of the main loop into ''phases''. The first phase commences with the very first iteration. A new phase commences as soon as all nodes that were in <math>Q</math> at the beginning of the last phase, have been extracted once from <matH>Q</math>. Before and after each iteration, let <math>D</math> denote the maximum label <math>d(v)</math> of any active node <math>v\in V\setminus\{s,t\}</math>. In particular, it is always <math>0\leq D\leq 2n</math>. Clearly, only relabel operations can increase <math>D</math>, and the sum of all increases of <math>D</math>, taken over all relabel operations, cannot increase <math>D</math> by more than <math>2n</math> in total. | Conceptually, we may partition the iterations of the main loop into ''phases''. The first phase commences with the very first iteration. A new phase commences as soon as all nodes that were in <math>Q</math> at the beginning of the last phase, have been extracted once from <matH>Q</math>. Before and after each iteration, let <math>D</math> denote the maximum label <math>d(v)</math> of any active node <math>v\in V\setminus\{s,t\}</math>. In particular, it is always <math>0\leq D\leq 2n</math>. Clearly, only relabel operations can increase <math>D</math>, and the sum of all increases of <math>D</math>, taken over all relabel operations, cannot increase <math>D</math> by more than <math>2n</math> in total. | ||
This observation immediately implies that the number of phases in which at least one relabeling operation takes place, is in <math>\mathcal{O}(n^2)</math>. On the other hand, <math>D</math> is decreased in every iteration without relabel operation, because in this case, all excess is pushed from each active node to a node with smaller <math>d</math>-label. Due to the bound <math>\mathcal{O}(n)</math> on all increases of <math>D</math>, the number of ''de''creases of <math>D</math> and, hence, the number of phases without relabel operations is in <math>\mathcal{O}(n^2)</math> as well. The claim now follows from the observation that, in each phase, at most one non-saturating push is performed with each node because a non-saturating push makes a node inactive. | This observation immediately implies that the number of phases in which at least one relabeling operation takes place, is in <math>\mathcal{O}(n^2)</math>. On the other hand, <math>D</math> is decreased in every iteration without relabel operation, because in this case, all excess is pushed from each active node to a node with smaller <math>d</math>-label. Due to the bound <math>\mathcal{O}(n^2)</math> on all increases of <math>D</math>, the number of ''de''creases of <math>D</math> and, hence, the number of phases without relabel operations is in <math>\mathcal{O}(n^2)</math> as well. The claim now follows from the observation that, in each phase, at most one non-saturating push is performed with each node because a non-saturating push makes a node inactive. |
Revision as of 13:08, 10 November 2014
Abstract view
This is a specialization of the generic preflow-push algorithm:
- The set of all active nodes is stored in a FIFO queue [math]\displaystyle{ Q }[/math].
- Always choose the first node in [math]\displaystyle{ Q }[/math] (recall from the generic preflow-push that this node is not extracted from [math]\displaystyle{ Q }[/math] as long as it is active).
Complexity
Statement: The asymptotic complexity is in [math]\displaystyle{ \mathcal{O}(n^3) }[/math], where [math]\displaystyle{ n=|V| }[/math].
Proof: The complexity considerations for the generic preflow-push algorithm yield [math]\displaystyle{ \mathcal{O}(n^2) }[/math] relabel operations and [math]\displaystyle{ \mathcal{O}(n\!\cdot\!m)\subseteq\mathcal{O}(n^3) }[/math] saturating push operations, where [math]\displaystyle{ m=|A| }[/math]. There it was also shown that the total number of changes of outgoing arcs is in [math]\displaystyle{ \mathcal{O}(n^3) }[/math]. Hence, it remains to show that the total number of non-saturating push operations is in [math]\displaystyle{ \mathcal{O}(n^3) }[/math] as well.
Conceptually, we may partition the iterations of the main loop into phases. The first phase commences with the very first iteration. A new phase commences as soon as all nodes that were in [math]\displaystyle{ Q }[/math] at the beginning of the last phase, have been extracted once from [math]\displaystyle{ Q }[/math]. Before and after each iteration, let [math]\displaystyle{ D }[/math] denote the maximum label [math]\displaystyle{ d(v) }[/math] of any active node [math]\displaystyle{ v\in V\setminus\{s,t\} }[/math]. In particular, it is always [math]\displaystyle{ 0\leq D\leq 2n }[/math]. Clearly, only relabel operations can increase [math]\displaystyle{ D }[/math], and the sum of all increases of [math]\displaystyle{ D }[/math], taken over all relabel operations, cannot increase [math]\displaystyle{ D }[/math] by more than [math]\displaystyle{ 2n }[/math] in total.
This observation immediately implies that the number of phases in which at least one relabeling operation takes place, is in [math]\displaystyle{ \mathcal{O}(n^2) }[/math]. On the other hand, [math]\displaystyle{ D }[/math] is decreased in every iteration without relabel operation, because in this case, all excess is pushed from each active node to a node with smaller [math]\displaystyle{ d }[/math]-label. Due to the bound [math]\displaystyle{ \mathcal{O}(n^2) }[/math] on all increases of [math]\displaystyle{ D }[/math], the number of decreases of [math]\displaystyle{ D }[/math] and, hence, the number of phases without relabel operations is in [math]\displaystyle{ \mathcal{O}(n^2) }[/math] as well. The claim now follows from the observation that, in each phase, at most one non-saturating push is performed with each node because a non-saturating push makes a node inactive.