Rerouting flows when links fail

We introduce and investigate reroutable flows, a robust version of network flows in which link failures can be mitigated by rerouting the affected flow. Given a capacitated network, a path flow is reroutable if after failure of an arbitrary arc, we can reroute the interrupted flow from the tail of that arc to the sink, without modifying the flow that is not affected by the failure. Similar types of restoration, which are often termed"local", were previously investigated in the context of network design, such as min-cost capacity planning. In this paper, our interest is in computing maximum flows under this robustness assumption. An important new feature of our model, distinguishing it from existing max robust flow models, is that no flow can get lost in the network. We also study a tightening of reroutable flows, called strictly reroutable flows, making more restrictive assumptions on the capacities available for rerouting. For both variants, we devise a reroutable-flow equivalent of an s-t-cut and show that the corresponding max flow/min cut gap is bounded by 2. It turns out that a strictly reroutable flow of maximum value can be found using a compact LP formulation, whereas the problem of finding a maximum reroutable flow is NP-hard, even when all capacities are in {1, 2}. However, the tightening can be used to get a 2-approximation for reroutable flows. This ratio is tight in general networks, but we show that in the case of unit capacities, every reroutable flow can be transformed into a strictly reroutable flow of same value. While it is NP-hard to compute a maximal integral flow even for unit capacities, we devise a surprisingly simple combinatorial algorithm that finds a half-integral strictly reroutable flow of value 1, or certifies that no such solutions exits. Finally, we also give a hardness result for the case of multiple arc failures.


Introduction
Network infrastructures for transportation, communication, or energy transmission are an important backbone of our society. However, they are also prone to failure or intentional sabotage, and in such cases it is desirable to quickly recover the service provided through the network. A crucial frequent requirement of actual network restoration techniques is that restoration is handled locally [16]. As a motivating example, consider a communication network in which data packets are routed along paths. When a link in the network fails, it is desirable to only reroute the traffic that is actually affected by the failure, i.e., those paths that traverse the failing link, without changing or rerouting any part of the flow that is not affected by the failure. Note that arbitrary rearrangement of the flow after a failure is in general more powerful, but it is both undesirable to interrupt customer service and hard to do so reliably and safely [11,20].
To cope with such a situation, we introduce the concept of reroutable network flows: A flow on s-t-paths is reroutable if after failure of any arcā = (v,w) in the network, we can reroute all flow that was traversingā fromv to the sink t, while not changing any flow that was not affected by the interruption. Similar concepts were previously discussed in a few other papers [8,9,22,23], but with an emphasis on network design issues, e.g., minimizing the cost of the installed capacity. In contrast, our interest is in computing maximum flows (but we point out that a potential application are feasibility/separation subroutines for capacity reservation). Note that in this setting, we cannot simply send a standard maximum flow, as we need to leave space for rerouting. Before we discuss our findings and better relate them to existing literature, let us formalize the definition of our model.
Network flows Let D = (V, A) be a digraph with source s ∈ V , a sink t ∈ V and arc capacities u ∈ R A + . Let P ⊆ 2 A be the set of simple 1 s-t-paths in D. For arcs a,ā ∈ A, define P a := {P ∈ P : a ∈ P } and Pā →a := {P ∈ P : a,ā ∈ P,ā ≺ P a}, whereā ≺ P a means that P traversesā before a. An s-t-flow is a vector x ∈ R P + that assigns a flow value x(P ) ≥ 0 to each P ∈ P such that the arc flow values x(a) := P ∈Pa x(P ) fulfill the capacity constraint x(a) ≤ u(a) for all a ∈ A. The value of a flow x is val(x) := P ∈P x(P ).
Reroutable flows Let x be an s-t-flow. If an arcā = (v,w) ∈ A fails, all flow on paths containing the failing arc gets interrupted when it reachesv. For any a ∈ A \ {ā}, we define the available capacity of a after failure ofā bȳ A rerouting of x for the failing arcā is av-t-flow xā of value x(ā) in (V, A \ {ā}) with capacitiesū x,ā . The flow x is reroutable if for every failing arcā ∈ A there is a rerouting xā of x.
Strictly reroutable flows A rerouting xā of a flow x for a failing arcā is strict if xā(a) ≤ū x (a) := u(a) − x(a) for every a ∈ A \ {ā}. We say that x is strictly reroutable if for every failing arcā ∈ A there is a strict rerouting of x.
Strictly reroutable flows are both a helpful tool for computing reroutable flows and interesting in their own right, in situations where more conservative assumptions have to be made on the capacities available for rerouting. A natural question is what is the maximum flow value that can be sent by a (strictly) reroutable flow in a given network. We denote the corresponding optimization problem as Max RF and Max SRF, respectively.
Path flows vs. arc flows Our reroutable flow model is defined for path flows, which is a common assumption in many robust flow models [2,4,15,19]. It is well-known that network flows allow for two different representations: By specifying a value for each path, as is done in this paper, or by specifying the flow on each arc and requiring flow conservation at each node of the network. Arc flow values can easily be obtained from a given path flow. Conversely, every arc flow can be decomposed into flow on paths, but in general this decomposition is not unique; see, e.g., [3]. There are flow problems where the path decomposition does not play a role, e.g., the maximum flow problem or the minimum cost flow problem, and others where it does, e.g., robust flows [4], length-bounded flows [5], or the computation of earliest arrival flows [21]. For our model, it turns out that Max RF falls into the first category, whereas Max SRF falls into the second.

Our results
Complexity of the problems (Sections 2.1 and 2.2) We observe that Max SRF can be solved in polynomial time by formulating it as a linear program. In contrast, Max RF is NP -hard, even when u(a) ∈ {1, 2} for all a ∈ A. On the positive side, by showing that the maximum value of a reroutable flow is at most twice as large as the maximum value of a strictly reroutable flow, we obtain a 2-approximation for Max RF for arbitrary capacities. The problem can further be solved exactly in unit capacity networks (see below).
Max flow/min cut gap (Section 2.3) Max flow/min cut results play a central role in network flow theory. We devise a combinatorial upper bound for the maximum reroutable flow value, called R-cut, and prove that the corresponding flow/cut gap for both reroutable and strictly reroutable flows is bounded by 2. In fact, our proof is constructive and provides a combinatorial 2-approximation algorithm for the minimum capacity R-cut problem.
Unit capacity networks (Section 3) We consider the case of unit capacities. It turns out that in this case, Max RF and Max SRF are equivalent. Our proof is based on a careful uncrossing argument that allows to transform any reroutable flow into a strictly reroutable flow.
Computing (half-)integral solutions (Section 4) A common property of many flow problems is the existence of an integral optimal solution when capacities are integral. In the case of reroutable flows, this property does not hold. In fact, if we require flow to be integral, the problem becomes NP -hard, even for sending a single unit of flow in a unit capacity network. However, for this special case, we devise a simple combinatorial algorithm that computes a half-integral solution or certifies that no flow of value 1 exists. Via our max flow/min cut analysis we also show how to compute 2-approximate half-integral solutions.
Multiple arc failures (Section 5.3) We consider the natural generalization of our problems to multiple simultaneous arc-failures. We show that in this case both variants of the problem are NP -hard, even when only two arcs can fail and all arcs have unit capacity. All hardness results in this paper are based on reduction from an intermediary problem, called Forbidden Pairs s-t-Path. They are therefore grouped together in Section 5.

Related work
As we already pointed out above, "local" rerouting schemes, i.e., schemes that only change flow affected by the failure, have been investigated in network design. A routing scheme in which flow has to be sent along arc-disjoint paths was investigated in [8], see also [23]. The problem of finding a local rerouting from the tail to the head of a failed arc was investigated in [9] and [22]. However, in all these papers the focus was on min-cost capacity planning.
Concepts that deal with the maximization of flow subject to robustness constraints commonly fall under the moniker of robust flows. Aggarwal and Orlin [2] studied k-route flows. Such a flow is a conic combination of elementary flows, each of which consists of a uniform flow along k disjoint paths. Because of this structure, the failure of any arc can only destroy a 1/k fraction of the flow. A maximum k-route flow can be computed in polynomial time by means of a parametric max flow problem. Another classic model is the maximum robust flow problem: Here, the goal is to find a path flow that maximizes the surviving flow after a worst-case failure of k arcs. Aneja et al. [4] showed that for k = 1 both an optimal fractional and an optimal integral solution can be found in polynomial time. If k is not bounded by a constant the problem is NPhard [12], but the complexity for any constant value k ≥ 2 is open. Bertsimas et al. [6] provide an Ω(1/k)-approximation algorithm for the maximum robust flow. Robust flows are closely related to network flow interdiction, which takes a dual perspective: The goal is to find a subset of arcs whose removal minimizes the maximum flow value in the remaining network; see the recent article by Chestnut and Zenklusen [10] for an up-to-date overview of this topic.
To the best of our knowledge, the only other flow maximization model that allows for adjustment after the failure are adaptive flows, first introduced by Bertsimas et al. [7]: In the first step, an arc flow is specified. After failure of k arcs, a new flow is sent, with the flow value on every arc being bounded by the original flow value. Note that adaptive flows differ from reroutable flows in two important aspects: Adaptive flows allow flow to be 'lost' (the flow value after the failure is lower than the original flow value), whereas in reroutable flows all flow has to reach the sink. Furthermore, adaptive flows can reconfigure the flow in the entire network, whereas in reroutable flows, only the flow affected by the failure can be rerouted.
Another model closely related to reroutable flows is the online replacement path problem (ORP) introduced by Adjiashvili et al. [1]. The ORP is a generalization of the shortest path problem: Given a digraph with costs on the arcs, we have to specify an s-t-path. Along the path, we may encounter a failing arc ā = {v,w}, and we have to find a replacement path fromv to t avoidingā. The goal is to minimize the total traveled distance, assumingā is chosen by an adversary. Adjiashvili et al. [1] show that the ORP can be solved in polynomial time, even when a constant number of arcs fail.

LP formulation, approximation, and max flow/min cut
In this section, we discuss the complexity of the two problems and provide bounds on the gap between Max RF and Max SRF. We also introduce an analogue to minimum cuts for reroutable flows and bound the corresponding duality gap. At the end of the section, we show that all our bounds are tight.

Complexity of Max RF and Max SRF
We now consider an LP formulation for Max SRF. Forā ∈ A, let R(ā) be the set of all tail(ā)-t-paths in (V, A \ {ā}), which are exactly the paths that a rerouting for failing arcā can use.
The first set of constraints bound the capacities for each rerouting; note in particular that forā = a, the second term becomes 0, ensuring x(a) ≤ u(a) for all a ∈ A. The second set of constraints ensures that the rerouting flow xā has value x(ā).
For our discussion, it will also be useful to consider the dual of [LP strict ]. We introduce dual variables yā(a) for every a,ā ∈ A and z(ā) for everyā ∈ A. Proof. We observe that the separation problem to [D-LP strict ] can be solved by a sequence of shortest path computations: Consider a point y, z. A violation of the first set of constraints can be detected by computing the shortest s-t-paths with respect to arc costs c y,z (a) := z(a) + ā∈A yā(a). If the shortest path has cost smaller than 1, it corresponds to a violated inequality, otherwise y, z fulfills the inequalities. A violation of the second set of constraints can be detected by computing a shortest tail(ā)-t-path for everyā ∈ A with respect to arc costs yā(a). If the shortest path for someā has cost smaller than z(ā) the constraint is violated for that path. Otherwise y, z fulfills the inequalities.
Hence we can obtain an optimal solution for [D-LP strict ] using the equivalence of optimization and separation. By restricting [LP strict ] to the paths corresponding to inequalities generated during the solution of the dual, we obtain a primal solution of equal value.

Remark 2.
An alternative way to obtain a polynomial algorithm for Max SRF is to observe that the capacitiesū x (a) = u(a) − x(a) available for strict rerouting only depend on the arc flow values. Hence, we can formulate Max SRF as a compact LP with arc flow variables. Then any path decomposition of the resulting arc flow is a maximum strictly reroutable flow.
For the special case of unit capacity networks, we show in Section 3 that an optimal solution to [LP strict ] is also optimal for Max RF. An LP formulation for Max RF can be obtained by replacing the term P ∈Pa x(P ) by P ∈Pā→a x(P ) in the capacity constraints of [LP strict ]. Unfortunately, this modification prevents the dual separation approach from working. In fact, it turns out that Max RF is hard as soon as two different capacities occur. The proof of this result is discussed in Section 5.1.

Reroutable flows vs. strictly reroutable flows
As Max SRF is a tightening of Max RF, the optimal value of the former is at most that of the latter. We show that the gap between the two values cannot be larger than 2. As we can compute maximum strictly reroutable flows, we obatain a 2-approximation for Max RF.
Lemma 5. Let x be an s-t-flow. If x is strictly reroutable, then x is reroutable. If x is reroutable, then 1 2 x is strictly reroutable. Proof. The first statement follows from the fact thatū x,ā (a) ≥ū x (a) for all a, a ∈ A \ {ā}. For the proof of the second statement, assume x is reroutable and consider anyā = (v,w) ∈ A. Letxā be the rerouting of x in case of failure ofā. Now observe that 1 2xā is a strict rerouting of 1 2 x in case of failure ofā, because it is av-t-flow of value 1 2 x(ā) and where the second inequality follows from P ∈Pā→a x(P ) ≤ u(a).

Corollary 6.
There is a 2-approximation algorithm for Max RF.

Max flow/min cut gap for reroutable flows
An s-t-cut is a set of arcs that intersects every s-t-path. Its capacity is the sum of capacities of its arcs. A fundamental result in network flow theory is that the value of a maximum s-t-flow is equal to the capacity of a minimum s-t-cut. This result has been successfully generalized to many variants of network flows, such as abstract flows [17] or flows over time [13]. However, in other cases, such as multicommodity flows, the equality does not hold and instead, researchers investigate the worst case ratio between maximum flow and minimum cut; see, e.g., [18]. We present a counterpart to an s-t-cut for reroutable flows. It turns out that max flow and min cut are not necessarily equal and we give a tight bound on the corresponding max flow/min cut gap. An R-cut is a set of arcs R ⊆ A together with a collection of cuts (C a ) a∈R , where each C a is a tail(a)-t-cut containing a. We denote (R, (C a ) a∈R ) by (R, C) for short. The capacity of the R-cut The intuition behind this definition is the following: For every a ∈ R, all flow that crossed the cut C a must cross the C a \ {a} if a fails. If a flow path does not cross any cut in C a , then it crosses the minimum s-t-cut in (V, A \ ∪ a∈R C a ). Therefore the capacity of an R-cut is an upper bound on the value of any reroutable flow. Proof. Let a ∈ R. As C a is a tail(a)-t-cut, x(a) units of flow have to be rerouted across the arcs in C a \ {a} when a fails. Therefore At the end of this section, we further show that R-cuts correspond to integral solutions to [D-LP strict ]. We now give a constructive proof bounding the duality gap between maximum strictly reroutable flow and minimum R-cut (or, equivalently, the integrality gap of the dual LP). In Section 2.4 we give an example showing that the bound is tight.
Theorem 8. Let x be a strictly reroutable flow of maximum value and let (R, C) be an R-cut of minimum capacity. Then val(x) ≥ 1 2 cap(R, C). Proof. For a ∈ A, let C a be minimum tail(a)-t-cut in D containing a and define u ′ (a) := min{u(a), u(C a \ {a})}. Let C ′ be a minimum s-t-cut in D with respect to the capacities u ′ and let x ′ be a corresponding maximum flow. Now define R := {a ∈ C ′ : u ′ (a) < u(a)}. Observe that R and (C a ) a∈R define an R-cut and that φ(R, C) ≤ u(C ′ \ R). We obtain Now let x := x ′ /2. It is sufficient to show that x is a strictly reroutable flow. By contradiction assume that there isā ∈ A for which there is no strict rerouting of x. By the max flow/min cut theorem, there must be a tail(ā)-t-cutC in However, this implies thatC ∪ {ā} is a smaller tail(ā)-t-cut than Cā, a contradiction.
Computing a minimum capacity R-cut Let us denote the problem of finding an R-cut of minimum capacity by Min R-Cut. The proof of Theorem 8 describes how to compute a 2-approximate solution to this problem.
There is a 2-approximation algorithm for Min R-Cut.
Proof. For every a ∈ A the capacity u ′ (a) and the corresponding cut C a can be computed by a standard minimum s-t-cut computation. Given the values of u ′ , also C ′ can be computed by a min cut computation.

R-cuts and integral dual solutions
As mentioned above, R-cuts correspond to integral solutions of [D-LP strict ]. We give a formal argument of this correspondence. Given an R-cut (R, C), let C * be a minimum s-t-cut in (V, A \ a∈R C a ). We set z(ā) := 1 for everyā ∈ R, yā(a) := 1 for every a ∈ Cā, and y a (a) := 1 for every a ∈ C * . All other variables are set to 0. It is easy to check that y, z corresponds to a feasible solution to [D-LP strict ] with objective value cap(R, C).
Conversely, consider an integral dual solution y, z. Note that we can assume that all variables take values in {0, 1}: If z(a) < 0 we can set it to 0 without losing feasibility. If any variable is takes a value larger than 1, we can reduce it to 1 without losing feasibility. Let R := {ā ∈ A : z(ā) = 1}. By the second set of constraints, for everyā ∈ R, every tail(ā)-t path must be covered, i.e., there must be a tail(ā)-t-cut Cā with yā(a) = 1 for all a ∈ Cā \ {ā}. By the first set of constraints, for every P ∈ P there is an a ∈ P such that either z(a) = 1 or yā(a) = 1 for someā ∈ A. Thus the support of y contains an s-t-cut in (V, A \ a∈R C a ). We conclude that cap(R, C) is at most the objective value of the solution y, z.

Summary of the bounds and tightness
Putting the bounds from Lemma 5 and Theorem 8 together, we obtain the following corollary.
Corollary 10. Let (R, C) be a minimum capacity R-cut and let x RF and x SRF be maximal reroutable and strictly reroutable flows, respectively. Then The following gadget will be useful throughout the paper in order to construct examples and reductions. Note that x(a ′ ) = x(a ′′ ) = 0 for any reroutable flow, because when a ′′ fails, there is no tail(a ′′ )-t-path for rerouting the flow on that arc. A bidirected backup link between v and w consists of two distinct backup links, one from v to w and one from w to v. Fig. 1 shows that the bounds given in Lemma 5 and Theorem 8 are tight. Note that any reroutable flow is completely determined by the value x(P ) it sends along the path P := {a 1 , a 2 , a 3 }, as backup links can only be used for rerouting.

Tightness of bounds The network depicted in
1. For the bound on gap between max reroutable flow and max strictly reroutable flow, we set the capacities u(a 1 ) = 2 and u(a) = 1 for all a ∈ A \ {a 1 }. We show that x(P ) = 1 defines a reroutable flow. Failure of a 2 is not a problem, as tail(a 2 ) has a backup link to t. If a 3 fails, flow can use the backup link to s and traverse a 1 , asū x,a3 (a 1 ) = 2 − x(a 1 ) = 1, to reach the backup link from tail(a 2 ) to t. If a 1 fails, flow can be rerouted from s using the backup link and the arc a 3 , as a 1 ≺ P a 3 and thusū x,a1 (a 3 ) = 1. However, in a strictly reroutable flow, this last rerouting is no longer possible, asū x (a 3 ) = 1 − x(a 3 ). Hence, 1 ≥ x(a 1 ) + x(a 3 ) = 2x(P ) for any strictly reroutable flow x. The maximum strictly reroutable flow value therefore is 1/2.
2. For the bound on the flow/cut gap, set all capacities to 1. Then both the maximum reroutable flow value and the maximum strictly reroutable flow value are 1/2. Consider any R-cut (R, C). As capacities are integral, cap(R, C) ≥ 1. An R-cut with cap(R, C) = 1 is, e.g., R := {a 3 } and C a3 := {a 1 , a 3 }.
Note that Fig. 1 also shows that optimal solutions to both Max RF and Max SRF can be fractional, even when capacities are integral.
Remark 11. Note that the worst-case for the bounds in Corollary 10 cannot be attained simultaneously, i.e., in any given instance either the max flow/min cut gap or the gap between reroutable and strictly reroutable flow has to be significantly smaller than 2-in fact, at least one of them has to be within √ 2.

Unit capacity networks
Throughout this section, we assume u ≡ 1. We will show that in this case, any reroutable flow can be transformed into a strictly reroutable flow of the same value. While this closes the gap between the two reroutable flow variants, note Proof. We first show sufficiency of the condition. By contradiction assume that a∈C (1 − x(a)) ≥ 1 for all C ∈ C but x is not strictly reroutable. Because x is not strictly reroutable, there must be an arcā ∈ A such that there is no rerouting of x forā. This means that the maximum flow value that can be sent in (V, A \ {ā}) with capacitiesū x fromv := tail(ā) to t is strictly smaller than x(ā). By max flow/min cut, this implies there is av-t-cut C ∈ C with a∈C\{ā}ū x (a) < x(ā), which implies a∈C 1 − x(a) < 1, contradicting our initial assumption.
To see necessity, assume x is a strictly reroutable flow and let C ∈ C be any t-separating cut. Now letā ∈ C. Since x is strictly reroutable, there is an tail(ā)-t-flow of value x(ā) in (V, A \ {ā}) with capacitesū x . By max flow/min cut this implies a∈C\{ā}ū x (a) ≥ x(ā).
In the following, we identify those cuts that might violate the condition given in Lemma 12 for a (non-strictly) reroutable flow. We then show that this class of cuts forms a semi-lattice. This allows us to apply an uncrossing of the flow paths that iteratively eliminates the problematic cuts while maintaining reroutability.
Bad cuts Let x be an s-t-flow and let C ∈ C be a t-separating cut. An arc a ∈ C is (x, C)-bad if there is an arc a ∈ C and a path P ∈ Pā →a with x(P ) > 0. A cut C is x-bad if all arcsā ∈ C are (x, C)-bad.
Lemma 13. Let x be a reroutable flow for capacities u ≡ 1. Let C ∈ C be a t-separating cut. If a∈C (1 − x(a)) < 1 then C is x-bad.
Proof. By contradiction assume C is not x-bad. Then there must be an arc a ∈ C that is not (x, C)-bad. This implies that P ∈Pā→a x(P ) = 0 for every a ∈ C \ {ā}. In particular,ū x,ā (a) =ū x (a) = 1 − x(a) for all a ∈ C \ {ā}. Since all flow in the rerouting of x for failure ofā needs to cross C \ {ā}, we obtain a∈C\{ā}ū x,ā (a) ≥ x(ā). Adding 1 − x(ā) to both sides of this inequality yields a contradiction.
Lemma 14. Let x be a flow and let S, S ′ ∈ S be such that δ + (S) and δ + (S ′ ) are both x-bad. Then δ + (S ∪ S ′ ) is an x-bad t-separating cut as well.
Uncrossing paths Let P ∈ P. For two nodes v, w ∈ V visited by P (in that order), we let P [v, w] denote the subpath of path P starting at v and ending at w. Given another path Q ∈ P and an arc a ∈ P ∩ Q, let P × a Q be a simple s-t-path in the concatenation of P Proof. W.l.o.g., assume that x minimizes a∈A x(a) among all reroutable flows x ′ with val(x ′ ) = val(x) and x ′ (a) ≤ x(a) for all a ∈ A (if this is not the case, we can replace x by the flow minimizing the total arc flow).
Define S ′ := {S ∈ S : δ + (S) is an x-bad cut}. If S ′ = ∅, Lemmas 12 and 13 imply that x is strictly reroutable and we are done. Thus assume S ′ = ∅ and define S * := S∈S ′ S and C * := δ + (S * ). Note that Lemma 14 implies S * ∈ S ′ , and that further, by construction, S * defines the rightmost bad cut, i.e., no cut δ + (S) for S ∈ S with S \ S * = ∅ is x-bad.
Next we construct a digraph H = (V H , A H ) as follows. We let V H := C * , i.e., the nodes of H are the arcs of C * . For every pair of distinct arcs a, a ′ ∈ C * , we introduce the arc (a, a ′ ) in A H if and only if there is a path P ∈ supp(x)∩P a→a ′ such that a ′ is the last arc of C * on P . Observe that, because C * is x-bad, every node of H has an outgoing arc. Hence H contains a simple directed cycle Z. Let a 1 , . . . , a k ∈ C * be the arcs corresponding to the nodes of the cycle Z, and let P 1 , . . . , P k ∈ supp(x) be paths corresponding to the arcs of Z, i.e., the paths fulfill that arc a i is the last arc of P i that crosses C * , and a i ∈ P i ∩ P i+1 for each i ∈ {1, . . . , k} (for ease of notation we identify i and j if i ≡ j mod k). Now define P ′ i := P i+1 × ai P i for i ∈ [k]. Let ε := min i x(P i ); see Fig. 2 for an illustration. We construct a new flow x ′ as follows: Figure 2: Uncrossing of paths on a bad cut.
We show that x ′ is also a reroutable flow. First observe that val(x ′ ) = val(x) and that x ′ (a) ≤ x(a) for all a ∈ A. Now letā ∈ A and let S ⊆ V \ {t} with tail(ā) ∈ S and define C := δ + (S). First observe that if S \ S * = ∅, then C is not x-bad and therefore a∈C (1 − x ′ (a)) ≥ a∈C (1 − x(a)) ≥ 1 by Lemma 13, implying a∈C\{ā}ū x ′ ,ā (a) ≥ x ′ (ā), and therefore x ′ is reroutable. Thus we consider the case S ⊆ S * . We will show that in this caseū x ′ ,ā (a) ≥ū x,ā (a) for all a ∈ C, and therefore x ′ is again reroutable. To this end, observe that the definition ofū x,ā implies We show that i ∈ I ′ implies i + 1 ∈ I and therefore |I| ≥ |I ′ |, which proves our claim. Consider any i ∈ I ′ . We observe that a ∈ P i+1 [s, head(a i )], as tail(a) ∈ S ⊆ S * and no arc in P i [head(a i ), t] has its tail in S * (recall that a i is the last arc of P i crossing C * ). This further implies that P i+1 [s, head(a)] ⊆ P ′ i [s, head(a)] and thusā / ∈ P i+1 [s, head(a)] as P ′ i / ∈ Pā →a . Therefore P i+1 ∈ P a \ Pā →a , i.e., i + 1 ∈ I. Now |I| ≥ |I ′ | impliesū x ′ ,ā (a) ≥ū x,ā (a) and hence x ′ is reroutable.
Finally, we show that a∈A x ′ (a) < a∈A x(a). To this end, consider any fixed i ∈ [k]. Observe that x(a i ) − x ′ (a i ) = ε · |{j : a i ∈ P j }| − |{j : a i ∈ P ′ j }| .
Note that P ′ j ∩ C * ⊆ P j+1 and hence a i ∈ P ′ j implies a i ∈ P j+1 , i.e., {j : a i ∈ P ′ j } ⊆ {j−1 : a i ∈ P j }. Further note that P ′ i−1 = P i × ai−1 P i−1 does not contain a i , as a i−1 ≺ Pi a i . Hence the above containment is strict and x(a i ) − x ′ (a i ) > 0.
We thus have constructed a reroutable flow x ′ with val(x ′ ) = val(x) and x ′ (a) ≤ x(a) for all a ∈ A and a∈A x ′ (a) < a∈A x(a), contradicting our initial assumption.
Remark 16. The proof of Theorem 15 preserves integrality. Therefore, if x(P ) is an integer multiple of α for every P ∈ P, then x ′ can be chosen such that also x ′ (P ) is an integer multiple of α for every P ∈ P. x(a)) ≥ x(ā) for all C ∈ C and allā ∈ C. Furhtermore, if flow x violates this constraint for some cut C and an arcā ∈ C, thenā is (x, C)-bad. However, this no longer implies that C is an x-bad cut. Indeed, consider the example given in Fig. 1 when setting u(a 1 ) = 2 and u(a) = 1 for all a ∈ A \ {a 1 }. Let x be the reroutable (but not strictly reroutable) flow sending one unit of flow along the path (a 1 , a 2 , a 3 ). The cut C := {a 1 , a 3 } is not x-bad, but C and a 1 violate the above constraint, preventing a strict rerouting.

Computing (half-)integral solutions
In some application contexts, flow cannot be split into arbitrarily small pieces. This is the setting we consider in this section. We say a flow x is integral, if x(P ) ∈ Z for all P ∈ P. We say that x is half-integral if 2x is integral. For many fundamental flow problems, such as Max Flow or Min Cost Flow, integrality comes for free, i.e., as long as capacities are integral, there exists an optimal integral solution. In the case of reroutable flows, this property does not hold, see, e.g., Fig. 3. In fact, it turns out to be NP -hard to decide whether there is a non-zero integral reroutable flow in a network.
Theorem 18. It is NP -hard to decide whether there is an integral (strictly) reroutable flow of value 1, even when restricted to instances with u ≡ 1.
Note that this problem corresponds to sending a unit of flow along a single s-t-path. The hardness stems from a problem named Forbidden Pairs s-t-Path. The reduction is described in Section 5. While it seems that Theorem 18 does not give much space for positive algorithmic results, we can do much better if we relax the integrality requirement slightly.
r e t u r n "No reroutable flow of value 1 exists." e l s e Let P 1 , P 2 be two s-t-paths in (V, A \ A 0 ) such that P 1 ∩ P 2 = A 1 . Let x be the flow defined by x(P 1 ) = x(P 2 ) = 1/2. r e t u r n x end i f Listing 1: Computing a half-integral reroutable unit demand flow Theorem 19. Given a network with u ≡ 1, the algorithm given in Listing 1 computes in polynomial time either a half-integral strictly reroutable flow of value 1, or correctly determines that no reroutable flow of value 1 exists.
In particular, this implies that if we are interested in sending a single unit of flow, we never need to split our flow in more than two paths. Before we discuss the algorithm from Theorem 19, let us shortly discuss the case of arbitrary capacities. As a consequence of the max flow/min cut result proven in Section 2.3, we obtain the following approximation. Proof. Recall that in the proof of Theorem 8 we computed an s-t-flow x ′ that was maximal with respect to capacities u ′ (a) := min{u(a), u(C a \ {a})}. We then showed that the flow x := x ′ /2 is strictly reroutable and within a factor of 2 of a corresponding R-cut. In particular, val(x) is within a factor of 2 of the maximum reroutable flow value. Note that if u is integral, also u ′ is integral, and hence we can choose x ′ to be integral, ensuring that x is half-integral.
Algorithm for computing a half-integral flow for unit demand A natural starting point for an algorithm is to identify arcs a ∈ A such that tail(a) is disconnected from t in (V, A \ {a}). Obviously, no reroutable flow can send a positive amount of flow along such arcs, as after failure of a, the flow cannot be rerouted to t. Surprisingly, this simple preprocessing step can be generalized to an iterative procedure that solves the problem.
The algorithm, which is formally given in Listing 1, maintains two sets A 0 and A 1 . In every iteration, it identifies an arc that cannot carry any flow in any reroutable flow and adds it to A 0 . The set A 1 contains the s-t-bridges in the graph (V, A \ A 0 ), i.e., all arcs whose removal disconnects s from t in that graph. Clearly, if x(a) = 0 for all a ∈ A 0 , then every arc in A 1 must carry 1 unit of flow. If at some point A 0 becomes an s-t-cut, we know that no reroutable flow of value 1 exists. On the other hand, if the algorithm finds no more arcs to add to A 0 while s and t are still connected in (V, A \ A 0 ), it computes two paths P 1 , P 2 that only intersect at the bridges, and sends 1/2 units of flow along each of them.
Proof of Theorem 19. To see that Algorithm 1 terminates in polynomial time, observe that |A 0 | is increased in every iteration of the while-loop and the loop thus terminates after at most |A| iterations, each of which can be carried out in polynomial time.
Case 1: No flow exists. We now show that if Algorithm 1 denies the existence of a reroutable flow of value 1, this is indeed correct. By contradiction assume A 0 contains an s-t-cut but there exists a reroutable flow x of value 1. We prove by induction that at any step of algorithm the set A 0 fulfills the property that x(a) = 0 for all a ∈ A 0 , yielding a contradiction. The claim is clearly true initially, when A 0 = ∅. Now consider any iteration of the while-loop, considering arc a. By induction hypothesis, every s-t-path P with x(P ) > 0 must be a path in (V, A\A 0 ). Note that there is an order a 1 , . . . , a ℓ of the set A 1 of s-t-bridges of (V, A \ A 0 ) such that every such flow-carrying path contains all of these bridges in exactly that order. In particular x(a 1 ) = . . . = x(a ℓ ) = 1. Now consider the next arc a added to A 0 and assume by contradiction that x(a) > 0. By choice of a there is a tail(a)-t-cut C ⊆ A 1 ∪ {a} in D. Note that if C ∩ A 1 = ∅, there is no rerouting of x in case of failure of arc a, as there is no tail(a)-t-path in (V, A \ {a}). Thus, let a k ∈ C ∩ A 1 be the bridge with the highest index k on the cut. We distinguish two cases: (i) Assume a appears before a k on every flow-carrying path. Note that C is a tail(a k )-t-cut because a k ∈ C and that a ′ ∈Cū x,a k (a ′ ) = 1 − x(a) < 1. Therefore, the one unit of flow on a k cannot be rerouted when a k fails.
(ii) Now assume a occurs after a k on every flow-carrying path. But then, when a fails, the flow on a cannot be rerouted as all edges in C \ {a} ⊆ A 1 occur before a on every flow-carrying path and thus a ′ ∈C\{a}ū x,a (a ′ ) = 0.
We thus deduce that x(a) = 0, completing the induction. Case 2: Algorithm returns flow. Finally, we show that if (V, A \ A 0 ) contains an s-t-path after completing the while-loop, then the flow x returned by the algorithm is a strictly reroutable flow. First observe that two s-t-paths P 1 , P 2 in (V, A \ A 0 ) with P 1 ∩ P 2 = A 1 exist by the max flow/min cut theorem, as A 1 contains exactly the bridges of (V, A \ A 0 ). Now consider the failure of any arc a ∈ A \ A 0 . Let C be a tail(ā)-t-cut in D minimizing U (C) := a∈C\{ā}ū x (a). We show that U (C) ≥ x(ā), which by max flow/min cut implies that there is a rerouting of x in case of failure ofā. By termination condition of the while-loop, there is at least one arc a ′ ∈ C \ (A 1 ∪ {ā}). Note that x(a ′ ) ∈ {0, 1/2} and thus U (C) ≥ 1/2. Ifā / ∈ A 1 , then x(ā) ≤ 1/2 ≤ U (C). Ifā ∈ A 1 , we distinguish two cases.
(i) If x(a ′ ) = 0 then U (C) ≥ 1 and the one unit of flow onā can be rerouted.
(ii) If x(a ′ ) = 1/2, then a ′ / ∈ A 0 . Note that C is a tail(a ′ )-t-cut in D and thus there is a ′′ ∈ C \ A 1 ∪ {a ′ } by termination condition of the while-loop. Note that, because a ′′ / ∈ A 1 , we have a ′′ = a and x(a ′′ ) ≤ 1/2. Thus U (C) ≥ 1 also in this last case.
We conclude that x is indeed strictly reroutable.
Remark 21. Note that our proof of Theorem 19 does not make use of Theorem 15. Instead, it gives a simple alternative argument for the equivalence of reroutable and strictly reroutable flows in unit capacity networks, for the special case of unit value flows.
Remark 22. Theorem 19 implies that, for networks with u ≡ 1, if there exists any reroutable flow of value 1, then there exists a half-integral strictly reroutable flow of value 1. The example given in Fig. 3, however, reveals that this is no longer true for flows of higher value. To see this, consider any reroutable flow of value ∆ in the depicted network. Recall that backup links can only be used for rerouting. Thus, all nominal flow (i.e., before failure) must pass one of the three s-v-paths or the arc (s, v). Let x 1 , x 2 , x 3 be the flow values on these three paths and x * be the flow value on the arc (s, v). Also, all flow must pass one of the three v-t-paths. Let x ′ 1 , x ′ 2 , x ′ 3 be the arc flow values on these paths. We obtain We further show that x i + x ′ j ≤ 1 for every i, j: To see this, consider the rerouting when the ith arc of the jth v-t-path fails.
Observe that the only backup link leads to a node on the ith s-v-path. Hence , which can be verified to be a strictly reroutable flow. Note that the example can be generalized to arbitrarily small fractional values by introducing k instead of only 3 parallel paths in each of the two segments.

Hardness results
In this section, we give hardness results for Max RF and some variants of the problem.
Paths avoiding forbidden pairs Our hardness results are based on reductions from Forbidden Pairs s-t-Path, which is defined as follows: We are given a digraph D ′ = (V ′ , A ′ ), two nodes s ′ , t ′ ∈ V ′ , and a set of forbidden arc pairs F ⊆ {{a,ā} : a,ā ∈ A}. The task is to find an s ′ -t ′ -path P that does not contain both arcs of any pair, i.e., |S ∩ P | ≤ 1 for all S ∈ F . It is not hard to see that Forbidden Pairs s-t-Path is NP -hard [14].
In all reductions that follow, we will implicitly make the following three assumptions on the digraph D ′ = (V ′ , A ′ ) given in the Forbidden Pairs s-t-Path instance.
3. If a ∈ S and a ′ ∈ S ′ for some S, S ′ ∈ F , then head(a) = tail(a ′ ).
It is easy to see that these assumptions are without loss of generality. They can be ensured by subdividing arcs, without changing the feasibility of the Forbidden Pairs s-t-Path instance.   We show that the Max RF instance constructed above allows for a reroutable flow of value 2 if and only if there is an s ′ -t ′ -path avoiding the forbidden pairs in F . In the following, we call a node v safe if there is a backup link from v to t.

General capacities
Sufficiency Assume there is an s ′ -t ′ -path P in D ′ avoiding all forbidden pairs.
We will construct a reroutable flow of value 2. First, we extend P to an s-t-path Q as follows. For i ∈ [k], attach g i and h i to Q if a i ∈ P , and attachḡ i andh i otherwise. As for every i, the path Q uses either h i or h i , there is another s-t-pathQ in G that is arc-disjoint from Q (starting with (s, t ′ ) and then using the complement of Q from t ′ to t). We set x(Q) := x(Q) := 1.
We now verify that x is a reroutable flow. As the nodes w i ,w i , z i , and z i for i ∈ [k] are the only nodes that are not safe, we only need to check that there is a rerouting for failure of the arcs a i ,ā i , h i andh i . Because ū x,hi (a i ) = 2 − x(a i ) ≥ 1, we can concatenate the backup link from w i to z i with the arc a i and the backup link from head(a i ) to t to obtain a path with residual capacity 1. This is enough to reroute the flow x in case of failure of h i . An identical argument applies for failure ofh i . Further note that a i ∈ Q implies h i ∈ Q by construction of Q. Therefore, either x(a i ) = 0 orū x,ai (h i ) = 1. In the former case, rerouting is trivial. In the latter case, we can concatenate the backup link from z i to w i with h i and the backup link from v i+1 to t to reroute the one unit of flow on a i . Likewise, we observe thatā i ∈ Q impliesh i ∈ Q, becauseā i ∈ P implies a i / ∈ P . Hence we can construct a rerouting forā i in the same manner.
Necessity Now assume there exists a reroutable flow x of value 2. Observe that x(h i ) = x(h i ) = 1 for all i ∈ [k] (as the flow cannot use the backup links and thus has to traverse these arcs). Let Q ∈ P be any path with x(Q) > 0 and (s, t ′ ) / ∈ Q. Let P ′ := Q[s ′ , t ′ ] be the projection of Q to D ′ . We claim that P ′ avoids all forbidden pairs in F . By contradiction assume this is not the case, i.e., a i ,ā i ∈ P ′ ⊆ Q for some i. Consider the rerouting x ai for failure of a i . Note that assumptions (i) and (ii) from the beginning of the proof imply that the only z i -t-path in (V, A \ {a i }) contains h i . Hence all flow in the rerouting has to traverse h i , and therefore We conclude that all the above inequalities must be fulfilled with equality, and hence Q ∈ P ai→hi , and in particular h i ∈ Q. By a symmetric argument, we conclude thatā i ∈ Q impliesh i ∈ Q. However there is no st-path that contains both h i andh i . This yields the desired contradiction. Hence P ′ is a path avoiding all forbidden pairs.

Computing integral flows
In Section 4 we provided an algorithm that was able to decide whether a 1/2integral reroutable flow of value 1 exists in a unit capacity network. If however, we require the flow to be integral, this question suddenly becomes NP -hard. Note that this problem corresponds to finding a single 'reroutable' path.
Theorem 18. It is NP -hard to decide whether there is an integral (strictly) reroutable flow of value 1, even when restricted to instances with u ≡ 1.
Proof. Let (D ′ = (V ′ , A ′ ), s ′ , t ′ , F ) be an instance of Forbidden Pairs s-t-Path. We construct an instance of Max RF as follows. We let s := s ′ and t := t ′ . For every forbidden pair {a,ā} ∈ F , we add a backup path from tail(a) to tail(ā) and vice versa. For every node v that is not the tail of an arc that appears in a forbidden pair, we add a backup link to t. We set unit capacities to all arcs.
Let P be an s-t-path path avoiding all forbidden pairs. Then the flow x with x(P ) = 1 is a reroutable flow. To see this, observe that the only nodes that are not safe are the tails of arcs participating in forbidden pairs. Consider a forbidden pair {a,ā} ∈ F . Observe that x(a) = 0 or x(ā) = 0 and hence a rerouting exists in case of failure of either of the two arcs. Now assume there is an integral reroutable flow of value 1. This means that x(P ) = 1 for an s-t-path P that does not use any backup link. Assume that a,ā ∈ P for some {a,ā} ∈ F . W.l.o.g. assume a < Pā . Note that {a,ā} is a tail(ā)-t-cut in D. Hence, whenā fails, the rerouting must use a, i. e., xā(a) = 1 > 0 =ū x,ā (a), a contradiction.
Because of Theorem 15 and Remark 16 the constructed instance allows for an integral strictly reroutable flow of value 1 if and only if it allows for a reroutable flow of value 1. Hence the hardness result carries over to Max SRF.

Multiple arc failures
A natural generalization of Max RF and Max SRF allows multiple simultaneous arc failures. When a set of arcs S fails, flow is interrupted where it first encounters an arc from S and has to be rerouted from that point to the sink.
To formalize this, we introduce the following notation. For S ⊆ A and a ∈ A we define P S := ā∈S Pā and P S→a := ā∈S Pā →a . Let x be an s-t-flow. We extend the notion of capacity available after failure of S by defininḡ A rerouting is strict if ā∈S x S,ā (a) ≤ū x (a) for all a ∈ A. A flow is (strictly) kreroutable if it has a (strict) rerouting for failure of any set S ⊆ A with |S| ≤ k. We denote the corresponding problem of finding a (strictly) k-reroutable flow of maximum value by Max (Strictly) k-Reroutable Flow. It turns out that dealing even with only 2 arc failures in unit capacity networks is NP -hard in both cases.
Theorem 25. Max (Strictly) k-Reroutable Flow is NP -hard, even when restricted to instances with k = 2 and u ≡ 1.
Proof. Let (D ′ = (V ′ , A ′ ), s ′ , t ′ , F ) be an instance of Forbidden Pairs s-t-Path. We construct an instance (D = (V, A), s, t, u) of Max 2-Reroutable Flow as follows. Let {a 1 ,ā 1 }, . . . , {a ℓ ,ā ℓ } be the forbidden pairs in F in some arbitrary order. For i ∈ [ℓ] we add vertices v i , w i , v ′ i , w ′ i andw i ,v ′ i ,w ′ i , and define v ℓ+1 := s ′ . We add arcs We generalize the concept of backup links to 2-backup links, which are simply two parallel internally node-disjoint backup links. We add 2-backup links from each of v i , v ′ i , andv ′ i to t ′ , thus making them safe nodes. We further add 2-backup links w i to w ′ i , from w ′ i to z i , and from z i to w i , as well as fromw i tow ′ i , fromw ′ i tō z i , and fromz i tow i . For every node v ∈ V ′ that is not the tail of an arc that participates in a forbidden pair, we add a 2-backup link from v to t. We also add an additional s ′ -t ′ -pathP of length 6 consisting of the arcs e 1 , . . . , e 6 . We add 2-backup links from tail(e 2 ) to tail(e 4 ), from tail(e 4 ) to tail(e 6 ), and from tail(e 6 ) to tail(e 2 ). We also add 2-backup links from each of tail(e 1 ), tail(e 3 ) and tail(e 5 ) to t ′ . Finally, we define s := v 1 , t := t ′ , and u ≡ 1.
We show two implications: (i) If there is an s ′ -t ′ -path in D ′ avoiding all pairs, then there is a strictly reroutable flow of value 1 in the constructed network D.
(ii) If there is a reroutable flow of value 1 in the constructed network D, then there is an s ′ -t ′ -path in D ′ avoiding all pairs. Note that (i) and (ii) together also imply that a strictly reroutable flow of value 1 exists in D if and only if there is a reroutable flow of value 1. Therefore, both Maximum k-Reroutable Flow and Maximum Strictly k-Reroutable Flow can be used to solve Forbidden Pairs s-t-Path.
(i) Let P ′ be an s ′ -t ′ path in D ′ avoiding all forbidden pairs. Let O be the s-s ′ -path defined by the following rule: For i ∈ [ℓ], if a i ∈ P ′ , then use the segment g i , h i , g ′ i , h ′ i , otherwise use the segmentḡ i ,h i ,ḡ ′ i ,h ′ i . Let Q be the concatenation of O and P ′ to an s-t-path. Further, letŌ be the s-s ′ -path that uses the segments not used by O and letQ be the concatenation of O andQ. We define the flow x(Q) := 1/2 and x(Q) := 1/2.
Consider the failure of any set S ⊆ A with |S| = 2. Note thatū x (a) ≥ 1/2 for all a ∈ A. It is also easy to see that for anyā ∈ A there are three disjoint tail(ā)-t-paths in D and hence at least one such path in (V, A \ S). If Q∩S = ∅ orQ∩S = ∅, we have to reroute at most 1/2 unit of flow, which is possible by the above observations. Hence, consider the case that S = {q 1 , q 2 } with q 1 ∈ Q and q 2 ∈Q. If there is no rerouting for S, then there must be an arc q 3 such that {q 1 , q 2 , q 3 } separate tail(q 1 ) and tail(q 2 ) from t. It is easy to see that this is only possible if {q 1 , q 2 , q 3 } = {a i , h i , h ′ i } or {q 1 , q 2 , q 3 } = {ā i ,h i ,h ′ i } for some i ∈ [ℓ]-w.l.o.g., we assume the former. Note that a i / ∈Q and that h i , h ′ i are both on the same path. But h i , h ′ i ∈Q implies a i / ∈ Q by construction of Q and the fact that P ′ avoids forbidden pairs. Hence there must be a rerouting for x.
(ii) Let x be a reroutable flow of value 1. We first observe that for every i ∈ [ℓ], x(h i ) = x(h ′ i ) = x(h i ) = x(h ′ i ) = 1/2. To see this, note that the nominal flow cannot use backup links and hence x(h i ) + x(h ′ i ) = 1. Now assume that x(h i ) > 1/2. Then consider the failure of S i := {h ′ i , a i }. Note that all flow on h ′ i and a i must be rerouted via h i in this case, i.e.,