1 Introduction

In this paper, we present a new extension of the minimum cost flow (MCF) problem (Ahuja et al. 1988), which we call the robust minimum cost flow problem under consistent flow constraints (RobMCF\(\equiv \)). This problem is motivated by, for example, long-term decisions in logistic applications. A major problem in logistics is the cost-efficient transport of commodities. Typically, this problem is represented by an MCF model, where a commodity can be identified by a flow sent through a network from a supply source to a sink with demand. In this way, a company can easily assess whether the available means of transport are sufficient for a given demand. If this is not the case, additional transport by subcontractors can be arranged. Such arrangements are generally agreed by long-term contracts, however, the demand is naturally subject to uncertainty. For this reason, valid and cost-efficient decisions have to be made without the knowledge of the actual demand.

The problem described can be represented by an adjusted integral MCF model subject to demand uncertainty. We represent the demand uncertainty by a discrete number of possible occurring demand scenarios. In addition to the network requirements of the MCF problem, we are given a predetermined set of arcs referred to as fixed arcs. The flow value on the fixed arcs is supposed to represent the transport by subcontractors. Thus, we require the flow value on a fixed arc to be equal among all demand scenarios. For finding a robust solution to this problem, we minimize the maximum cost that may occur among all demand scenarios. In summary, for the RobMCF\(\equiv \) problem, we consider different demand scenarios for which we require integral flows whose flow values are equal on the respective fixed arcs with the objective of minimizing the maximum cost.

The main contribution of this paper can be summarized as follows. We show that most of the knowledge of the MCF problem is not readily transferable to the RobMCF\(\equiv \) problem. In particular, the integrality requirement of the RobMCF\(\equiv \) problem is necessary, even though the demands and supplies of all demand scenarios and the network’s capacities are integral, as Dantzig and Fulkerson’s Integral Flow Theorem (Korte et al. 2012) does not hold. We further prove that finding a feasible solution to the RobMCF\(\equiv \) problem is strongly \(\mathcal {NP}\)-complete on acyclic digraphs, even if only two demand scenarios and unit arc capacities are considered. On series-parallel digraphs, we show that the decision version of the RobMCF\(\equiv \) problem is weakly \(\mathcal {NP}\)-complete and in the special case of a constant number of scenarios it is solvable in pseudo-polynomial time by dynamic programming. If all demand scenarios have the same single source and sink, we propose an algorithm running in polynomial time on series-parallel digraphs.

The outline of this paper is as follows. We start with an overview about related work in Sect. 2. Subsequently, in Sect. 3, we give an explicit mathematical problem description, and introduce the notations of this paper. Furthermore, we present first structural results of the problem. In Sect. 4, the problem’s complexity is analyzed on acyclic digraphs. Afterwards, we consider the RobMCF\(\equiv \) problem on series-parallel digraphs in Sect. 5. We conclude this paper by Sect. 6.

2 Related work

In the context of logistic applications, several extensions to the MCF problem are analyzed in the literature. We refer to the minimum cost flows with minimum quantities problem introduced by Seedig (2011) and generalized by Krumke and Thielen (2011). In addition to the requirements of the MCF problem, on each arc the flow must either take the value zero or a minimum quantity given. This can be altered and transfered to the case where the flow on the fixed arcs, which represents the transport by subcontractors, takes a minimum value (among all demand scenarios). Another extension is obtained, for example, by the MCF version of the maximum flow problem with disjunctive constraints studied by Pferschy and Schauer (2013). A maximum flow is sought whose flow value is positive for at least one arc of every arc pair included in a predetermined arc set. Thus, at least one transport performed by subcontractors can be modeled. We point out that the problems above are only considered for one demand scenario, whereas we consider several demand scenarios in the RobMCF\(\equiv \) problem. Due to the equal flow requirements for the fixed arcs, we focus in the following on extensions in the literature with equal flow requirements. Afterwards, we give a short overview of robust network approaches with demand uncertainty. To the best of our knowledge, no study combines equal flow requirements with robust network approaches.

Sahni (1974) introduces a variant of the maximum flow (MF) problem (Ahuja et al. 1988), the so-called integral flow with homologous arcs problem (homIF). In addition to the set-up of the MF problem, predetermined sets of arcs are given in this problem. A maximum integral flow is sought whose flow value is equal on all arcs that are contained in the same predetermined arc set. Sahni proves the \(\mathcal {NP}\)-hardness of the problem by a reduction from the Non-Tautology problem. Johnson and Garey (1979) point out that by modifying a construction of Even et al. (1975), the problem’s \(\mathcal {NP}\)-hardness holds even if all arc capacities are equal to one. Furthermore, unless \(\mathcal {P}=\mathcal {NP}\), the non-existence of a \(2^{n(1-\varepsilon )}\)-approximation algorithm for any fixed \(\varepsilon >0\) (on a digraph with n vertices) is proven by Meyers and Schulz (2009) even if a nonzero solution is guaranteed to exist.

The MCF version of the homIF problem can be found in the literature as (integer) equal flow problem (EF). Using standard techniques, the complexity results can be transformed from the MF to the MCF version (Ahuja et al. 1988). There are several special cases and applications for both the MF and MCF version of the problem considered in the literature (Calvete 2003; Meyers and Schulz 2009; Morrison et al. 2013; Srinathan et al. 2002). For instance, the special case of the EF problem where all sets have cardinality two, i.e., an integral MCF is sought whose flow value is equal on a predetermined set of arc pairs, is investigated by Ali et al. (1988). The problem finds application in, for example, crew scheduling (Carraresi and Gallo 1984). Therefore, Ali et al. present a heuristic algorithm based on Lagrangian relaxation. Meyers and Schulz (2009) refer to this problem as paired integer equal flow problem (pEF) and prove that there exists no \(2^{n(1-\varepsilon )}\)-approximation algorithm for any fixed \(\varepsilon >0\) (on a digraph with n vertices), unless \(\mathcal {P}=\mathcal {NP}\). The statement holds true even if a nontrivial solution is guaranteed to exist. A simpler and in polynomial time solvable special case of the EF problem is the so-called simple equal flow problem (sEF), which is introduced by Ahuja et al. (1999). The sEF problem requires the same but not necessarily integral flow value on only a single predetermined set of arcs. The problem is motivated by the management of water resource systems (Manca et al. 2010). For this purpose, Ahuja et al. (1999) develop several efficient algorithms to solve large-scale instances—a network simplex, a parametric simplex, a combinatorial parametric, a binary search, and a capacity scaling algorithm. These algorithms can easily be modified to obtain integral solutions.

Unlike the previous research on MF and MCF problems with equal flow requirements, we consider in the RobMCF\(\equiv \) problem not one demand scenario only, but several demand scenarios. For each of these scenarios, a feasible flow is sought. Furthermore, among all of these scenarios, we require the same flow value on an arc if it is included in the single predetermined set of fixed arcs. Although we consider several demand scenarios, the problem of finding a feasible solution to the RobMCF\(\equiv \) problem can be modeled as a special case of the EF and pEF problem by means of graph copies. We point out that the equal flow requirements in the RobMCF\(\equiv \) problem are only of importance while considering different demand scenarios, i.e., the flow value of a fixed arc has to be equal among all scenarios. In turn, the flow value of two fixed arcs may differ in one scenario. For this reason, the problem of finding a feasible solution to the RobMCF\(\equiv \) problem cannot be modeled as the sEF problem, except for the special case where the predetermined arc set contains only one arc. Moreover, due to different objectives, the correspondence from the RobMCF\(\equiv \) problem to the EF, sEF, and pEF problem only holds for finding a feasible solution.

Demand uncertainty is studied more frequently in the context of network design and network engineering in telecommunication or road networks for example. In robust network design, we have to decide on the capacities such that in all considered scenarios, the entire demand can simultaneously be routed. The cost of installing the capacities is supposed to be minimized.

In the single commodity case which was first studied by Minoux (1989) and by Sanità (2009), the flow between supply and demand vertices may differ among the scenarios as long as the capacities are satisfied. For discrete scenarios, a cut-based integer linear program formulation with a separation algorithm is proposed by Álvarez-Miranda et al. (2012). Cacchiani et al. (2016) present a branch-and-cut algorithm for two types of uncertainty sets, a discrete set of scenarios, and a polytope. Atamtürk and Zhang (2007) present a two-stage robust optimization approach where some capacity decisions have to be made before, and other after the demand realization. The decisions have to guarantee that in any case the demand can be routed through the network.

In the multi-commodity case, several studies propose different models and uncertainty sets. For instance, Altin et al. (2007, 2011) propose the so-called Hose uncertainty model, Belotti et al. (2008) in the context of statistical multiplexing, and Koster et al. (2013) the budget uncertainty set introduced by Bertsimas and Sim (2003, 2004). In these studies, the flow is sent proportionally with the demand. In case the flow can be adapted to the demand, a two-stage robust approach is followed. While Mattia (2013) studies dynamic routing, Poss and Raack (2013) suggest to use affine recourse options.

3 Robust minimum cost flow problem under consistent flow constraints

3.1 Definition and notation

The RobMCF\(\equiv \) problem is an extension of the MCF problem where supply and demand are subject to uncertainty. The uncertainty is represented by a finite set of discrete scenarios \(\Lambda \) where we do not have any knowledge which scenario is realized. Considering these scenarios, we are given a digraph \(G=(V,A)\) with vertex set V and arc set A. The set of arcs A is defined by two disjoint sets, i.e., \(A=A^\text {fix}\cup A^\text {free}\), where we refer to arcs of set \(A^{{{\,\mathrm{fix}\,}}}\) as fixed arcs and arcs of set \(A^{{{\,\mathrm{free}\,}}}\) as free arcs. We use the notation V(G), A(G), \(A^\text {fix}(G)\), and \(A^\text {free}(G)\) to indicate the sets of vertices, arcs, fixed arcs, and free arcs of digraph G, respectively. Independent of the scenarios arc capacities \(u:A(G)\rightarrow \mathbb {Z}_{\ge 0}\) and arc cost \(c:A(G)\rightarrow \mathbb {Z}_{\ge 0}\) are given. In contrast, vertex balances \(b^\lambda :V(G)\rightarrow \mathbb {Z}\) with \(\sum _{v\in V}b^\lambda (v)=0\) that define the supply and demand realizations are given for every scenario \(\lambda \in \Lambda \), denoted by \(\varvec{b}=(b^1,\ldots ,b^{|\Lambda |})\). A positive balance indicates a source while a negative balance indicates a sink. Note that, in general, the source (sink) vertices do not necessarily have to be the same in every scenario. In case that each scenario has only one vertex with a positive (negative) balance, we refer to these sources as single sources (sinks). If the single sources (sinks) are defined by the same vertex for every scenario, we say that the problem has a unique source (sink). Combined, we obtain the network \((G,u,c,\varvec{b})\).

Considering only a single scenario \(\lambda \in \Lambda \), analogues to the MCF problem a \(b^\lambda \)-flow is defined by a function \(f^\lambda : A(G)\rightarrow \mathbb {Z}_{\ge 0}\) that satisfies the capacity constraints

$$\begin{aligned} 0\le f^\lambda (a)\le u(a) \end{aligned}$$

on all arcs \(a\in A\) and the flow balance constraints

$$\begin{aligned} \sum _{a=(v,w)\in A}f^\lambda (a)-\sum _{a=(w,v)\in A}f^\lambda (a)=b^\lambda (v) \end{aligned}$$

at every vertex \(v\in V\). The cost of a \(b^\lambda \)-flow \(f^\lambda \) is defined by

$$\begin{aligned} c(f^\lambda )=\sum _{a\in A} c(a)\cdot f^\lambda (a). \end{aligned}$$

To consider a set of scenarios \(\Lambda \), we need to introduce a new definition of a flow, a so called robust \(\varvec{b}\)-flow.

Definition 1

(Robust Flow) Given a network \((G=(V,A=A^{\text {fix}}\cup A^{\text {free}}),u,c, \varvec{b})\), a robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,\ldots ,f^{|\Lambda |})\) is defined by a \(|\Lambda |\)-tuple of \(b^\lambda \)-flows \(f^\lambda : A(G)\rightarrow \mathbb {Z}_{\ge 0} \) that satisfy the consistent flow constraints \(f^\lambda (a)=f^{\lambda ^\prime }(a)\) on all fixed arcs \(a\in A^\text {fix}\) for all scenarios \(\lambda , \lambda ^\prime \in \Lambda \). The cost of a robust \(\varvec{b}\)-flow \(\varvec{f}\) is defined by the maximum flow cost among all scenarios, i.e., \(c(\varvec{f})=\max _{\lambda \in \Lambda }c(f^\lambda )\).

We refer to the flow value on an arc of set \(A^{{{\,\mathrm{fix}\,}}}\) as its load. Accordingly, the consistent flow constraints are satisfied if the load of a fixed arc is equal in every scenario. The RobMCF\(\equiv \) problem can finally be formulated as follows.

Definition 2

(RobMCF\(\equiv \)) Given a network \((G=(V,A=A^{\text {fix}}\cup A^{\text {free}}),u,c,\varvec{b})\), the robust minimum cost flow problem under consistent flow constraints (RobMCF\(\equiv \)) aims a robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,\ldots , f^{|\Lambda |})\) of minimum cost.

Note that in case of a single scenario, i.e., \(|\Lambda |=1\), the RobMCF\(\equiv \) problem corresponds to the MCF problem. Otherwise, however, there are major differences as the following section shows.

3.2 Structural results

In this section, we present structural results of the RobMCF\(\equiv \) problem. In particular, differences to the MCF problem are pointed out where the main difference is the following. Given a network with integral capacities and balances, by Dantzig and Fulkerson (Korte et al. 2012) there always exists an optimal integral flow for the MCF problem. This useful integral flow property is assumed to be given in most studies. However, the integral flow property does not hold for the RobMCF\(\equiv \) problem as the following example shows.

Example 1

For a set of two scenarios \(\Lambda =\{1,2\}\), let a network \((G,u,c,\varvec{b})\) with capacity \(u\equiv 1\) be given, where digraph G, its cost c, and the non-zero balances \(\varvec{b}\) are visualized in Fig. 1a. An optimal integral robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,f^2)\) is defined by a first scenario flow \(f^1\) that sends one unit along path \(v_1v_3v_5v_8\), and a second scenario flow \(f^2\) that sends one unit each along path \(v_1v_3v_5v_6\) and \(v_1v_4v_5v_7v_6\). This results in cost of \(c(\varvec{f})= 4\) as \(c(f^1)=4\) and \(c(f^2)=2+0=2\) hold true.

However, by neglecting the integral flow requirement, there exists a robust \(\varvec{b}\)-flow \(\varvec{\tilde{f}}=(\tilde{f}^1,\tilde{f}^2)\) with cost of \(c(\varvec{\tilde{f}})=3\). Flow \(\tilde{f}^1\) sends a half unit each along paths \(v_1v_3v_5v_8\) and \(v_1v_4v_5v_8\) ending up in total cost of \(c(\tilde{f}^1)=3\). Flow \(\tilde{f}^2\) sends a half unit each along paths \(v_1v_2v_5v_6\) and \(v_1v_3v_5v_6\), and one unit along path \(v_1v_4v_5v_7v_6\), also ending up in cost of \(c(\tilde{f}^2)=3\).

Fig. 1
figure 1

a A non-integral robust \(\varvec{b}\)-flow is the only optimal solution b A scenario flow that does not send the maximum demand among all scenarios causes the maximum cost in a unique source, unique sink network

Corollary 1

Considering the continuous relaxation of the RobMCF\(\equiv \) problem, there does not always exist an integral robust flow with minimum cost, even if all capacities and balances are integral.

We note that if no integer requirements for a robust flow are given, the RobMCF\(\equiv \) problem can be solved by a simple linear program (LP) in polynomial time in |V|,|A| and \(|\Lambda |\). However, as applications of the RobMCF\(\equiv \) problem often require integral flow values, hereafter this paper only concentrates on integral solutions. Further motivated by applications, in the next step, we investigate the RobMCF\(\equiv \) problem where either the load of the fixed arcs is given, or the number of fixed arcs is constant. In logistics for example, this complies with finding a solution of minimum cost if the transport is already contractually agreed or limited. The following results show that we can solve these special cases in polynomial time.

Lemma 1

Let \(\mathcal {I}=(G=(V,A=A^{{{\,\mathrm{fix}\,}}}\cup A^{{{\,\mathrm{free}\,}}}),u,c,\varvec{b})\) be a RobMCF\(\equiv \) instance. For a given load \(\ell : A^{{{\,\mathrm{fix}\,}}}(G) \rightarrow \mathbb {Z}_{\ge 0}\), an optimal robust \(\varvec{b}\)-flow \(\varvec{f}\) that satisfies \(f^\lambda (a)=\ell (a)\) for all fixed arcs \(a\in A^{{{\,\mathrm{fix}\,}}}(G)\) in every scenario \(\lambda \in \Lambda \) can be computed in polynomial time if one exists.

Proof

We transform instance \(\mathcal {I}\) to \(|\Lambda |\) simple minimum cost \(\tilde{b}^\lambda \)-flow instances \(\widetilde{\mathcal {I}}^\lambda =(\widetilde{G},u,c,\tilde{b}^\lambda )\) that can be considered for every scenario \(\lambda \in \Lambda \) separately. Instances \(\widetilde{\mathcal {I}}^\lambda \), \(\lambda \in \Lambda \) are obtained by deleting the fixed arcs from digraph G resulting in digraph \(\widetilde{G}\), i.e., \(\widetilde{G}=G-A^{{{\,\mathrm{fix}\,}}}\), while at the same time the new balances \(\tilde{b}^\lambda :V(\widetilde{G})\rightarrow \mathbb {Z}\) are defined as follows

$$\begin{aligned} \tilde{b}^\lambda (v)= b^\lambda (v) + \sum _{a=(w,v)\in A^{{{\,\mathrm{fix}\,}}}(G)}\ell (a) - \sum _{a=(v,w)\in A^{{{\,\mathrm{fix}\,}}}(G)} \ell (a). \end{aligned}$$

After computing minimum cost \(\tilde{b}^\lambda \)-flows \(\tilde{f}^\lambda \) for all instances \(\widetilde{\mathcal {I}}^\lambda \), \(\lambda \in \Lambda \), a corresponding robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,\ldots ,f^{|\Lambda |})\) for instance \(\mathcal {I}\) is defined as

$$\begin{aligned} f^\lambda (a)= {\left\{ \begin{array}{ll} \ell (a) &{}\text { for all fixed arcs }a\in A^{{{\,\mathrm{fix}\,}}}(G),\\ \tilde{f}^\lambda (a) &{}\text { for all free arcs }a\in A^{{{\,\mathrm{free}\,}}}(G), \end{array}\right. } \end{aligned}$$

and causes cost of

$$c(\varvec{f})=\max _{\lambda \in \Lambda } c(\tilde{f}^\lambda ) + \sum _{a\in A^{{{\,\mathrm{fix}\,}}}(G)} c(a)\cdot \ell (a).$$

Assume the constructed robust \(\varvec{b}\)-flow \(\varvec{f}\) is not optimal, i.e., a robust \(\varvec{b}\)-flow \(\varvec{\hat{f}}=(\hat{f}^1,\ldots ,\hat{f}^{|\Lambda |})\) exists with cost

$$\begin{aligned} c(\hat{f}^{\lambda _1})=\max _{\lambda \in \Lambda }c(\hat{f}^\lambda )=c(\varvec{\hat{f}})<c(\varvec{f})=\max _{\lambda \in \Lambda }c(f^\lambda )=c(f^{\lambda _2}) \end{aligned}$$

for scenarios \(\lambda _1, {\lambda _2}\in \Lambda \). Let \(\overline{f}^\lambda \) denote the flow which results from restricting the scenario flow \({\hat{f}}^\lambda \) of instance \(\mathcal {I}\) to instance \(\widetilde{\mathcal {I}}^\lambda \), \(\lambda \in \Lambda \). As the load on the fixed arcs is given, the values of flows \(\varvec{\hat{f}}\) and \(\varvec{f}\) on the fixed arcs are equal for every scenario, i.e., \(\hat{f}^\lambda (a)=f^\lambda (a)=\ell (a)\) for \(a\in A^{{{\,\mathrm{fix}\,}}}\) and \(\lambda \in \Lambda \). Using this insight, we obtain

$$\begin{aligned}&c(\hat{f}^{\lambda _1})&<c(f^{\lambda _2})&\\ \Leftrightarrow&\sum _{a\in A(G)}c(a) \hat{f}^{\lambda _1}(a)&<\sum _{a\in A(G)} c(a) f^{\lambda _2}(a)&\\ \Leftrightarrow&\sum _{a\in A^{{{\,\mathrm{free}\,}}}(G)}c(a) \hat{f}^{\lambda _1}(a)&<\sum _{a\in A^{{{\,\mathrm{free}\,}}}(G)} c(a) f^{\lambda _2}(a)&\\ \Leftrightarrow&c(\overline{f}^{\lambda _1})&<c(\tilde{f}^{\lambda _2}). \end{aligned}$$

Furthermore, as by definition flow \(\varvec{\hat{f}}\) satisfies the consistent flow constraints, \(c(\overline{f}^{\lambda _1})=\max _{\lambda \in \Lambda }c(\overline{f}^\lambda )\) is implied by \(c(\hat{f}^{\lambda _1})=\max _{\lambda \in \Lambda }c(\hat{f}^\lambda )\). Overall, we obtain

$$\begin{aligned} c(\tilde{f}^{\lambda _2}) >c(\overline{f}^{\lambda _1}) =\max _{\lambda \in \Lambda }c(\overline{f}^\lambda ) \ge c(\overline{f}^{\lambda _2}), \end{aligned}$$

which is a contradiction to the fact that flow \(\tilde{f}^{{\lambda _2}}\) is an optimal \(\tilde{b}^{\lambda _2}\)-flow for instance \(\widetilde{\mathcal {I}}^{\lambda _2}\).

Considering the runtime, the transformation of instance \(\mathcal {I}\) to instances \(\widetilde{\mathcal {I}}\), \(\lambda \in \Lambda \) is done in \(\mathcal {O}(|\Lambda |\cdot |A|)\) time. Subsequently, a minimum cost \(\tilde{b}^\lambda \)-flow \(\tilde{f}^\lambda \) can be computed for every scenario \(\lambda \in \Lambda \) by, for example, the Minimum Mean Cycle-Canceling Algorithm in \(\mathcal {O}(|A|^3|V|^2\log |V|)\) time (Korte et al. 2012). Hence, an optimal robust \(\varvec{b}\)-flow can be computed in \(\mathcal {O}(|\Lambda |\cdot |A|^3\cdot |V|^2\log |V|)\) total time. Note that if for a scenario \(\lambda \in \Lambda \) no feasible \(\tilde{b}^\lambda \)-flow exists, there also does not exist a robust \(\varvec{b}\)-flow.

Corollary 2

The RobMCF\(\equiv \) problem is solvable in polynomial time for a constant number of fixed arcs.

Proof

We formulate the RobMCF\(\equiv \) problem as LP where we only require the constant number of variables that indicate the load on the fixed arcs to be integral. The resulting mixed integer linear program (MIP) can be solved in polynomial time by Lenstra’s algorithm (1983). In the case that the resulting robust flow is not integral, we define a load by the value of the MIP’s integer variables. Analogous to the proof of Lemma 1, we transform the instance and compute an optimal integral robust flow in polynomial time.

At the end of this section, we focus on the objective function of the RobMCF\(\equiv \) problem. From the MCF problem, or the multi-commodity flow problem (Korte et al. 2012), we know that due to different sources and sinks a flow that sends one unit may cause higher cost than a flow sending two units. Obviously, the same property remains true for instances of the RobMCF\(\equiv \) problem. If we consider the RobMCF\(\equiv \) problem on networks with a unique source and a unique sink, we might assume, analogous to the MCF problem, that the cost of a robust flow is determined by the scenario flow which sends the maximum demand. However, the following example shows that this is not true.

Example 2

For a set of two scenarios \(\Lambda =\{1,2\}\), let a network \((G,u,c,\varvec{b})\) with capacity \(u\equiv 1\) be given, where digraph G, its cost c, and the non-zero balances \(\varvec{b}\) are visualized in Fig. 1b. The only feasible and therefore also optimal solution \(\varvec{f}=(f^1, f^2)\) to the RobMCF\(\equiv \) problem is easy to determine. Considering the second scenario flow \(f^2\) first, the only option to send two flow units from source s to sink t is along paths \(sv_1t\) and \(sv_2t\) due to the capacity constraints. As the second scenario flow \(f^2\) uses both fixed arcs, the first scenario flow \(f^1\) must also send flow along these arcs. For this reason, the only option to send one flow unit from source s to sink t is along path \(sv_2v_1t\). The cost of the robust \(\varvec{b}\)-flow \(\varvec{f}\) is \(c(\varvec{f})=c(f^1)=100\).

Corollary 3

In a network with a unique source and a unique sink, the cost of a robust \(\varvec{b}\)-flow is not necessarily determined by the \(b^\lambda \)-flow which sends the maximum demand among all scenarios \(\lambda \in \Lambda \).

As a result, independent of the number of sources and sinks given, for solving the RobMCF\(\equiv \) problem, we cannot only concentrate on a single scenario. However, by reason of the following lemma, in a network with a unique source and a unique sink it is sufficient to concentrate on two scenarios only, namely those in which the minimum and maximum demand is sent.

Lemma 2

Let \(\mathcal {I}=(G=(V,A=A^{{{\,\mathrm{free}\,}}}\cup A^{{{\,\mathrm{fix}\,}}}),u,c,\varvec{b})\) be a RobMCF\(\equiv \) instance with a unique source s and a unique sink t. Without loss of generality, let the scenarios \(\lambda \in \Lambda \) be strictly ordered in ascending order of their supply balances \(b^\lambda \), i.e., \(b^{1}(s)<b^{2}(s)<\ldots < b^{|\Lambda |}(s)\). Further, let feasible integral \(b^\lambda \)-flows \(f^\lambda \) for scenarios \(\lambda =1\) and \(\lambda =|\Lambda |\) be given that satisfy the consistent flow constraints, i.e., \(f^{1}(a) = f^{|\Lambda |}(a)\) for \(a\in A^{\text {fix}}\). A robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,\ldots ,f^{|\Lambda |})\) with cost of \(c(\varvec{f})=\max \{c(f^1), c(f^{|\Lambda |})\}\) can be computed in polynomial time.

Proof

As we consider a network with a unique source and a unique sink, a feasible robust \(\varvec{b}\)-flow \(\varvec{f}\) for instance \(\mathcal {I}\) is given by the convex combination of the flows \(f^1\) and \(f^{|\Lambda |}\) as follows. For every scenario \(\lambda \in \Lambda \setminus \{1,|\Lambda |\}\) let \(\gamma ^\lambda \in [0,1]\) be a parameter such that

$$\begin{aligned} b^\lambda (s)= \gamma ^\lambda \cdot b^1(s) + (1-\gamma ^\lambda ) \cdot b^{|\Lambda |}(s) \end{aligned}$$

holds. We define the corresponding scenario flows \(f^\lambda \), \(\lambda \in \Lambda \setminus \{1,|\Lambda |\}\) by

$$\begin{aligned} f^\lambda (a):= \gamma ^\lambda \cdot f^1(a) + (1-\gamma ^\lambda ) \cdot f^{|\Lambda |}(a) \end{aligned}$$

for all arcs \(a \in A\). Flows \(f^\lambda \), \(\lambda \in \Lambda \setminus \{1,|\Lambda |\}\) satisfy the capacity and flow balance constraints, but may be non-integral on some free arcs. Therefore, we restrict every \(b^\lambda \)-flow \(f^\lambda \), \(\lambda \in \Lambda \setminus \{1,|\Lambda |\}\) to the respective MCF instance \(\widetilde{\mathcal {I}}^\lambda \) obtained analogous to the Proof of Lemma 1, and this results in feasible \(\tilde{b}^\lambda \)-flows denoted by \(\tilde{f}^\lambda \). Let \(\tilde{f}^{\lambda }_{\text {OPT}}\) be an optimal integral \(\tilde{b}^\lambda \)-flow for instance \(\widetilde{\mathcal {I}}^\lambda \), \(\lambda \in \Lambda \setminus \{1,|\Lambda |\}\), then \(c(\tilde{f}^\lambda _{\text {OPT}})\le c(\tilde{f}^{\lambda })\) holds true. For all scenarios \(\lambda \in \Lambda \setminus \{1,|\Lambda |\}\), flows \(\tilde{f}^{\lambda }_{\text {OPT}}\) and \(\tilde{f}^\lambda \) can be retransformed to flows \(f^\lambda _{\text {OPT}}\), and respectively, \(f^\lambda \) of instance \(\mathcal {I}\), ending up in cost of

$$\begin{aligned} c(f^\lambda _{\text {OPT}})&= c(\tilde{f}^{\lambda }_{\text {OPT}} ) + \sum _{a\in A^{\text {fix}}} c(a) f^1(a)\\&\le c(\tilde{f}^{\lambda }) + \sum _{a\in A^{\text {fix}}} c(a) f^1(a)\\&= c(f^{\lambda })\\&=\gamma ^\lambda \cdot c(f^1) + (1-\gamma ^\lambda ) \cdot c(f^{|\Lambda |})\\&\le \max \{c(f^1), c(f^{|\Lambda |})\}. \end{aligned}$$

Consequently, an optimal robust \(\varvec{b}\)-flow \(\varvec{f_\mathbf{OPT }}=(f^1,f^2_{\text {OPT}},\ldots ,f^{|\Lambda |-1}_{\text {OPT}}, f^{|\Lambda |})\) with cost \(c({\varvec{f}_\mathbf{OPT }})=\max \{c(f^1), c(f^{|\Lambda |})\}\) is obtained in polynomial time analogous to the Proof of Lemma 1. \(\square \)

As a result of Lemma 2, if a network with a unique source and a unique sink is given, we only need to concentrate on the first and last scenario to solve the RobMCF\(\equiv \) problem. We obtain the following conclusion about the problem’s complexity which is detailed in the next section.

Corollary 4

For a set of scenarios \(\Lambda \) with \(|\Lambda |\ge 2\), let a RobMCF\(\equiv \) instance with a unique source and unique sink be given. The complexity is not influenced by the number of scenarios.

4 Complexity for acyclic digraphs

In this section, we investigate the complexity of the RobMCF\(\equiv \) problem for networks based on acyclic digraphs. For convenience, we discuss the problem’s complexity for networks with a unique source and multiple sinks first. The construction is extended to show the strong \(\mathcal {NP}\)-completeness for networks with a unique source and a unique sink. Both reductions are performed from the (3, B2)-Sat problem (Berman et al. 2004)—a strongly \(\mathcal {NP}\)-complete special case of the 3-Sat problem. We start with a formal definition for the decision version of the (3, B2)-Sat problem.

Definition 3

((3, B2)-Sat) Let \(\{x_1,\ldots ,x_n\}\) be a set of variables. Further, let \(C_1,\ldots ,C_m\) be a collection of clauses of size three where every positive and negative literal \(x_i\) and \(\overline{x}_i\) occur exactly twice. The decision problem of (3, B2)-Sat asks if there exists a variable assignment that satisfies the collection of clauses.

Using the (3, B2)-Sat problem, we obtain the following complexity result.

Theorem 1

Deciding whether a feasible solution to the RobMCF\(\equiv \) problem exists for networks based on acyclic digraphs with a unique source but multiple sinks is strongly \(\mathcal {NP}\)-complete, even if only two scenarios and unit arc capacities are considered.

For the sake of clarity, we use the notation \([n]:=\{1,\ldots ,n\}\) in the following.

Proof

The RobMCF\(\equiv \) problem is contained in \(\mathcal {NP}\) as we can check in polynomial time whether the flow balance, capacity, and consistent flow constraints are satisfied for every scenario. Further, we show that deciding whether a feasible solution of the RobMCF\(\equiv \) problem exists is strongly \(\mathcal {NP}\)-complete by a reduction from the (3, B2)-Sat problem.

Let \(\mathcal {I}\) be a (3, B2)-Sat instance with the set of variables \(\{x_1,\ldots ,x_n\}\) and clauses \(C_1,\ldots ,C_m\) for which we construct a corresponding RobMCF\(\equiv \) instance \(\widetilde{\mathcal {I}}= (G, u, c, \varvec{b})\) considering a set of two scenarios, i.e., \(\Lambda =\{1,2\}\). An example of a RobMCF\(\equiv \) instance corresponding to a (3, B2)-Sat instance with four clauses and three variables is visualized in Fig. 2. In general, the instance is based on a digraph \(G=(V,A)\) defined as follows. The vertex set V consists of one vertex \(v_i\) per variable \(x_i\), \(i\in [n]\), an additional dummy vertex \(v_{n+1}\), and one vertex \(u_j\) per clause \(C_j\), \(j\in [m]\). In addition, for every literal \(x_i\) (\(\overline{x}_i\)), \(i\in [n]\) four auxiliary vertices \(w^\ell _i\) (\(\overline{w}^\ell _i\)), \(\ell \in [4]\) are included as well as a further auxiliary vertex t. Arc set A includes arcs that connect two successive variable vertices \(v_i\), \(v_{i+1}\), \(i\in [n]\) by two parallel paths \(p_i\) and \(\overline{p}_i\) defined along the auxiliary vertices, i.e., \(p_i=v_i w^1_i w^2_i w^3_i w^4_i v_{i+1}\) and \(\overline{p}_i=v_i\overline{w}^1_i \overline{w}^2_i \overline{w}^3_i \overline{w}^4_i v_{i+1}\) for \(i\in [n]\). Path \(p_i\) represents the positive literal \(x_i\), and path \(\overline{p}_i\) the negative literal \(\overline{x}_i\) of instance \(\mathcal {I}\). As each literal occurs exactly twice in instance \(\mathcal {I}\), we identify two arcs of paths \(p_i\) and \(\overline{p}_i\) each with the literals. More precisely, let \(x^k_i\) (\(\overline{x}^k_i\)) denote literal \(x_i\) (\(\overline{x}_i\)) which occurs the k-th time, \(k\in [2]\) in the formula. Arc \((w^{2k-1}_i,w^{2k}_i)\) (\((\overline{w}^{2k-1}_i,\overline{w}^{2k}_i)\)), which we refer to as literal arc, is supposed to correspond to literal \(x^k_i\) (\(\overline{x}^k_i\)). Using this correspondence, we add arc \((w^{2k}_i, u_{j})\) (\((\overline{w}^{2k}_i, u_{j})\)) for every literal \(x^k_i\) (\(\overline{x}^k_i\)), \(i\in [n]\), \(k\in [2]\) included in clause \(C_{j}\), \(j\in [m]\). Finally, arcs \((v_1,w^\ell _i)\) and \((v_1,\overline{w}^\ell _i)\) for \(\ell \in \{1,3\}\) as well as arcs \((w^\ell _i,t)\) and \((\overline{w}^\ell _i,t)\) for \(\ell \in \{2,4\}\) are added for every \(i\in [n]\).

Fig. 2
figure 2

Construction of the RobMCF\(\equiv \) instance \(\widetilde{\mathcal {I}}\)

The fixed arcs of set A are defined by all literal arcs, i.e., \(A^\text {fix}= \big \{(w^\ell _i ,w^{\ell +1}_i), (\overline{w}^\ell _i , \overline{w}^{\ell +1}_i) \mid \ell \in \{1,3\},\ i\in [n]\big \},\) while all remaining arcs are contained in set \(A^\text {free}\). We set the capacity and cost to \(u\equiv 1\) and \(c\equiv 0\), respectively. To conclude, we define balances \(\varvec{b}=(b^1,b^2)\) such that the unique source is given by vertex \(v_1\). In contrast, depending on the scenario considered, vertex \(v_{n+1}\), or vertices \(u_1,\ldots ,u_m\) and t function as sinks. More precisely, we obtain

$$\begin{aligned} b^1(v) = \left\{ \begin{array}{ll} 1 &{} {\mathrm{if}~ v=v_1}, \\ -1 &{} {\mathrm{if}~ v=v_{n+1}}, \\ 0 &{} \text{ otherwise }, \end{array} \right.&\ b^2(v)= \left\{ \begin{array}{ll} 2n &{} {\mathrm{if}~ v=v_1}, \\ -1 &{}{\mathrm{if}~ v=u_j, \ j\in [m]}, \\ m-2n &{} {\mathrm{if}~ v=t}, \\ 0 &{} \text{ otherwise }. \end{array} \right. \end{aligned}$$

In summary, we obtain a feasible RobMCF\(\equiv \) instance \(\widetilde{\mathcal {I}}= (G, u, c, \varvec{b})\) that can be constructed in polynomial time. Hence, it remains to show that \(\mathcal {I}\) is a Yes-instance if and only if for instance \(\widetilde{\mathcal {I}}\) a feasible robust \(\varvec{b}\)-flow exists.

For this purpose, let \(x_1,\ldots ,x_n\) be a satisfying truth assignment for instance \(\mathcal {I}\). We define the first scenario flow \(f^1\) of instance \(\widetilde{\mathcal {I}}\) as follows

$$\begin{aligned} f^1(a)=\left\{ \begin{array}{ll} 1 &{}\text {for all } a\in A(p_i) \,{ \mathrm{if}\, x_i=\textsc {True}}, \\ 1 &{}\text {for all } a\in A(\overline{p}_i) \, { \mathrm{if}\, x_i=\textsc {False}}, \\ 0 &{}\text{ otherwise }, \end{array} \right. \end{aligned}$$

i.e., flow \(f^1\) sends exactly one unit from source \(v_1\) to sink \(v_{n+1}\) using 2n literal arcs by sending flow along either path \(p_i\) or \(\overline{p}_i\), \(i\in [n]\). As \(x_1,\ldots ,x_n\) is a satisfying truth assignment, there exists one verifying literal \(x^k_i\) or \(\overline{x}^k_i\), \(k\in [2]\), \(i\in [n]\) for each clause \(C_j\), \(j\in [m]\). We define the second scenario flow \(f^2\) from the source to the clause vertices along the literal arcs which correspond to these verifying literals:

$$\begin{aligned} f^2(a)= {\left\{ \begin{array}{ll} 1 &{}\text {for all } a\in A(q) \text { with }q=v_1w^{2k-1}_i w^{2k}_iu_{j}\, { \mathrm{if}\, x^k_i\in C_{j} \,\mathrm{is}\,\mathrm{verifying}}, \\ 1 &{}\text {for all } a\in A(q) \text { with }q=v_1\overline{w}^{2k-1}_i\overline{w}^{2k}_i u_{j} \,{ \mathrm{if}\, \overline{x}^k_i\in C_{j} \,\mathrm{is}\,\mathrm{verifying}},\\ 0 &{}\text{ otherwise }. \end{array}\right. } \end{aligned}$$

To satisfy the remaining \(2n-m\) demand, flow \(f^2\) is defined along the remaining, and also from flow \(f^1\) used, literal arcs to sink t, i.e., \(f^2(a)=1\) for all

$$\begin{aligned} \left\{ \begin{array}{ll} a\in A(p) \text { with }p=v_1w^{2k-1}_iw^{2k}_i t \,{ \mathrm{if}\, x_i=\textsc {True} ~~\mathrm{and} \,f^2((w^{2k-1}_i, w^{2k}))=0}, \\ a\in A(p) \text { with }p=v_1\overline{w}^{2k-1}_i\overline{w}^{2k}_i t\, { \mathrm{if}\, x_i=\textsc {False}~~ \mathrm{and} \, f^2((\overline{w}^{2k-1}_i,\overline{w}^{2k}))=0}. \\ \end{array} \right. \end{aligned}$$

Overall, flow \(f^2\) sends \(2n-m\) units to sink t and one unit to each of the sinks \(u_1,\ldots ,u_m\) using exactly 2n literal arcs. Consequently, we have constructed \(b^\lambda \)-flows \(f^\lambda \) for both scenarios \(\lambda \in \Lambda \) such that the consistent flow constraints are satisfied, and this results in a feasible robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,f^2)\).

Conversely, let \(\varvec{f}=(f^1,f^2)\) be a feasible robust \(\varvec{b}\)-flow. Flow \(f^2\) sends in total 2n units from vertex \(v_1\) to vertices \(u_1,\ldots ,u_m\) and t. By construction of the network, the only option to reach each of these sinks requires the usage of at least one of the fixed literal arcs. Due to the integral flow \(f^1\) sending only one unit within the acyclic digraph, it holds \(f^1(a)= f^2(a)\in \{0,1\}\) for all fixed arcs \(a\in A^\text {fix} \). Consequently, flows \(f^1\) and \(f^2\) use at least 2n fixed arcs in order to meet the demand of flow \(f^2\). As further consequence of the acyclic digraph, flow \(f^1\) uses either path \(p_i\) or \(\overline{p}_i\), \(i\in [n]\) but never both simultaneously to reach sink \(v_{n+1}\). Accordingly, if flow \(f^1\) sends flow along path \(p_i\), \(i\in [n]\), we set \(x_i=\textsc {True}\). If flow \(f^1\) sends flow along path \(\overline{p}_i\) for \(i\in [n]\), our choice is \(x_i=\textsc {False}\). Further, to meet the demand at sinks \(u_j\), \(j\in [m]\), flow \(f^2\) sends flow along either subpath \(w^\ell _iw^{\ell +1}_iu_{j}\) or \(\overline{w}^\ell _i\overline{w}^{\ell +1}_iu_{j}\) for \(\ell \in \{1,3\}\), \(i\in [n]\), \(j\in [m]\) but never both simultaneously. In the former case, clause \(C_{j}\) is verified due to the previous assignment \(x_i=\textsc {True}\) induced by flow \(f^1\) and the fact that \(x_i\in C_{j}\) holds. In the latter case, clause \(C_{j}\) is verified due to the included variable \(x_i\) set to False. As a result, \(x_1,\ldots ,x_n\) is a satisfying truth assignment for instance \(\mathcal {I}\).

The statement of Theorem 1 can be formulated even stronger as the following theorem shows.

Theorem 2

Deciding whether a feasible solution to the RobMCF\(\equiv \) problem exists for networks based on acyclic digraphs is strongly \(\mathcal {NP}\)-complete, even if only two scenarios on a network with a unique source, a unique sink, and unit arc capacities are considered.

Proof

We extend the construction of Proof of Theorem 1 by free arcs \((u_j,v_{n+1})\) for \(j\in [m]\) as well as the two free arcs \((v_1,w^4_n)\) and \((v_1,\overline{w}^4_n)\). Like all other arcs in the network, their capacities and costs are set to one and zero, respectively. The balances are updated such that \(v_1\) serves as unique source and \(v_{n+1}\) as unique sink. However, in the second scenario we require \(2n+2\) instead of 2n demand sent from the source to the sink. This adjustment is necessary as we need to ensure that sufficient demand is sent along the clause vertices which are no sinks anymore. Otherwise, there might exist a feasible robust \(\varvec{b}\)-flow that sends a unit along path \(v_1w^3_nw^4_nv_{n+1}\) or \(v_1\overline{w}^3_n\overline{w}^4_nv_{n+1}\) which in turn allows one unsatisfied clause. Analogous to the Proof of Theorem 1, a (3, B2)-Sat instance is a Yes-instance if and only if for the corresponding RobMCF\(\equiv \) instance a feasible robust flow exists.

5 RobMCF\(\equiv \) problem on series-parallel digraphs

In this section, we consider the RobMCF\(\equiv \) problem on series-parallel (SP) digraphs. We firstly present a definition of SP digraphs and their representation in the form of a rooted binary decomposition tree. Exploiting the decomposition tree, i.e., the instruction of the composition of an SP digraph, we reduce the complexity for two special cases of the RobMCF\(\equiv \) problem, unless \(\mathcal {P}=\mathcal {NP}\). In Sect. 5.1, we show the weak \(\mathcal {NP}\)-completeness for networks with multiple sources and multiple sinks. For the special case of a constant number of scenarios, we exclude the strong \(\mathcal {NP}\)-completeness by proposing a pseudo-polynomial time algorithm. For the special case of networks with a unique source and a unique sink, we provide an algorithm which runs in polynomial time as shown in Sect. 5.2.

We start with a formal definition for SP digraphs based on the edge SP multi-graphs definition of Valdes et al. (1982).

Definition 4

Series-parallel (SP) digraphs can be recursively defined as follows.

  1. 1.

    An arc \((o,q)\) is an SP digraph with origin \(o\) and target \(q\).

  2. 2.

    Let \(G_1\) with origin \(o_1\) and target \(q_1\) and \(G_2\) with origin \(o_2\) and target \(q_2\) be SP digraphs. The digraph that is constructed by one of the following two compositions of SP digraphs \(G_1\) and \(G_2\) is itself an SP digraph.

    1. (a)

      The series composition G of two SP digraphs \(G_1\) and \(G_2\) is the digraph obtained by contracting target \(q_1\) and origin \(o_2\). The origin of digraph G is then \(o_1\) (becoming \(o\)), and the target is \(q_2\) (becoming \(q\)).

    2. (b)

      The parallel composition G of two SP digraphs \(G_1\) and \(G_2\) is the digraph obtained by contracting origins \(o_1\) and \(o_2\) (becoming \(o\)) and contracting targets \(q_1\) and \(q_2\) (becoming \(q\)). The new origin of digraph G is \(o\), and the target is \(q\).

The parallel and series compositions are illustrated in Fig. 3a. Note that, by definition, SP digraphs are generally multi-graphs with one definite origin and one definite target.

Fig. 3
figure 3

a Example of an SP digraph defined by a parallel or series composition b Example of the representation of an SP digraph by its SP tree

A useful property of SP digraphs is their representability in the form of a rooted binary decomposition tree, a so-called SP tree, visualized in Fig. 3b. For a given SP digraph, we construct an SP tree that represents the order of the series and parallel compositions of individual arcs. By means of three different vertices, namely L-vertices, S-vertices, and P-vertices, single arcs as well as series and parallel compositions are indicated. The SP tree’s leaves are L-vertices where there exist as many L-vertices as the digraph represented has arcs. The S- and P-vertices are the SP tree’s inner vertices and correspond to the digraph obtained by a series or, respectively, parallel composition of the subgraphs associated with their two child vertices. The order of the children of P-vertices is irrelevant while it is essential for S-vertices as the series composition is not commutative. Following the constructions of all series and parallel compositions, we obtain the entire digraph represented by the SP tree’s root. The representation of an SP digraph by its SP tree can be beneficially used as the construction is conducted in polynomial time (Valdes et al. 1979).

Using the SP trees, we define pearl digraphs—SP digraphs with a special structure—based on the definition of Ohst (2016).

Definition 5

Pearl digraphs are SP digraphs whose SP trees do not have P-vertices whose children in turn are S-vertices.

In other words, a pearl digraph is a digraph that consists of a path with multi-arcs.

5.1 Multiple sources and multiple sinks networks

In this section, we firstly concentrate on the complexity of the RobMCF\(\equiv \) problem for networks based on SP digraphs. For the special case that the number of scenarios is constant, we propose a pseudo-polynomial time algorithm. We start with a formal definition for the decision version of the RobMCF\(\equiv \) problem.

Definition 6

The decision version of the RobMCF\(\equiv \) problem asks whether a robust flow exists with cost at most \(\beta \in \mathbb {Z}_{\ge 0}\).

We perform a reduction from Partition, which is known to be weakly \(\mathcal {NP}\)-complete (Johnson and Garey 1979).

Definition 7

(Partition) Let \(S=\{s_1,\ldots ,s_n\}\) be a set of n positive integers that sum up to 2w, i.e., \(\sum ^{n}_{i=1}s_i=2w\). The decision problem of Partition asks whether there exists a partition of set S in two disjoint subsets \(S_1\) and \(S_2\) such that the sum of the integers of subsets \(S_1\) is equal to the sum of the integers included in subset \(S_2\), i.e., \(S=S_1\uplus S_2\) with

$$\begin{aligned} \sum _{s_i\in S_1} s_i = \sum _{s_i\in S_2} s_i = w. \end{aligned}$$

Theorem 3

The decision version of the RobMCF\(\equiv \) problem on networks based on SP digraphs is weakly \(\mathcal {NP}\)-complete, even if only two scenarios, unit arc capacities, a unique source, and single sinks are considered on pearl digraphs.

Fig. 4
figure 4

Construction of the RobMCF\(\equiv \) instance \(\widetilde{\mathcal {I}}\)

Proof

Let \(\mathcal {I}\) be a Partition instance with positive integers \(s_1,\ldots ,s_n\) such that \(\sum ^{n}_{i=1}s_i=2w\) holds. We construct a corresponding RobMCF\(\equiv \) instance \(\widetilde{\mathcal {I}}= (G, u, c, \varvec{b})\) considering a set of two scenarios, i.e., \(\Lambda =\{1,2\}\), visualized in Fig. 4. The network is based on a pearl digraph \(G=(V,A)\) where vertex set V consists of two auxiliary vertices \(v_0\) and t, and one vertex \(v_i\) per integer \(s_i\), \(i\in [n]\). Arc set A consists of multi-arcs \(a_{i}\) for \(i\in [n]\) that connects two successive vertices \(v_{i-1}\), \(v_{i}\) by three parallel arcs \(a^1_{i}, a^2_{i},a^3_{i}\), plus a single arc \(a_{n+1}\) from vertex \(v_{n}\) to vertex t. Multi-arc \(a_i\), \(i\in [n]\) is supposed to represent integer \(s_i\), which is why we refer to as integer multi-arcs. The fixed arcs of set A are defined by the second arc of all integer multi-arcs each, i.e., \(A^\text {fix}= \{a^2_i=(v_{i-1},v_{i}) \mid i\in [n]\}\), while all remaining arcs are contained in set \(A^{{{\,\mathrm{free}\,}}}\).

Further, we set the capacity on all arcs to one, i.e., \(u\equiv 1\). The cost c is given such that the use of the first arc \(a^1_i\) and second arc \(a^2_i\) of every integer multi-arc costs two and one times the corresponding integer value \(s_i\) per flow unit, respectively. In turn, using the third arc \(a^3_i\) causes zero cost. The use of arc \(a_{n+1}\) costs 2w per flow unit. To conclude, we define balances \(\varvec{b}=(b^1,b^2)\) on vertex set V such that in the first scenario vertex \(v_0\) supplies and vertex \(v_n\) demands two units. In the second scenario, vertex \(v_0\) supplies and vertex t demands one unit. In both scenarios, the balances of all other vertices are equal to zero, i.e., overall we obtain

$$\begin{aligned} b^1(v)= \left\{ \begin{array}{ll} 2 &{} {\mathrm{if}~ v=v_0}, \\ -2 &{} {\mathrm{if}~ v=v_n}, \\ 0 &{} \text{ otherwise }, \end{array} \right. \&b^2(v)= \left\{ \begin{array}{ll} 1 &{} {\mathrm{if}~ v=v_0}, \\ -1 &{} {\mathrm{if}~ v=t}, \\ 0 &{} \text{ otherwise }. \end{array} \right. \end{aligned}$$

Accordingly, for both scenarios the unique source is defined by vertex \(v_0\) while depending on the scenario considered vertex \(v_n\) or t serves as single sink. In order to satisfy demand with supply, flow is sent along paths through the network. For convenience, let \(p^\ell \) denote the path along the \(\ell \)-th integer multi-arcs for \(\ell \in [3]\), i.e., \(p^\ell =a^\ell _1\ldots a^\ell _{n}\). Overall, we obtain a feasible RobMCF\(\equiv \) instance \(\widetilde{\mathcal {I}}= (G, u, c, \varvec{b})\) that can be constructed in polynomial time. Hence, it remains to show that \(\mathcal {I}\) is a Yes-instance if and only if for instance \(\widetilde{\mathcal {I}}\) a robust \(\varvec{b}\)-flow exists with cost of at most \(\beta :=3w\).

For this purpose, let \(S_1\) and \(S_2\) be a feasible partition for instance \(\mathcal {I}\). We define the first scenario flow \(f^1\) of instance \(\widetilde{\mathcal {I}}\) by

$$\begin{aligned} f^1(a)= \left\{ \begin{array}{ll} 1 &{} \text {for all arcs }a=a^1_i\in A \, { \mathrm{if} \, s_i\in S_1}, \\ 1 &{} \text {for all arcs }a=a^2_i\in A \, { \mathrm{if}\, s_i\in S_2}, \\ 1 &{} \text {for all arcs }a=a^3_i\in A, \\ 0 &{} \text {otherwise}, \end{array} \right. \end{aligned}$$

i.e., flow \(f^1\) sends one unit from source \(v_0\) to sink \(v_n\) along arcs of paths \(p^1\) and \(p^2\), while one further unit is sent using arcs of path \(p^3\) only. As the sets \(S_1\) and \(S_2\) form a feasible partition we obtain cost of

$$\begin{aligned} c(f^1)&= \sum _{a\in A} c(a) f^1(a)= \sum _{a\in A^{{{\,\mathrm{fix}\,}}}} c(a) f^1(a) + \sum _{a\in A^{{{\,\mathrm{free}\,}}}} c(a) f^1(a) =w+2w =3w. \end{aligned}$$

According to flow \(f^1\) and the partition, we define the second scenario flow \(f^2\) by

$$\begin{aligned} f^2(a)= \left\{ \begin{array}{ll} 1 &{} \text {for all arcs }a=a^2_i\in A \, { \mathrm{if}\, s_i\in S_2}, \\ 1 &{} \text {for all arcs }a=a^3_i\in A \, { \mathrm{if} \, s_i\in S_1}, \\ 1 &{} \text {for arc }a=a_{n+1}\in A, \\ 0 &{} \text {otherwise}, \end{array} \right. \end{aligned}$$

i.e., flow \(f^2\) sends exactly one unit from source \(v_0\) to sink t along arcs of paths \(p^2\) and \(p^3\), and by using arc \(a_{n+1}\). The following cost is caused

$$\begin{aligned} c(f^2)&= \sum _{a\in A} c(a) f^2(a)\\&= \sum _{a\in A^\text {fix}} c(a) f^2(a) + \sum _{a\in A^\text {free}\setminus \{a_{n+1}\}} c(a) f^2(a) + c(a_{n+1}) f^2(a_{n+1}) \\&=w+0+2w =3w. \end{aligned}$$

Consequently, we have constructed a robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,f^2)\) with cost of 3w.

Conversely, let \(\varvec{f}=(f^1,f^2)\) be a robust \(\varvec{b}\)-flow with cost of at most 3w, i.e., \( c(\varvec{f})=\max \{c(f^1), c(f^2)\}\le 3w.\) The first scenario flow \(f^1\) sends two units from source \(v_0\) to sink \(v_n\). Due to the capacities, not only a single path is used to send these flow units. In particular, not only path \(p^3\) causing zero cost is used. As sending one flow unit along path \(p^1\) would cause cost of

$$\begin{aligned} c(p^1)= \sum _{a\in A(p^1)}c(a)=\sum ^n_{i=1}2 s_i = 4w > 3w\ge \max \{c(f^1), c(f^2)\}, \end{aligned}$$

flow \(f^1\) does not use all arcs of path \(p^1\) either. Accordingly, flow \(f^1\) uses as many arcs of path \(p^2\) as at least cost of w is caused in order that at most 2w cost is caused due to arcs of path \(p^1\).

The second scenario flow \(f^2\) sends one unit from source \(v_0\) to sink t. As flow \(f^2\) uses arc \(a_{n}\) with cost of 2w to reach sink t, the unit is sent along arcs of paths \(p^1\), \(p^2\), \(p^3\) such that at most cost of w is caused. Furthermore, as flow \(f^1\) uses as many arcs of path \(p^2\) as at least cost of w is caused, this also holds true for flow \(f^2\) as \(A(p^2)=A^{{{\,\mathrm{fix}\,}}}\) holds. Consequently, flow \(f^2\) only uses arcs of path \(p^2\) and \(p^3\), however, due to the acyclic pearl digraph never of the same multi-arc simultaneously such that the sets

$$\begin{aligned} S_1&:=\{s_i\mid f^2(a^2_i)=1 \text { for arc }a^2_i\in A^\text {fix} \text { with }i\in [n]\},\\ S_2&:=\{s_i\mid f^2(a^3_i)=1 \text { for arc }a^3_i\in A(p^3)\text { with }i\in [n]\} \end{aligned}$$

form a feasible partition for instance \(\mathcal {I}\).

In the next step, we refute the strong \(\mathcal {NP}\)-completeness in the special case of a constant number of scenarios. Therefore, we propose a pseudo-polynomial algorithm based on dynamic programming. The dynamic program (DP) is applicable for networks with an arbitrary number of sources and sinks, especially for multiple sources and multiple sinks. The core idea of the DP is a bottom-up method using the SP tree. While composing the SP digraph step by step, in each of these steps a robust flow is sought satisfying additional restrictions explained in the following. The flow needs to send a given supply from the origin through the subgraph considered in the current step. Further, the flow needs to satisfy the inner vertices’ balances as their in- and outgoing arcs are already set. In contrast, the balances at the origin and target do not have to be satisfied as in subsequent steps further subgraphs can still be composed at these vertices. Moreover, the flow must exactly meet a budget given. Backtracking the steps of the DP results to an optimal robust flow. Before we present the DP in more detail, we introduce the notations and labels needed.

Let us consider a RobMCF\(\equiv \) instance \((G,u,c,\varvec{b})\) where G is an SP digraph with origin \(o\) and target \(q\). Further, let T be the SP tree of digraph G with its root vertex \(r\in V(T)\). We denote the subgraph of digraph G that is associated to vertex \(v\in V(T)\) by \(G_v\), and its origin and target by \(o_v\) and \(q_v\), respectively. The algorithm relies on demand labels \(d_v(\varvec{\tilde{s}_{v}},\varvec{\tilde{c}_v})\) defined for every subgraph \(G_v\) associated with a vertex \(v\in V(T)\). The parameter vector \(\varvec{\tilde{s}_{v}}=(\tilde{s}^1_{v}, \ldots ,\tilde{s}_{v}^{|\Lambda |})\in \mathbb {Z}^{|\Lambda |}_{\ge 0}\) determines for all scenarios the supply at origin \(o_v\) of subgraph \(G_v\). For every scenario \(\lambda \in \Lambda \) the supply \(\tilde{s}^\lambda _{v}\) is limited by the sum of the capacities of all outgoing arcs of origin \(o_v\) of subgraph \(G_v\), i.e., \(\tilde{s}^\lambda _{v}\in \{0,\ldots , U_{v}\}\) with \(U_{v}=\sum _{ a=(o_v,w)\in A(G_v)} u(a)\). The parameter vector \(\varvec{\tilde{c}_v}=(\tilde{c}_{v}^1,\ldots ,\tilde{c}_{v}^{|\Lambda |})\in \mathbb {Z}^{|\Lambda |}_{\ge 0}\) specifies for all scenarios the budget that must be spent for sending the supply in subgraph \(G_v\) with respect to cost function c. Consequently, an upper bound on the budget is given by the cost that may occur in subgraph \(G_v\), i.e., \(\tilde{c}^\lambda _{v}\in \{0,\ldots , C_{v}\}\) for \(\lambda \in \Lambda \) with \(C_{v}=\sum _{a\in A(G_v)} c(a)\cdot u(a)\).

Let the \((\varvec{\tilde{s}_{v}}\), \(\varvec{\tilde{c}_v})\)-restricted robust minimum cost flow problem under consistent flow constraints (rRobMCF\(\equiv (\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\)) be defined as the RobMCF\(\equiv \) problem on subgraph \(G_v\), \(v\in V(T)\) with restrictions implied by supply \(\varvec{\tilde{s}_{v}}\) and budget \(\varvec{\tilde{c}_v}\). The demand label \(d_v(\varvec{\tilde{s}_{v}},\varvec{\tilde{c}_v})\) is defined as the optimal solution value of the rRobMCF\(\equiv (\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) problem. For convenience and for the sake of clarity, we indicate the rRobMCF\(\equiv (\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) problem by the following integer program formulation.

$$\begin{aligned} d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_v}) = \min \ \&0 \end{aligned}$$
(1)
$$\begin{aligned} \text { s.t. }&\sum _{a\in A(G_v)} c(a)\cdot f^\lambda _a= \tilde{c}^\lambda _v&\forall \lambda \in \Lambda \end{aligned}$$
(2)
$$\begin{aligned}&\sum _{a=(w,z) \in A(G_v)}f^\lambda _a - \sum _{a=(z,w) \in A(G_v)}f^\lambda _a \nonumber \\&= \left\{ \begin{array}{ll} b^\lambda (w) &{} {\mathrm{if}~ w\ne o_v,}\\ \tilde{s}^\lambda _w &{} {\mathrm{if}~ w= o_v}, \end{array} \right.&\forall w\in V(G_v)\setminus \{q_v\},\lambda \in \Lambda \end{aligned}$$
(3)
$$\begin{aligned}&f^\lambda _a=f^{\lambda ^\prime }_a&\forall a \in A^{\text {fix}}(G_v), \lambda , \lambda ^\prime \in \Lambda \end{aligned}$$
(4)
$$\begin{aligned}&0\le f^\lambda _a \le u(a)&\forall a \in A(G_v), \lambda \in \Lambda \end{aligned}$$
(5)
$$\begin{aligned}&f^\lambda _a \in \mathbb {Z}_{\ge 0}&\forall a \in A(G_v), \lambda \in \Lambda \end{aligned}$$
(6)

The rRobMCF\(\equiv (\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) problem requires a robust \(\varvec{b}\)-flow in subgraph \(G_v\) by means of constraints (3)–(6). Therefore, the flow needs to satisfy the supply \(\varvec{\tilde{s}_{v}}\) at origin \(o_v\), and the balances \(\varvec{b}\) at all other vertices except target \(q_v\). Furthermore, the flow must exactly meet the budget \(\varvec{\tilde{c}_v}\), see constraint (2). By definition of the objective function (1), finding a feasible solution is sufficient to solve the rRobMCF\(\equiv (\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) problem, i.e., \(d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_v})\in \{0,\infty \}\).

For solving the RobMCF\(\equiv \) problem on SP digraphs, the DP exploits the structure of the SP tree to compute demand labels recursively. More precisely, considering a specific vertex in the SP tree, we update the corresponding demand label based on the labels corresponding to the children’s vertices in a bottom-up procedure. Depending on whether the SP tree’s vertex considered is an L-, S-, or P-vertex, one of the following three procedures is applied. An example of the procedures of the DP is given in Appendix A. We start with the initialization at the leaves.

Lemma 3

Let \(v\in V(T)\) be a leaf of SP tree T, i.e., v is an L-vertex. The demand label \(d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) is initialized by

$$\begin{aligned} d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_v}) = \left\{ \begin{array}{ll} 0 &{} \text{ if } (o_v,q_v)\in A^{{{\,\mathrm{free}\,}}}(G_v)\text{, } \tilde{c}^\lambda _v =c((o_v, q_v))\cdot \tilde{s}_{v}^\lambda \text{, } \forall \lambda \in \Lambda , \\ 0 &{} \text{ if } (o_v,q_v)\in A^{{{\,\mathrm{fix}\,}}}(G_v)\text{, } \tilde{s}^\lambda _{v}= \tilde{s}^{\lambda ^\prime }_{v}\text{, } \tilde{c}^\lambda _v = c((o_v, q_v))\cdot \tilde{s}_{v}^\lambda \text{, } \forall \lambda , \lambda ^\prime \in \Lambda , \\ \infty &{} \text{ otherwise }. \end{array} \right. \end{aligned}$$

Proof

As \(v\in V(T)\) is an L-vertex, subgraph \(G_v\) only consists of the single arc \(a_v:=(o_v,q_v)\). If \(a_v\) is a free arc, i.e., \(a_v\in A^{{{\,\mathrm{free}\,}}}(G_v)\), \(\tilde{c}^\lambda _v =c((o_v, q_v))\cdot \tilde{s}_{v}^\lambda \) must hold true. Otherwise, there exists no feasible flow that satisfies constraints (2) due to constraints (3). Consequently, the rRobMCF\(\equiv (\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) problem is not solvable, i.e., \(d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})=\infty \). If \(a_v\) is a fixed arc, i.e., \(a_v\in A^{{{\,\mathrm{fix}\,}}}(G_v)\), the constraints of the previous case need to be satisfied due to the same argumentation. In addition, \(\tilde{s}^\lambda _{v}= \tilde{s}^{\lambda ^\prime }_{v}\) must hold true for all scenarios \(\lambda , \lambda ^\prime \in \Lambda \) by reason of constraints (4). To conclude, if the presented constraints are satisfied, an optimal solution to the rRobMCF\(\equiv (\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) problem is given by \(\varvec{f}(a_v):=\varvec{\tilde{s}_v}\) such that \(d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})=0\) holds true.

In the next step, we consider the case in which the demand label is derived recursively from the demand labels of the child vertices that are parallelly composed.

Lemma 4

Let \(v\in V(T)\) be a P-vertex in SP tree T with child vertices \(x,y\in V(T)\). The demand label \(d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) at vertex v can be computed by a composition of the demand labels \(d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x})\) and \(d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}) \) of its child vertices x and y as follows

$$\begin{aligned} d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}}) = \min \limits _{\begin{array}{c} \varvec{\tilde{s}_{v}} =\varvec{\tilde{s}_{x}} + \varvec{\tilde{s}_{y}}\\ \varvec{\tilde{c}_{v}} =\varvec{\tilde{c}_{x}} + \varvec{\tilde{c}_{y}} \end{array}} \left\{ d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}) + d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}) \right\} . \end{aligned}$$

Proof

For vertex \(v\in V(T)\), let \(d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) be the demand label with the related solution \(\varvec{f^*}\). As v is a P-vertex, flow \(\varvec{f^*}\) with associated supply \(\varvec{\tilde{s}_{v}}=\sum _{a=(o_v,w)\in A(G_v)} \varvec{f^*}(a)\) can be divided into two flows \(\varvec{f_x}\) and \(\varvec{f_y}\) with associated supplies \(\varvec{\tilde{s}_{x}}\) and \(\varvec{\tilde{s}_{y}}\), respectively. Flow \(\varvec{f_x}\) is defined on subgraph \(G_x\), and flow \(\varvec{f_y}\) is defined on subgraph \(G_y\) only. The budget \(\varvec{\tilde{c}_{v}}=\sum _{a\in A(G_v)} c(a)\cdot \varvec{f^*}(a)\) of flow \(\varvec{f^*}\) is also divided such that \(\varvec{\tilde{c}_{x}}\) describes the budget of flow \(\varvec{f_x}\) and \(\varvec{\tilde{c}_{y}}\) the budget of flow \(\varvec{f_y}\). Flows \(\varvec{f_x}\) and \(\varvec{f_y}\) are feasible solutions to the rRobMCF\(\equiv (\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_{x}})\) and rRobMCF\(\equiv (\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_{y}})\) problem, respectively. Consequently, we obtain

$$\begin{aligned}&d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}}) = d_v(\varvec{\tilde{s}_{x}}+\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_x}+\varvec{\tilde{c}_y}) \ge d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x})+d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}), \end{aligned}$$

where \(d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_{x}})\) and \(d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_{y}})\) are the demand labels corresponding to the child vertices \(x,y\in V(T)\). In particular, this implies

$$\begin{aligned} d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}}) \ge \min \limits _{\begin{array}{c} \varvec{\tilde{s}_{v}} =\varvec{\tilde{s}_{x}} + \varvec{\tilde{s}_{y}}\\ \varvec{\tilde{c}_{v}} =\varvec{\tilde{c}_{x}} + \varvec{\tilde{c}_{y}} \end{array}} \left\{ d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}) + d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}) \right\} . \end{aligned}$$

Conversely, for child vertices \(x,y\in V(T)\), let \(d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_{x}})\) and \(d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_{y}})\) be the demand labels with related solutions \(\varvec{f^*_x}\) and \(\varvec{f^*_y}\). Combining flows \(\varvec{f^*_x}\) and \(\varvec{f^*_y}\) results in a feasible solution \(\varvec{f_{v}}:=\varvec{f^*_x}+ \varvec{f^*_y}\) to the rRobMCF\(\equiv (\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) problem with supply \(\varvec{\tilde{s}_v}:=\varvec{\tilde{s}_{x}}+\varvec{\tilde{s}_{y}}\) and budget \(\varvec{\tilde{c}_{v}}:=\varvec{\tilde{c}_{x}}+\varvec{\tilde{c}_{y}}\). Consequently, for all supplies \(\varvec{\tilde{s}_{x}}\), \(\varvec{\tilde{s}_{y}}\) and budgets \(\varvec{\tilde{c}_{x}}\), \(\varvec{\tilde{c}_{y}}\) given the following holds true

$$\begin{aligned}&d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}) + d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}) \ge d_v(\varvec{\tilde{s}_{x}}+\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_x}+\varvec{\tilde{c}_y})=d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_v}), \end{aligned}$$

where \(d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_v})\) is the demand label corresponding to vertex \(v\in V(T)\). This implies

$$\begin{aligned} d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_v}) \le \min \limits _{\begin{array}{c} \varvec{\tilde{s}_{v}} =\varvec{\tilde{s}_{x}} + \varvec{\tilde{s}_{y}}\\ \varvec{\tilde{c}_{v}} =\varvec{\tilde{c}_{x}} + \varvec{\tilde{c}_{y}} \end{array}} \left\{ d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}) + d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}) \right\} . \end{aligned}$$

To conclude the computation of demand labels, we consider the case in which a demand label is derived recursively from the demand labels of the child vertices that are serially composed.

Lemma 5

Let \(v\in V(T)\) be an S-vertex in SP tree T with child vertices \(x,y\in V(T)\). The demand label \(d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) at vertex v can be computed by a composition of the demand labels \(d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x})\) and \(d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}) \) of its child vertices x and y by

$$\begin{aligned} d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}}) = \min \limits _{\begin{array}{c} \varvec{\tilde{s}_{x}}= \varvec{\tilde{s}_{v}}\\ \varvec{\tilde{s}_{y}}= \varvec{\tilde{s}_{x}} + \varvec{\beta } \\ \varvec{\tilde{c}_{v}} =\varvec{\tilde{c}_{x}} + \varvec{\tilde{c}_{y}} \end{array}} \left\{ d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}) + d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}) \right\} , \end{aligned}$$

where \(\varvec{\beta }=(\beta ^1,\ldots ,\beta ^{|\Lambda |})\) with \( \beta ^\lambda := \sum _{v\in V(G_x)\setminus \{o_x\}}b^\lambda (v)\) holds for every scenario \(\lambda \in \Lambda \).

Proof

For vertex \(v\in V(T)\), let \(d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) be the demand label with the related solution \(\varvec{f^*}\). We assume that digraph \(G_v\) is constructed by contracting the target \(q_x\) of subgraph \(G_x\) with the origin \(o_y\) of subgraph \(G_y\). Consequently, the flow that is sent through subgraph \(G_y\) requires on the one hand the access via origin \(o_y\). On the other hand, at least the same amount of flow is originated in subgraph \(G_x\) in the first place. Using this insight, we partition flow \(\varvec{f^*}\) and the associated supply \(\varvec{\tilde{s}_{v}}=\sum _{a=(o_v,w)\in A(G_v)} \varvec{f^*}(a)\) in two flows \(\varvec{f_x}\) and \(\varvec{f_y}\) where flow \(\varvec{f_x}\) is defined on subgraph \(G_x\) and flow \(\varvec{f_y}\) is defined on subgraph \(G_y\) only. More precisely, we obtain \(\varvec{f_x}(a):=\varvec{f^*}(a)\) for all arcs \(a\in A(G_x)\) with associated supply \(\varvec{\tilde{s}_{x}}=\varvec{\tilde{s}_{v}}\), and \(\varvec{f_y}(a):=\varvec{f^*}(a)\) for all arcs \(a\in A(G_y)\) with associated supply \(\varvec{\tilde{s}_{y}}:=\sum _{a=(o_y,w)\in A(G_y)} \varvec{f^*}(a)= \varvec{\tilde{s}_{x}}+\varvec{\beta }\) where \(\varvec{\beta }=(\beta ^1,\ldots ,\beta ^{|\Lambda |})\) with \(\beta ^\lambda := \sum _{v\in V(G_x)\setminus \{o_x\}}b^\lambda (v)\), \(\lambda \in \Lambda \). The associated supply \(\varvec{\tilde{s}_{y}}\) results from the supply \(\varvec{\tilde{s}_{x}}\) plus the flow that originates from sources (that are different from the origin) in subgraph \(G_x\) minus the flow that is absorbed at sinks in subgraph \(G_x\). The budget \(\varvec{\tilde{c}_{v}}=\sum _{a\in A(G_v)} c(a)\cdot \varvec{f^*}(a)\) of flow \(\varvec{f^*}\) can also be divided such that \(\varvec{\tilde{c}_{x}}\) describes the budget of flow \(\varvec{f_x}\) and \(\varvec{\tilde{c}_{y}}\) the one of flow \(\varvec{f_y}\). Flows \(\varvec{f_x}\) and \(\varvec{f_y}\) are feasible solutions to the rRobMCF\(\equiv (\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_{x}})\) and rRobMCF\(\equiv (\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_{y}})\) problem, respectively. Consequently, we obtain

$$\begin{aligned} d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}}) = d_v(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}+\varvec{\tilde{c}_y})&\ge d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}) + d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}), \end{aligned}$$

where \(d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x})\) and \(d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y})\) are the demand labels corresponding to child vertices \(x,y\in V(T)\). In particular, this implies

$$\begin{aligned} d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}}) \ge \min \limits _{\begin{array}{c} \varvec{\tilde{s}_{x}}= \varvec{\tilde{s}_{v}}\\ \varvec{\tilde{s}_{y}}= \varvec{\tilde{s}_{x}} + \varvec{\beta } \\ \varvec{\tilde{c}_{v}} =\varvec{\tilde{c}_{x}} + \varvec{\tilde{c}_{y}} \end{array}} \left\{ d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}) + d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}) \right\} . \end{aligned}$$

Conversely, for child vertices \(x,y\in V(T)\), let \(d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_{x}})\) and \(d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_{y}})\) with \(\varvec{\tilde{s}_{y}}=\varvec{\tilde{s}_{x}} + \varvec{\beta }\) be the demand labels with related solutions \(\varvec{f^*_x}\) and \(\varvec{f^*_y}\). Combining flows \(\varvec{f^*_x}\) and \(\varvec{f^*_y}\) results in a feasible solution \(\varvec{f_{v}}:=\varvec{f^*_x}+\varvec{f^*_y}\) to the rRobMCF\(\equiv (\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_{v}})\) problem with supply \(\varvec{\tilde{s}_v}:=\varvec{\tilde{s}_{x}}\) and budget \(\varvec{\tilde{c}_{v}}:=\varvec{\tilde{c}_{x}}+\varvec{\tilde{c}_{y}}\). Consequently, for all supplies \(\varvec{\tilde{s}_{x}}\), \(\varvec{\tilde{s}_{y}}\) and budgets \(\varvec{\tilde{c}_{x}}\), \(\varvec{\tilde{c}_{y}}\) the following holds true

$$\begin{aligned} d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}) + d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}) \ge d_v(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}+\varvec{\tilde{c}_y}) =d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_v}), \end{aligned}$$

where \(d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_v})\) is the demand label corresponding to vertex \(v\in V(T)\). This implies

$$\begin{aligned} d_v(\varvec{\tilde{s}_{v}}, \varvec{\tilde{c}_v}) \le \min \limits _{\begin{array}{c} \varvec{\tilde{s}_{x}}= \varvec{\tilde{s}_{v}}\\ \varvec{\tilde{s}_{y}}= \varvec{\tilde{s}_{x}} + \varvec{\beta } \\ \varvec{\tilde{c}_{v}} =\varvec{\tilde{c}_{x}} + \varvec{\tilde{c}_{y}} \end{array}} \left\{ d_x(\varvec{\tilde{s}_{x}}, \varvec{\tilde{c}_x}) + d_y(\varvec{\tilde{s}_{y}}, \varvec{\tilde{c}_y}) \right\} . \end{aligned}$$

Finally, a robust flow in SP digraph G is obtained by backtracking the steps of the DP, and considering the demand label associated to the SP tree’s root r.

Lemma 6

Let \(\varvec{f}\) be an optimal robust \(\varvec{b}\)-flow in SP digraph \(G_r\). For the cost it holds that

$$\begin{aligned} c(\varvec{f}) = \min \Big \{\hat{c} \ \big |\big . \ \exists \ \varvec{\tilde{c}_r}\in \{0,\ldots ,C_r\}^{|\Lambda |}: \ \max _{\lambda \in \Lambda }\tilde{c}^\lambda _{r}=\hat{c} \ \wedge \ d_r(\varvec{b}(o_r), \varvec{\tilde{c}_r})=0\Big \} \end{aligned}$$
(7)

with \(C_r=\sum _{a\in A(G_r)} c(a)\cdot u(a)\).

Proof

For all vertices \(v\in V(G)\setminus \{q\}\), the flow balance constraints of the RobMCF\(\equiv \) problem are ensured by constraints (3) of the rRobMCF\(\equiv (\varvec{\tilde{s}_{r}}, \varvec{\tilde{c}_{r}})\) problem with \(\varvec{\tilde{s}_{r}}= \varvec{b}(o_r)\). The consistent flow and capacity constraints as well as the integer conditions of the RobMCF\(\equiv \) problem are one to one included in the rRobMCF\(\equiv (\varvec{\tilde{s}_{r}}, \varvec{\tilde{c}_{r}})\) problem by constraints (4), (5) and (6), respectively. Accordingly, every feasible solution to the rRobMCF\(\equiv (\varvec{\tilde{s}_{r}}, \varvec{\tilde{c}_{r}})\) problem is also a feasible solution to the RobMCF\(\equiv \) problem.

However, the rRobMCF\(\equiv (\varvec{\tilde{s}_{r}}, \varvec{\tilde{c}_{r}})\) problem contains one additional set of constraints, namely constraints (2). Constraints (2) control whether the cost of a flow is equal to the budget. For this reason, we look for a budget \(\varvec{\tilde{c}_r}\in \{0,\ldots ,C_r\}^{|\Lambda |}\) for which a feasible solution to the rRobMCF\(\equiv (\varvec{\tilde{s}_{r}}, \varvec{\tilde{c}_{r}})\) problem exists, i.e., for which \(d_r(\varvec{b}(o_r), \varvec{\tilde{c}_r})=0\) holds true. This solution corresponds to a robust \(\varvec{b}\)-flow \(\varvec{f}\) with cost \(c(\varvec{f})=\max _{\lambda \in \Lambda } c(f^\lambda )= \max _{\lambda \in \Lambda }\tilde{c}^\lambda _{r}\). Therefore, we are interested in the minimum maximum budget needed among all scenarios \(\lambda \in \Lambda \) which we obtain by expression (7).

After all, we analyze the runtime of the DP.

Theorem 4

Let \((G,u,c,\varvec{b})\) be a RobMCF\(\equiv \) instance where G is an SP digraph with origin o. Using the DP described, the RobMCF\(\equiv \) problem can be solved in \(\mathcal {O}(|A(G)|(U+1)^{2|\Lambda |}( C+1)^{2|\Lambda |})\) time where \(U:=\sum _{ a=(o,v)\in A(G)} u(a)\) and \(C:=\sum _{ a\in A(G)} c(a)\cdot u(a)\) holds.

Proof

The correctness of the algorithm follows from Lemmas 36. Considering the runtime, first of all, we mention that the representation of an SP digraph G by its SP tree T can be computed in \(\mathcal {O}(|A(G)|)\) (Valdes et al. 1979). At every SP tree’s vertex \(v\in V(T)\) demand labels for all supplies \(\varvec{\tilde{s}_v}\) and budgets \(\varvec{\tilde{c}_v}\) need to be calculated where the number of combinations is limited by \((U+1)^{|\Lambda |} \cdot (C+1)^{|\Lambda |}\). As SP tree T of SP digraph G has exactly \(|V(T)|=2|A(G)|-1\) vertices, we have to compute \(\mathcal {O}(2|A(G)|\cdot (U+1)^{|\Lambda |} \cdot (C+1)^{|\Lambda |})\) demand labels. It remains to bound the complexity for computing the demand labels. If \(v\in V(T)\) is an L-vertex, computing the corresponding demand labels is clearly in \(\mathcal {O}(1)\). If \(v\in V(T)\) is an S- or P-vertex, we need to compute the minimum of \((U+1)^{|\Lambda |}(C+1)^{|\Lambda |}\) sums which is in \(\mathcal {O}((U+1)^{|\Lambda |}(C+1)^{|\Lambda |})\). In total, we obtain a runtime of \(\mathcal {O}(2|A(G)|\cdot (U+1)^{2|\Lambda |} \cdot (C+1)^{2|\Lambda |})\).

By reason of Theorem 4, the pseudo-polynomial runtime of the DP follows if the number of scenarios is constant. Together with the result of Theorem 3 we obtain the following corollary.

Corollary 5

The decision version of the RobMCF\(\equiv \) problem on networks based on SP digraphs with multiple sources and multiple sinks is weakly \(\mathcal {NP}\)-complete, even if only two scenarios and unit arc capacities are considered on pearl digraphs. If the number of scenarios is not part of the input, the RobMCF\(\equiv \) problem can be solved by the presented DP in pseudo-polynomial time.

5.2 Special case of unique source and unique sink networks

In this section, we provide a polynomial time algorithm for the special case of networks based on SP digraphs with a unique source and a unique sink. The core idea of the algorithm is based on the algorithm of Bein et al. (1985) which iteratively sends flow along shortest paths to solve the MCF problem. Before we propose a generalized algorithm for the RobMCF\(\equiv \) problem, we investigate properties of an optimal robust flow in the networks considered. In particular, we study the cost and show that we can restrict the statement of Lemma 2.

We start with introducing the notations and definitions needed. Let us consider a RobMCF\(\equiv \) instance \((G,u,c,\varvec{b})\) where G is an SP digraph with origin \(o\) and target \(q\). As SP digraphs are acyclic, we assume without loss of generality that the unique source complies with origin \(o\) and the unique sink complies with target \(q\). Due to Lemma 2, we limit our efforts to a set of two scenarios, i.e., \(\Lambda =\{1,2\}\). For convenience, we introduce a demand vector \(\varvec{d}=(d^1,d^2)\), consisting of the number of flow units that, according to the balances \(\varvec{b}\), are supplied from the unique source and demanded by the unique sink, i.e., \(d^1:=b^1(o)=-b^1(q)\) and \(d^2:=b^2(o)=-b^2(q)\). Without loss of generality, let \(d^1\) and \(d^2\) be given such that \(d^1\le d^2\) holds true. Further, let \(H\subseteq G\) be an SP subgraph with origin \(o_H\). We denote the flow value of a given flow \(f^\lambda \), \(\lambda \in \Lambda \) entering subgraph H by \(\delta (f^{\lambda }_{|H})\) such that the following holds

$$\begin{aligned} \delta (f^{\lambda }_{|H}):= \sum _{a=(o_H,w)\in A(H)} f^\lambda (a). \end{aligned}$$

Using these notations and definitions we aim at investigating the cost of an optimal robust flow. In contrast to networks based on acyclic digraphs with a unique source and a unique sink, see Example 2, for the special case considered in this section it is sufficient to concentrate on the cost of the last scenario flow. Before we prove this statement, we need the following two auxiliary lemmas.

Lemma 7

Let G be an SP digraph which is composed by subgraphs \(G_1\) and \(G_2\), and let \((G,u,c,\varvec{b})\) be a corresponding RobMCF\(\equiv \) instance. There exists an optimal robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,f^2)\) for which \(\delta (f^{2}_{|G_1})\ge \delta (f^{1}_{|G_1})\) and \(\delta (f^{2}_{|G_2})\ge \delta (f^{1}_{|G_2})\) hold true.

By reason of the consistent flow constraints, the statement is not apparent. Due to the length, the proof is moved to Appendix B.

Lemma 8

Let \((G,u,c,\varvec{b})\) be a RobMCF\(\equiv \) instance where G is an SP digraph. There exists an optimal robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,f^{2})\) such that \(f^2(a)\ge f^1(a)\) holds true for all arcs \(a\in A(G)\).

Proof

Let T be the SP tree of SP digraph G. As we consider a digraph with a unique source and a unique sink, the statement of Lemma 7 can be recursively transferred to subgraphs \(G_v\subseteq G\) associated to the SP tree’s vertices \(v\in V(T)\), i.e., \(\delta (f^{2}_{|G_v})\ge \delta (f^{1}_{|G_v})\) for all \(v\in V(T)\). Consequently, \(f^2(a)\ge f^1(a)\) holds true for all arcs \(a\in A(G)\).

Note that, in general, the statement of Lemma 8 is not true for acyclic digraphs as Example 2 shows. We are now able to prove the following crucial lemma regarding the cost of a robust flow.

Lemma 9

Let \((G,u,c,\varvec{b})\) be a RobMCF\(\equiv \) instance where G is an SP digraph. There exists an optimal robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,f^{2})\) whose cost is determined by the cost of the last scenario flow, i.e., \(c(\varvec{f})=\max \{c(f^1),c(f^{2})\}=c(f^{2})\).

Proof

By Lemma 8, there exists an optimal robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1, f^2)\) such that \(f^2(a)\ge f^1(a)\) holds for all arcs \(a\in A(G)\). The scenario flows cause the following cost

$$\begin{aligned} c(f^1)= \sum _{a\in A} c(a)\cdot f^1(a) \le \sum _{a\in A} c(a)\cdot f^2(a) = c(f^2), \end{aligned}$$

from which the statement immediately follows.

By reason of Lemma 9, we concentrate on the last scenario in the following. Firstly, we note that a last scenario flow needs to send demand \(d^2-d^1\) in subgraph \(G-A^{{{\,\mathrm{fix}\,}}}\), and we refer to this demand as excess demand. Before we present a further useful property of the last scenario flow regarding its excess demand and a shortest path in subgraph \(G-A^{{{\,\mathrm{fix}\,}}}\), we need the following auxiliary lemma.

Lemma 10

Let G be a series composition of SP digraphs \(G_1\) and \(G_2\), and let \(\mathcal {I}\) be a corresponding RobMCF\(\equiv \) instance. Then, let \(\mathcal {I}_1\) and \(\mathcal {I}_2\) be the RobMCF\(\equiv \) instances which are obtained by restricting instance \(\mathcal {I}\) to subgraphs \(G_1\) and \(G_2\), respectively. A solution \(\varvec{f}\) to instance \(\mathcal {I}\) is optimal if and only if the solutions \(\varvec{f}_{|G_1}\) and \(\varvec{f}_{|G_2}\), which can be obtained by restricting \(\varvec{f}\) to subgraphs \(G_1\) and \(G_2\), are optimal to instances \(\mathcal {I}_1\) and \(\mathcal {I}_2\), respectively.

A proof can be found in Appendix B. Example 4 in Appendix B shows that the SP property of the digraph is necessary for the truthfulness of Lemma 10. Using Lemma 10, we formulate a useful property for an existing optimal robust flow.

Lemma 11

Let \(G=(V,A=A^{{{\,\mathrm{fix}\,}}}\cup A^{{{\,\mathrm{free}\,}}})\) be an SP digraph with origin o and target q. Further, let \(\mathcal {I}=(G,u,c,\varvec{b})\) be a corresponding RobMCF\(\equiv \) instance with demand \(\varvec{d}=(d^1,d^2)\), \(d^2\ge d^1\). With respect to cost c, let p be a shortest \((o,q)\)-path in subgraph \(G-A^{{{\,\mathrm{fix}\,}}}\) with its bottleneck value \(u_p=\min _{a\in A(p)}u(a)\). There exists an optimal robust \(\varvec{b}\)-flow \(\varvec{f}=(f^1,f^2)\) for which the following holds true

$$\begin{aligned} f^2(a)\ge \min \{u_p,d^2-d^1\}&\,\text { for all }\ a\in A(p). \end{aligned}$$
(8)

Proof

We prove the correctness of the statement by induction on the number of the digraph’s arcs \(m:=|A|\). For the beginning, if we consider a digraph consisting of one arc only, the statement is readily apparent. In the next step, we prove the statement for a digraph with \(m+1\) arcs, providing that the statement holds true for all digraphs consisting of at most m arcs. For this purpose, we distinguish between two cases.

Firstly, we assume that G is a series composition of SP digraphs \(G_1\) and \(G_2\). Therefore, the origin of digraph \(G_1\) and the target of digraph \(G_2\) are contracted to one vertex that we denote by w. Due to the composition of digraph G, a shortest \((o,q)\)-path p in subgraph \(G-A^{{{\,\mathrm{fix}\,}}}\) is composed of a shortest \((o,w)\)-path \(p_{1}\) in subgraph \(G_1-A^{{{\,\mathrm{fix}\,}}}\), and a shortest \((w,q)\)-path \(p_2\) in subgraph \(G_2-A^{{{\,\mathrm{fix}\,}}}\), see Fig. 5a. Considering subgraphs \(G_1\) and \(G_2\) separately, we obtain the RobMCF\(\equiv \) instances \(\mathcal {I}_1\) and \(\mathcal {I}_2\), respectively. By induction hypothesis there exist an optimal robust flow \(\varvec{f}_{|G_1}=(f^1_{|G_1},f^2_{|G_1})\) in subgraph \(G_1\) and an optimal robust flow \(\varvec{f}_{|G_2}=(f^1_{|G_2},f^2_{|G_2})\) in subgraph \(G_2\) satisfying

$$\begin{aligned} f^2_{|G_1}(a)\ge \min \{u_{p_1},d^2-d^1\}&\, { \mathrm{for ~all ~arcs ~}a \in A(p_{1})}, \\ f^2_{|G_2}(a)\ge \min \{u_{p_2},d^2-d^1\}&\, { \mathrm{for ~all ~arcs ~}a \in A(p_2)}. \end{aligned}$$

By Lemma 10, the composed flow \(\varvec{f}=(f^1,f^2)\) with \(f^1:=f^1_{|G_1}+f^1_{|G_2}\) and \(f^2:=f^2_{|G_1}+f^2_{|G_2}\) is an optimal robust \(\varvec{b}\)-flow in digraph G where the desired property is still satisfied.

Fig. 5
figure 5

Shortest path p in subgraph \(G-A^{{{\,\mathrm{fix}\,}}}\) where digraph G is a series a or parallel b composition

Secondly, we assume that G is a parallel composition of SP digraphs \(G_1\) and \(G_2\). Without loss of generality, let the shortest \((o,q)\)-path p be contained in subgraph \(G_1-A^{{{\,\mathrm{fix}\,}}}\), see Fig. 5b. Further, let \(\varvec{f}=(f^1,f^2)\) be an optimal robust \(\varvec{b}\)-flow which sends demand \(\varvec{d}=(d^1,d^2)\) through digraph G that satisfies without loss of generality the property of Lemma 7, i.e., \(\delta (f^{2}_{|G_i}) - \delta (f^{1}_{|G_i})\ge 0\) for \(G_i\), \(i\in \{1,2\}\). If the optimal flow \(\varvec{f}\) does not satisfy the property (8), applying the following procedure leads to the desired result. We consider the subgraphs \(G_1\) and \(G_2\) separately, resulting in RobMCF\(\equiv \) instances \(\mathcal {I}_1\) and \(\mathcal {I}_2\), respectively. To define how much demand \(\varvec{d}_{|G_i}\) is supposed to be sent through subgraph \(G_i\) of instance \(\mathcal {I}_i\), we exploit the partition of demand \(\varvec{d}\) of the optimal flow \(\varvec{f}\), i.e., \(\varvec{d}_{|G_i}=(d^1_{|G_i}, d^2_{|G_i}):=(\delta (f^{1}_{|G_i}),\delta (f^{2}_{|G_i}))\) for \(i\in \{1,2\}\). Considering subgraph \(G_1\), by induction hypothesis there exists an optimal robust flow \(\varvec{\tilde{f}}=(\tilde{f}^1,\tilde{f}^2)\) which sends demand \(\varvec{d}_{|G_1}=(d^1_{|G_1}, d^2_{|G_1})\) and satisfies

$$\begin{aligned} \tilde{f}^2(a) \ge \min \{ u_p, d^2_{|G_1}- d^1_{|G_1} \}&\,{ \mathrm{for ~all ~arcs ~}a \in A(p)}. \end{aligned}$$

Further, let an optimal robust flow \(\varvec{\hat{f}}\) be given which sends demand \(\varvec{d}_{|G_2}\) through subgraph \(G_2\). By composing flows \(\varvec{\tilde{f}}\) and \(\varvec{\hat{f}}\), we obtain a robust \(\varvec{b}\)-flow \(\varvec{\overline{f}}=(\overline{f}^1,\overline{f}^2)\) with scenario flows \(\overline{f}^1:=\tilde{f}^1+\hat{f}^1\) and \(\overline{f}^2:=\tilde{f}^2+\hat{f}^2\) for instance \(\mathcal {I}\). Flow \(\varvec{\overline{f}}\) is optimal as there exists an optimal robust flow with the same partition \(\varvec{d}_{|G_1}\) and \(\varvec{d}_{|G_2}\) of demand \(\varvec{d}\) between subgraphs \(G_1\) and \(G_2\), and as flows \(\varvec{\tilde{f}}\) and \(\varvec{\hat{f}}\) are optimal themselves. It remains to prove that \(\overline{f}^2(a)\ge \min \{ u_p , d^2-d^1 \}\) holds for all arcs \(a\in A(p)\). We distinguish between the following two cases.

Firstly, we consider the case where \(d^2_{|G_1}- d^1_{|G_1}\ge \min \{ u_p , d^2-d^1 \}\) holds true. As \(\overline{f}^2(a)=\tilde{f}^2(a)\) holds for all arcs \(a\in A(G_1)\) by construction, the desired property results immediately for all arcs \(a\in A(p)\subseteq A(G_1)\) as shown by the following

$$\begin{aligned} \overline{f}^2(a)=\tilde{f}^2(a)&\ge \min \{ u_p, d_{|G_1}^2- d_{|G_1}^1 \}\\&\ge \min \{ u_p,\min \{ u_p, d^2-d^1\} \} \\&= \min \{ u_p, d^2-d^1 \}. \end{aligned}$$

Secondly, we consider the case where \(d^2_{|G_1}- d^1_{|G_1}< \min \{ u_p , d^2-d^1 \}\) holds true. Assume \(\overline{f}^2(a)< \min \{ u_p , d^2-d^1 \} \) is true for one arc \(a\in A(p)\subseteq A(G_1)\). We redirect the last scenario flow \(\overline{f}^2\) of robust flow \(\varvec{\overline{f}}\) such that demand of \(\min \{ u_p , d^2-d^1 \}\) is sent along the shortest path p in subgraph \(G-A^{{{\,\mathrm{fix}\,}}}\). As demand \(d^2-d^1\) needs to be sent in subgraph \(G-A^{{{\,\mathrm{fix}\,}}}\) in any case, and \(A(p)\subseteq A^{{{\,\mathrm{free}\,}}}\) holds, the resulting robust flow is still feasible, satisfies the desired property (8), and its cost is not increased.

Based on the derived knowledge by the presented lemmas, we can finally present an algorithm that solves the RobMCF\(\equiv \) problem on networks based on SP digraphs with a unique source and a unique sink.

figure a

Basically, Algorithm 5.1 computes a flow by sending the excess demand in subgraph \(G-A^{{{\,\mathrm{fix}\,}}}\) first, and subsequently, by sending the demand through digraph G which is sent in both scenarios. Composing the computed flows to a robust flow leads to an optimal solution obtained in polynomial time as the following theorem shows.

Theorem 5

Let G be an SP digraph, and let \(\mathcal {I}=(G,u,c,\varvec{b})\) be a corresponding RobMCF\(\equiv \) instance with demand \(\varvec{d}=(d^1,d^2)\), \(d^2\ge d^1\). Algorithm 5.1 computes an optimal robust \(\varvec{b}\)-flow for demand \(\varvec{d}\) in polynomial time.

Proof

We prove the statement by induction on the excess demand, i.e., \(k:=d^2-d^1\ge 0\). For the beginning, we consider the case where \(k=0\) holds. As the excess demand is zero, the same amount of flow needs to be sent in both scenarios. Thus, sending the excess demand in subgraph \(G-A^{{{\,\mathrm{fix}\,}}}\) in step 1 is omitted. In step 2, a minimum cost flow that sends demand \(d^1\) through digraph G is computed by the Greedy Algorithm of Bein et al. (1985). A feasible robust flow results whose scenario flows are equal. The robust flow is optimal by the correctness of the Greedy Algorithm of Bein et al.

For the induction step, let \(\varvec{\tilde{f}}=(\tilde{f}^1,\tilde{f}^2)\) be an optimal robust \(\varvec{b}\)-flow for instance \(\mathcal {I}\) which satisfies without loss of generality the properties of Lemmas 711, i.e., in particular, \(\tilde{f}^2(a)\ge \overline{u}:= \min \{u_p,k+1\}\) for \(a\in A(p)\). We consider the RobMCF\(\equiv \) instance \(\widehat{\mathcal {I}}:=(G,\hat{u},c,\varvec{\hat{b}})\) with the adjusted capacity \(\hat{u}\) and balances \(\varvec{\hat{b}}:=(b^1,\hat{b}^2)\). Capacity \(\hat{u}\) is obtained by reducing the capacity u of all arcs of path p by \(\overline{u}\), and accordingly updating the last scenario balances \(b^2\) of the source and sink results in the new balances \(\varvec{\hat{b}}:=(b^1,\hat{b}^2)\). Further, we obtain the new demand \(\varvec{\hat{d}}=(d^1,\hat{d}^2)\) with \(\hat{d}^2:=d^2-\overline{u} \). As the excess demand is less or equal to k in instance \(\widehat{\mathcal {I}}\), by induction hypothesis Algorithm 5.1 computes an optimal robust \(\varvec{\hat{b}}\)-flow \(\varvec{\hat{f}}=(\hat{f}^1, \hat{f}^2)\) that sends demand \(\varvec{\hat{d}}=(d^1, \hat{d}^2)\). We note that robust flow \(\varvec{\hat{f}}\) also satisfies the properties of Lemmas 711. In summary, we obtain that \(\hat{f}^2\) is a flow sending demand \(\hat{d}^2=d^2-\overline{u}\) for instance \(\widehat{\mathcal {I}}\), and by assumption, \(\tilde{f}^2\) is an optimal last scenario flow sending demand \(d^2\) for instance \(\mathcal {I}\). Furthermore, by assumption flow \(\tilde{f}^2\) sends \(\overline{u}\) demand along the shortest path p in subgraph \(G-A^{{{\,\mathrm{fix}\,}}}\). Overall, we obtain for the cost of flow \(\hat{f}^2\) the following upper bound

$$\begin{aligned} c(\hat{f}^2)\le c(\tilde{f}^2) - \overline{u} \cdot c(p). \end{aligned}$$

By reformulating, we obtain

$$\begin{aligned} c(\hat{f}^2)+ \overline{u} \cdot c(p)\le c(\tilde{f}^2), \end{aligned}$$

and together with the condition that the cost of both flows are determined by the last scenario flows, the following holds true

$$\begin{aligned} c(\varvec{\hat{f}}) + \overline{u} \cdot c(p)\le c(\varvec{\tilde{f}}). \end{aligned}$$

Consequently, flow \(\varvec{f}=(f^1,f^2)\) with scenario flows \(f^1:=\hat{f}^1\) and \(f^2:=\hat{f}^2 + \overline{f}\) is an optimal robust \(\varvec{b}\)-flow sending demand \(\varvec{d}\) where flow \(\overline{f}\) is defined by \(\overline{f}(a):=\overline{u}\) for all arcs \(a\in A(p)\). Moreover, flow \(\varvec{f}=(f^1,f^2)\) complies with the flow computed by the Algorithm 5.1 for instance \(\mathcal {I}\).

Finally, considering the algorithm’s runtime, we compute a minimum cost flow that sends demand \(d^2-d^1\) by the Minimum Mean Cycle-Cancel Algorithm in \(\mathcal {O}(|A|^3|V|^2\log |V|)\) time (Korte et al. 2012). Subsequently, we compute a flow that sends demand \(d^1\) by the Greedy Algorithm of Bein et al. (1985) in \(\mathcal {O}(|A|\cdot |V|+|A|\log |A|)\) time. In total, computing a robust minimum cost \(\varvec{b}\)-flow takes \(\mathcal {O}(|A|^3|V|^2\log |V|+|A|\cdot |V|+|A|\log |A|)\) time.

Note that we cannot use the Greedy Algorithm of Bein et al. (1985) in the first step of Algorithm 5.1 as \(G-A^{{{\,\mathrm{fix}\,}}}\) might not be an SP digraph.

6 Conclusion

In this paper, we introduced the RobMCF\(\equiv \) problem which is an extension of the MCF problem considering equal flow requirements and demand uncertainty. We presented structural results which differentiate from well known results of the MCF problem. In particular, we showed that Dantzig and Fulkerson’s Integral Flow Theorem (Korte et al. 2012) does not hold anymore. Furthermore, we proved that finding a feasible solution to the RobMCF\(\equiv \) problem is strongly \(\mathcal {NP}\)-complete on acyclic digraphs, even if a network with a unique source, a unique sink, and unit arc capacities are considered for two scenarios only. On SP digraphs, we proved that the decision version of the RobMCF\(\equiv \) problem is weakly \(\mathcal {NP}\)-complete. For the special case in which the number of scenarios is not part of the input, we proposed a pseudo-polynomial DP. For the special case of networks based on SP digraphs with a unique source and a unique sink, we provided an algorithm running in polynomial time.

For future work, we will study the complexity of the RobMCF\(\equiv \) problem on SP digraphs if the number of scenarios is part of the input. Furthermore, we will study the RobMCF\(\equiv \) problem for further graph classes as digraphs with bounded treewidth.