Conditional Lower Bounds for All-Pairs Max-Flow1footnote 11footnote 1This work was partially supported by the Israel Science Foundation grant #897/13 and by a Minerva Foundation grant. An extended abstract of this article will appear in Proceedings of ICALP 2017 and is also available at arXiv:1702.05805. The most significant difference is the addition of Section 4.

# Conditional Lower Bounds for All-Pairs Max-Flow111This work was partially supported by the Israel Science Foundation grant #897/13 and by a Minerva Foundation grant. An extended abstract of this article will appear in Proceedings of ICALP 2017 and is also available at arXiv:1702.05805. The most significant difference is the addition of Section 4.

Weizmann Institute of Science
###### Abstract

We provide evidence that computing the maximum flow value between every pair of nodes in a directed graph on nodes, edges, and capacities in the range , which we call the All-Pairs Max-Flow problem, cannot be solved in time that is faster significantly (i.e., by a polynomial factor) than . Since a single maximum -flow in such graphs can be solved in time [Lee and Sidford, FOCS 2014], we conclude that the all-pairs version might require time equivalent to computations of maximum -flow, which strongly separates the directed case from the undirected one. Moreover, if maximum -flow can be solved in time , then the runtime of computations is needed. This is in contrast to a conjecture of Lacki, Nussbaum, Sankowski, and Wulf-Nilsen [FOCS 2012] that All-Pairs Max-Flow in general graphs can be solved faster than the time of computations of maximum -flow.

Specifically, we show that in sparse graphs , if one can compute the maximum -flow from every in an input set of sources to every in an input set of sinks in time , for some , , and a constant , then MAX-CNF-SAT (maximum satisfiability of conjunctive normal form formulas) with variables and clauses can be solved in time for a constant , a problem for which not even algorithms are known. Such runtime for MAX-CNF-SAT would in particular refute the Strong Exponential Time Hypothesis (SETH). Hence, we improve the lower bound of Abboud, Vassilevska-Williams, and Yu [STOC 2015], who showed that for every fixed and , if the above problem can be solved in time , then some incomparable (and intuitively weaker) conjecture is false. Furthermore, a larger lower bound than ours implies strictly super-linear time for maximum -flow problem, which would be an amazing breakthrough.

In addition, we show that All-Pairs Max-Flow in uncapacitated networks with every edge-density , cannot be computed in time significantly faster than , even for acyclic networks. The gap to the fastest known algorithm by Cheung, Lau, and Leung [FOCS 2011] is a factor of , and for acyclic networks it is , where is the matrix multiplication exponent.

Finally, we extend our lower bounds to the version that asks only for the maximum-flow values that are bounded by a given threshold (over all source-sink pairs).

## 1 Introduction

The maximum flow problem is one of the most fundamental problems in combinatorial optimization. This classic problem and its variations such as minimum-cost flow, integral flow, and minimum-cost circulation, were studied extensively over the past decades, and have become key algorithmic tools with numerous applications, in theory and in practice. Moreover, techniques developed for flow problems were generalized or adapted to other problems, see for example [BJS10, AMO93, AHK12]. The maximum -flow problem, which we shall denote Max-Flow, asks to ship the maximum amount of flow from a source node to a sink node in a directed edge-capacitated graph , where throughout, we denote and , and assume integer capacities bounded by . After this problem was introduced in 1954 by Harris and Ross (see [Sch02] for a historical account), Ford and Fulkerson [FF56] devised the first algorithm for Max-Flow, which runs in time , where is the maximum value of a feasible flow. Ever since, a long line of generalizations and improvements was studied, and the current fastest algorithm for Max-Flow with arbitrary capacities is by Lee and Sidford [LS14], which takes time. For the case of small capacities and sufficiently sparse graphs, the fastest algorithm, due to Mądry [Mąd16], has a running time . Here and throughout, denotes for unspecified constant .

A very natural problem is to compute the maximum -flow for multiple source-sink pairs in the same graph . The seminal work of Gomory and Hu [GH61] shows that in undirected graphs, Max-Flow for all source-sink pairs requires at most executions of Max-Flow (see also [Gus90], where the computations are all on the input graph), and a lot of research aimed to extend this result to directed graphs, with several partial successes, see details in Section 1.1. However, it is still not known how to solve Max-Flow for multiple source-sink pairs faster than solving it separately for each pair, even in special cases like a single source and all possible sinks. We shall consider the following problems involving multiple source-sink pairs, where the goal is always to report the value of each flow (and not an actual flow attaining it).

###### Definition 1.1.

(Single-Source Max-Flow) Given a directed edge-capacitated graph and a source node , output, for every , the maximum flow that can be shipped in from to .

###### Definition 1.2.

(All-Pairs Max-Flow) Given a directed edge-capacitated graph , output, for every pair of nodes , the maximum flow that can be shipped in from to .

###### Definition 1.3.

(ST-Max-Flow) Given a directed edge-capacitated graph and two subsets of nodes , output, for every pair of nodes and , the maximum flow that can be shipped in from to .

###### Definition 1.4.

(Global Max-Flow) Given a directed edge capacitated graph , output the maximum among all pairs , of the maximum flow value that can be shipped in from to .

###### Definition 1.5.

(Maximum Local Edge Connectivity) Given a directed graph , output the maximum among all pairs , of the maximum number of edge-disjoint -paths in .

Note that in a graph with all edge capacities equal to , the problem of finding the maximum local edge connectivity is equivalent to finding the global maximum flow.

### 1.1 Prior Work

We start with undirected graphs, where the All-Pairs Max-Flow values can be represented in a very succint manner, called nowdays a Gomory-Hu tree [GH61]. In addition to being very succint, it allows the flow values and the corresponding cuts (vertex partitions) to be quickly retrieved. See Table 1 for a list of previous algorithms for multiple pairs maximum -flow, see Table 1. For directed graphs, no current algorithm computes the maximum flow between any given pairs of nodes faster than the time of separate Max-Flow computations. However, some results are known in special settings. It is possible to compute Max-Flow for pairs in the time it takes for a single Max-Flow computation [HO94] and this result is used to find a global minimum cut. However, these pairs cannot be specified in the input.

For directed planar graphs, there is an time algorithm for the Single-Source Max-Flow problem [LNSW12], which immediately yields an time algorithm for the All-Pairs version, that is much faster than the time of computations of planar Max-Flow, a problem that can be solved in time  [BK09]. Based on these results, it was conjectured in [LNSW12] that also in general graphs, All-Pairs Max-Flow can be solved faster than the time required for computing separate maximum -flows.

Several hardness results are known for multiple-pairs variants of Max-Flow [AVY15]. For ST-Max-Flow in sparse graphs () and , there is an lower bound assuming at least one of the Strong Exponential Time Hypothesis (SETH), 3SUM, and All-Pairs Shortest-Paths (APSP) conjectures is correct (for a comprehensive survey on them, see [Vas15]). In addition, they show that Single-Source Max-Flow on sparse graphs requires time, unless MAX-CNF-SAT can be solved in time for some fixed , and in particular SETH is false.

We will mostly rely on SETH, a conjecture introduced by [IP01], and on some weaker assumption related to its maximization version, MAX-CNF-SAT. In more detail, SETH states that for every fixed there is an integer such that -SAT on variables and clauses cannot be solved in time , where refers to for unspecified constant . By the sparsification lemma [IPZ01], in order to refute SETH it can be assumed that the number of clauses is . The MAX-CNF-SAT problem asks for the maximum number of clauses that can be satisfied in an input CNF formula. Most of our conditional lower bounds are based on the assumption that for every fixed , MAX-CNF-SAT cannot be solved in time , where currently even algorithms are not known for this problem [AVY15]. Note that this is a weaker assumption than SETH, since a faster algorithm for MAX-CNF-SAT would imply a faster algorithm for CNF-SAT and refute SETH. Different assumptions regarding the hardness of CNF-SAT have been the basis for many lower bounds, including for the runtime of solving NP-hard problems exactly, parametrized complexity, and problems in P. See the Introduction in [ABHS17] and the references therein.

### 1.2 Our Contribution

We present conditional runtime lower bounds for both uncapacitated and capacitated networks. The proofs appear in sections 2 and 3, respectively, where the order reflects increasing level of complication. All our lower bounds hold even when the input is a DAG and has a constant diameter, and in the case of general capacities, they can be easily modified to apply also for graphs with constant maximum degree. In addition, for integer we use to denote the range .

#### Capacitated Networks

Our main result is that for every set sizes and , the ST-Max-Flow cannot be solved significantly faster than (i.e., polynomially smaller runtime), unless a breakthrough in MAX-CNF-SAT is achieved, and consequently in SETH.

###### Theorem 1.6.

If for some fixed and some (possibly functions of ) set sizes and , ST-Max-Flow can be solved in graphs with nodes, edges and capacities in in time , then for some , MAX-CNF-SAT on variables and clauses can be solved in time , and in particular SETH is false.

This result improves the aforementioned lower bound of [AVY15], as for their setting of our lower bound is , although their lower bound is based on an incomparable (and intuitively weaker) conjecture, that at least one of the SETH, 3SUM, and APSP conjectures is correct. In fact, if there was a reduction from SETH that implied a larger runtime lower bound for ST-Max-Flow, then the (single-pair) Max-Flow problem would require a strictly super-linear time under it, but such a reduction is not possible unless the non-deterministic version of SETH (abbreviated NSETH) is false [CGI16]. And anyway, such a lower bound for Max-Flow would be an amazing breakthrough.

The next theorem is an immediate corollary of Theorem 1.6, by assigning .

###### Theorem 1.7.

If for some fixed , All-Pairs Max-Flow in graphs with nodes, edges, and capacities in can be solved in time , then for some , MAX-CNF-SAT on variables and clauses can be solved in time , and in particular SETH is false.

This conditional lower bound (see Figure 1) shows that All-Pairs Max-Flow requires time that is equivalent to computations of Max-Flow, which strongly separates the directed case from the undirected one (where a Gomory-Hu tree can be constructed in the time of computations). If Max-Flow takes time, which is currently open but plausible, then the running time of computations of Max-Flow is needed. This is in contrast to the aforementioned conjecture of Lacki, Nussbaum, Sankowski, and Wulf-Nilsen [LNSW12] that All-Pairs Max-Flow in general graphs can be solved faster than the time of computations of maximum -flow.

#### Uncapacitated Networks

For the case of uncapacitated networks, we show that for every , All-Pairs Max-Flow cannot be solved significantly faster than . Here we introduce a new technique to design reductions from SETH to graphs with varying edge densities, rather than the usual reductions that only deal with sparse graphs. Our technique is based on partitioning the variables set of CNF-SAT to different sizes.

###### Theorem 1.8.

If for some fixed and some , All-Pairs Max-Flow in uncapacitated graphs with nodes and edges can be solved in time , then for some , MAX-CNF-SAT on variables and clauses can be solved in time , and in particular SETH is false.

Hence, a certain additional improvement to the time algorithm of [CLL11] (and similarly to the time for DAGs, where our lower bounds apply too) is not likely. We now present conditional lower bounds for ST-Max-Flow, which are functions of and .

###### Theorem 1.9.

If for some fixed and some (possibly functions of ) set sizes and , ST-Max-Flow on uncapacitated graphs with nodes and edges can be solved in time , then for some , MAX-CNF-SAT on variables and clauses can be solved in time , and in particular SETH is false.

In addition, we present a conditional lower bound for computing the Maximum Local Edge Connectivity of a sparse graph, which is the same as Global Max-Flow if all the capacities are , which is indeed the case in our reduction. In the Orthogonal Vectors problem the input is two sets and , each of vectors from , and the goal is to determine whether there are and such that . An equivalent version of the problem has . For , Williams [Wil05] proved that SETH implies the non-existence of a truly subquadratic (in ) algorithm for the problem. The next result, proved in Section 5, was obtained together with Bundit Laekhanukit and Rajesh Chitnis, and we thank them for their permission to include it here.

###### Theorem 1.10.

If for some fixed , the Maximum Local Edge Connectivity in graphs with nodes and edges can be found in time , then for some , the Orthogonal Vectors problem on vectors and every can be solved in time , and in particular SETH is false.

#### Generalization to Bounded Cuts

Finally, we show in Section 4 that our lower bounds extend to the version that requires to output the maximum-flow value only for source-sink pairs for which this value is at most some given threshold .

## 2 Reduction to Multiple-Pairs Max-Flow with Unit Capacity

In this section we prove Theorems 1.8 and 1.9. We start with a general lemma which is the heart of the proofs.

###### Lemma 2.1.

Let and . Then MAX-CNF-SAT on variables and clauses can be reduced to instances of ST-Max-Flow with and in graphs with nodes, edges, and capacities in .

###### Proof.

Given a CNF-formula on variables and clauses as input for MAX-CNF-SAT, , and , we split the variables into three sets , , and , where is of size , is of size , and is of size , and enumerate all their , , and partial assignments (with respect to ), respectively, when the objective is to find a triple of assignments to , , and respectively, that satisfies the maximal number of clauses. We will have an instance of ST-Max-Flow for each value , in which by one call to ST-Max-Flow we check if there exists a triple , , and that satisfies at least clauses, as follows.

We construct a graph for every on nodes , where contains a node for every assignment to , contains nodes for every assignment to , that are and for every , , and the set , and contains a node for every assignment to . We use the notation for nodes in and for assignments to , for assignments to , and for nodes in and assignments to . However, it will be clear from the context. Now, we have to describe the edges in the network. In order to simplify the reduction, we partition the edges into blue and red colors, as follows.

For every , , and , we add a blue edge from to if both of and do not satisfy the clause (do not set any of the literals to true), and otherwise we add a red edge from to . We further add, for every , , and , a blue edge from to if does not satisfy . For every , , and , we add a red edge from every to every . For every and , we add a red edge from to and from to , and finally for every and , we add a red edge from to , where all edges are of capacity .

The graph we built has nodes, edges, with capacities in (see Figure 2), and its construction time is asymptotically the same as the time it takes to construct its edges set.

For every , , and , we denote by the graph induced from on the nodes

 (α,β′,γ)∪(⋃y∈{l,r}i∈[m]βyi)∪(⋃j∈[p−1]β′j)

We claim that for every and , the maximum flow from to can be bounded by the sum, over all , of the maximum flow between them in . This claim follow easily because the intersection for is exactly the source and the sink , no edge passes between these two graphs, and consists of all nodes that are both reachable from and is reachable from them.

We now prove that if there is an assignment to that satisfies at least clauses then the graph we built has a triple with maximum flow from to in at most . Since for every , is the number of outgoing edges from in , is also an upper bound for the maximum flow from to in it, and hence in it is at most . Otherwise, we will show that every triple has a maximum flow from to in of size at least , and so in it is at least . Hence, by simply picking the maximal such that the maximum flow in of some pair is at most , and then iterating over all assignments to with and fixed as the assignments to and , we can also find the required triple .

For the first direction, assume that has an assignment that satisfies at least clauses, and denote such assignment by . Let , , and be the assignments to , , and , respectively, that are induced from . Since a blue path from through for some to corresponds to , , and all do not satisfy , in there are at most (internally) disjoint blue paths from to . As the only way to ship flow in that is not through a blue path is through the node , and the total number of edges going out of this node is , we conclude that the total maximum flow in from to is bounded by . Since for every , the maximum amount of flow that can be shipped in from to is at most , summing over all we get that the total flow in from to is bounded by , as required.

For the second direction, assume that every assignment to satisfies at most clauses. In order to show that the maximum flow from every to every is at least , we first fix , , and . Then, by passing flow in two phases we show that units of flow can be passed in from to . As this argument applies for every , we can add up the respective flows without violating capacities, concluding the proof. By the assumption, there exist ’s, such that , , and do not satisfy , and we denote a set with this amount of such ’s by . Each of these ’s induces a blue path from to in , and so we ship a unit of flow through every one of them according to , in what we call the first phase. In the second phase, we ship additional units in the following way. Let , and , where denotes that the assignment satisfies (as defined earlier), and denotes that it does not satisfy . Let be a bijective function such that the range of is and the range of is . Clearly, there exists such bijection and it is easy to find one. For every we ship flow through the path , and for every through the path , in both cases with .

Since we defined the flow in paths, we only need to show that the capacity requirements hold, and we start with blue edges. Indeed, edges of the form are used in the first phase, with flow that is determined uniquely by and , and in the second phase uniquely according to and , and so they cannot be used twice. Edges of the form are only used in the first phase, and their flow is uniquely determined according to and , and so are good too. We now proceed to red edges, which were used only in the second phase.

Edges of the forms , and have flow that is uniquely determined by and , and so are not used more than once. Edges of the form have flow that is uniquely determined by and , and since is a bijection, every has at most one such that , and so these edges are also used at most once. As a byproduct, and since every edge of the form has only the edge as its source for flow, edges of the form are also used at most once. Altogether, we have bounded the total flow in all edges that were used in both phases, and so the capacity requirements follow, which completes the proof of the second direction and of Lemma 2.1. ∎

###### Proof of Theorem 1.8.

We apply Lemma 2.1 in the following way. By setting we get graphs with ( if ) and . Hence, and we get our desired bound for every between and and Theorem 1.8 follows. ∎

###### Proof of Theorem 1.9.

Here we apply Lemma 2.1 a bit differently. By setting we get graphs with and . By setting and we get our lower bound for and Theorem 1.9 follows. ∎

## 3 Reduction to Multiple-Pairs Max-Flow in Capacitated Networks

In this section we prove Theorems 1.6 and 1.7. We proceed to prove our main technical lemma.

###### Lemma 3.1.

MAX-CNF-SAT on variables and clauses can be reduced to instances of ST-Max-Flow, each with the property that , and all of them are in graphs with nodes, edges, and with capacities in .

###### Proof.

Given a CNF-formula on variables and clauses as input for MAX-CNF-SAT, we split the variables into three sets , , and of size each and enumerate all partial assignments (with respect to ) to each of them, when the objective is to find a triple of assignments to , , and , that satisfy the maximal number of clauses. We will have an instance of ST-Max-Flow with the mentioned property for each value , in which by one call to ST-Max-Flow we check if there exists a triple that satisfies at least clauses, as follows.

We construct the graph on nodes , where contains a node for every assignment to , contains nodes for every assignment to , that are , , , for every , and , contains a node for every assignment to , contains two nodes and for every clause , and contains a node for every clause . We use the notation for nodes in and assignments to , to assignments to , for nodes in and assignments to , and for nodes in and clauses. However, it will be clear from the context. Now, we have to describe the edges in the network. In order to simplify the reduction, we partition the edges into red and blue colors, as follows.

For every and we add a red edge of capacity from to if , and a blue edge of the same capacity from to otherwise. We further add, for every , a red edge of capacity from to , a blue edge of capacity from to , a blue edge of capacity from to if , a red edge of capacity from to , and a blue edge of capacity from to . For every we add a red edge of capacity from to . For every we add a red edge of capacity from to , and finally, for every and we add a blue edge of capacity from to if .

The graph we built has nodes, at most edges, all of its capacities are in , and its construction time is (see Figure 3).

We proceed to prove that if there is an assignment to that satisfies at least clauses then the graph we built has a pair with maximum flow from to at most , and otherwise, every has a maximum flow of size at least . Hence, by simply picking the maximal such that the maximum flow in of some pair is at most , and then iterating over all assignments to with and fixed as the assignments to and , we can also find the required triple .

For the first direction, assume that has an assignment that satisfies at least clauses, and denote such assignment by . Let , , and be the assignments to , , and , respectively, that are induced from . We will show that there exists an cut whose capacity is at most , hence by the Min-Cut Max-Flow theorem, the maximum flow from to is bounded by this number, concluding the proof of the first direction. We define the cut in a way that for every , the cut will have cut edges that are contributed from nodes related to , and nodes related to will be carefully added to either side of the cut so that they will contribute capacity of only to the cut. To be more precise, we define a suitable cut as follows.

 S={αΦ,β′Φ}∪{C⊨i:αΦ⊨Ci}∪{C⊭i:αΦ⊭Ci}∪{βΦci:i∈[m]}∪{Ci,βΦli,βΦri:γΦ⊨Ci}∪
 {βΦli:γΦ⊭Ci∧βΦ⊨Ci}
###### Claim 3.2.

The cut has capacity .

###### Proof of Claim.

We will go over all the nodes in , and count the total capacity leaving to nodes in for each of them. and all nodes and that are adjacent to it are in too, hence it does not contribute anything. For every , we have two cases for nodes in . If then and hence does not contribute anything. However, has outgoing edges, where all except are in . Hence, it contributes to the cut. Else, if then and hence does not contribute anything. But has outgoing edges, of which are cut edges as their targets are in , and the one incoming to is a cut edge if and only if and also (equivalently, ), and in our current case it means that . Hence, for every , the nodes in contribute to the cut if , and otherwise. Since there are at most clauses that are not satisfied by , summing over all would yield a total of at most cut edges for vertices with origin in .

For every , all nodes in that are associated with , , and , are in and hence will not contribute anything to the cut. However, the node is always in , with its sole target, and hence the edge is in the cut and contributes an additional amount of , to a current total of at most . In addition, is the only target of , and thus will not contribute to the cut.

We will show that the rest of the nodes, i.e., nodes in that are associated with , and the nodes in , contribute nothing to the cut. For every , if and only if either or . It always happens that , and if and only if , but in such case it must be that , which implies that the edge is not in the graph, thus the total contribution of is zero.

For every , it is easy to verify that each of the following four implies the rest. , , , and the edge is not in the graph. In the case where and are in it is clear that they do not contribute anything, so we will focus on the other case. Since is the only target of , will not increase the cut capacity. In addition, since the edge is not in the graph, does not increase the capacity of the cut either. Altogether we have bounded the total capacity of the cut by , finishing the proof of Claim 3.2. ∎

Proceeding with the proof of Lemma 3.1, we now focus on the second direction. Assume that every assignment to satisfies at most clauses. We remind that we need to prove that the maximum flow from every to every is at least , and to do this we first fix and . By the assumption, for every there exist ’s, such that , , and do not satisfy , and we denote a set with this amount of such ’s by . Each of these ’s induces a blue path from to , and so we pass a unit of flow through every one of them according to , and for all , in what we call the first phase. We note that so far, the flow sums up to , and so we carry on with shipping the second phase of flow through paths that are not entirely blue.

We claim that for every , we can pass an additional amount of units through , which would add up to a total flow of , concluding the proof. Indeed, for every , we ship flow in the following way. For every , if then send a unit through , and otherwise send a unit through .

Since we defined the flow in paths, we only need to show that the capacity constraints are satisfied, starting with edges of color blue. Edges of the forms , , and are only used in the first phase, where the flow in the first two is uniquely determined by and , and so at most unit of flow is passed through them, and the flow in the latter kind is determined by , and the same can have at most units of flow passing in , and so the flow in it is also bounded. The flow in edges of the form in the first phase is uniquely determined by and , and in the second phase uniquely according to and , and so will not be used twice, and the flow in edges of the form is determined in the first phase by and in the second phase by , and so will be used at most times.

We now proceed to prove that red edges too do not have more flow than their capacity, and for this we only need to consider the second phase. Edges of the forms , , and has flow that is uniquely determined by and and so are not used more than once, edges of the form has flow that is determined by and thus have flow and hence are properly bounded, and edges of the form have flow of size . Finally, edges of the form have flow that is determined by and so are used at most times. Altogether, we have bounded the total flow in all the edges that were used in both phases, and so the capacity requirements follow, which completes the proof of the second direction and of Lemma 3.1. ∎

###### Proof of Theorem 1.6.

We use Lemma 3.1 in the following way. Assume that for some and there is an algorithm for ST-Max-Flow that runs in time , and consider the version of ST-Max-Flow with and such that . Applying such an algorithm repeatedly with and iterate over respective partitions of and of sizes