An Efficient Algorithm for All-Pairs Bounded Edge Connectivity

Our work concerns algorithms for an unweighted variant of Maximum Flow. In the All-Pairs Connectivity (APC) problem, we are given a graph $G$ on $n$ vertices and $m$ edges, and are tasked with computing the maximum number of edge-disjoint paths from $s$ to $t$ (equivalently, the size of a minimum $(s,t)$-cut) in $G$, for all pairs of vertices $(s,t)$. Although over undirected graphs APC can be solved in essentially optimal $n^{2+o(1)}$ time, the true time complexity of APC over directed graphs remains open: this problem can be solved in $\tilde{O}(m^\omega)$ time, where $\omega \in [2, 2.373)$ is the exponent of matrix multiplication, but no matching conditional lower bound is known. We study a variant of APC called the $k$-Bounded All Pairs Connectivity ($k$-APC) problem. In this problem, we are given an integer $k$ and graph $G$, and are tasked with reporting the size of a minimum $(s,t)$-cut only for pairs $(s,t)$ of vertices with a minimum cut size less than $k$ (if the minimum $(s,t)$-cut has size at least $k$, we just report it is"large"instead of computing the exact value). We present an algorithm solving $k$-APC in directed graphs in $\tilde{O}((kn)^\omega)$ time. This runtime is $\tilde O(n^\omega)$ for all $k$ polylogarithmic in $n$, which is essentially optimal under popular conjectures from fine-grained complexity. Previously, this runtime was only known for $k\le 2$ [Georgiadis et al., ICALP 2017]. We also study a variant of $k$-APC, the $k$-Bounded All-Pairs Vertex Connectivity ($k$-APVC) problem, which considers internally vertex-disjoint paths instead of edge-disjoint paths. We present an algorithm solving $k$-APVC in directed graphs in $\tilde{O}(k^2n^\omega)$ time. Previous work solved an easier version of the $k$-APVC problem in $\tilde O((kn)^\omega)$ time [Abboud et al, ICALP 2019].


Introduction
Computing maximum flows is a classic problem which has been extensively studied in graph theory and computer science.In unweighted graphs, this task specializes to computing connectivities, an interesting computational problem in its own right.Given a graph G on n vertices and m edges, for any vertices s and t in G, the connectivity λ(s, t) from s to t is defined to be the maximum number of edge-disjoint paths1 from s to t.Since maximum flow can be computed in almost-linear time, we can compute λ(s, t) for any given vertices s and t in m 1+o (1) time [4].What if instead of merely returning the value of a single connectivity, our goal is to compute all connectivities in the graph?This brings us to the All-Pairs Connectivity (APC) problem: in this problem, we are given a graph G as above, and are tasked with computing λ(s, t) for all pairs of vertices (s, t) in G.In undirected graphs, APC can be solved in n 2+o (1)  time [2], so that this "all-pairs" problem is essentially no harder than outputting a single connectivity in dense graphs.
In directed graphs, APC appears to be much harder, with various conditional lower bounds (discussed in Section 1.2) suggesting it is unlikely this problem can be solved in quadratic time.Naively computing the connectivity separately for each pair yields an n2 m 1+o (1) time algorithm for this problem.Using the flow vector framework (discussed in Section 3), it is possible to solve APC in directed graphs in Õ(m ω ) time 2 [6], where ω is the exponent of matrix multiplication.Known algorithms imply that ω < 2.37286 [3], so the Õ(m ω ) time algorithm is faster than the naive algorithm whenever the input graph is not too dense.
Our work focuses on a bounded version of the APC problem, which we formally state as the k-Bounded All-Pairs Connectivity (k-APC) problem: in this problem, we are given a directed graph G as above, and are tasked with computing min(k, λ(s, t)) for all pairs of vertices (s, t) in G. Intuitively, this is a relaxation of the APC problem, where our goal is to compute the exact values of λ(s, t) only for pairs (s, t) with small connectivity.For all other pairs, it suffices to report that the connectivity is large, where k is our threshold for distinguishing between small and large connectivity values.
When k = 1, the k-APC problem is equivalent to computing the transitive closure of the input graph (in this problem, for each pair of vertices (s, t), we are tasked with determining if G contains a path from s to t), which can be done in Õ(n ω ) time [7].Similarly, for the special case of k = 2, it is known that k-APC can be solved in Õ(n ω ) time, by a divide-and-conquer algorithm employing a cleverly tailored matrix product [9].As we discuss in Section 1.2, there is evidence that these runtimes for k-APC when k ≤ 2 are essentially optimal.
Already for k = 3 however, it is open whether k-APC can be solved faster than computing the exact values of λ(s, t) for all pairs (s, t) of vertices!Roughly speaking, this is because the known Õ(m ω ) time algorithm for APC involves encoding the connectivity information in the inverse of an m × m matrix, and inverting an m × m matrix takes O(m ω ) time in general.This encoding step appears to be necessary for k-APC as well.For k = 2, clever combinatorial observations about the structure of strongly connected graphs allow one to skip this computation, but for k ≥ 3 it is not clear at all from previous work how to avoid this bottleneck.Moreover, it is consistent with existing hardness results that k-APC could be solved in O(n ω ) time for any constant k.

Our Contribution
We resolve all three open problems raised in the previous section.
First, we present a faster algorithm for k-APC, whose time complexity matches the runtime given by previous work for solving an easier version of k-APVC.Theorem 4. For any positive integer k, k-APC can be solved in Õ((kn) ω ) time.This is the first algorithm which solves k-APC faster than simply solving APC exactly using the Õ(m ω ) time algorithm of [6], for all constant k ≥ 3.
Second, we present an algorithm for k-APVC, which is faster than the Õ((kn) ω ) time algorithm from [1] (which only solves a restricted version of k-APVC) if ω > 2.
Theorem 5.For any positive integer k, k-APVC can be solved in Õ(k 2 n ω ) time.

Conditional Lower Bounds
The field of fine-grained complexity contains many popular conjectures (which hypothesize lower bounds on the complexity of certain computational tasks) which are used as the basis of conditional hardness results for problems in computer science.In this section, we review known hardness results for APC and its variants.The definitions of the problems and conjectures used in this section are stated in Appendix A.
Assuming that Boolean Matrix Multiplication (BMM) requires n ω−o (1) time, it is known that k-APC and k-APVC require n ω−o (1) time to solve, even for k = 1 [7].In particular, this hypothesis implies our algorithms for k-APC and k-APVC are optimal for constant k.

Algorithms for Restricted Graph Classes
As mentioned previously, no nontrivial algorithms for k-APC over general directed graphs were known for k ≥ 3, prior to our work.However, faster algorithms were already known for k-APC over directed acyclic graphs (DAGs).In particular, [1] presented two algorithms to solve k-APC in DAGs, running in 2 O(k 2 ) mn time and (k log n) 4 k +o(k) n ω time respectively.
In comparison, our algorithm from Theorem 4 solves k-APC in general directed graphs, is faster than the former algorithm whenever m ≥ n ω−1 or k ≥ ω( √ log n) (for example), is always faster than the latter algorithm, and is significantly simpler from a technical perspective than these earlier arguments.However, these algorithms for k-APC on DAGs also return cuts witnessing the connectivity values, while our algorithm does not.
In the special case of undirected graphs, APVC can be solved in m 2+o (1) time [13, Theorem 1.8], which is faster than the aforementioned Õ(m ω ) time algorithm if ω > 2.Over undirected graphs, k-APVC can be solved in k 3 m 1+o(1) + n 2 poly(log n) time.In comparison, our algorithm from Theorem 5 can handle k-APVC in both undirected and directed graphs, and is faster for large enough values of k in dense graphs.
In directed planar graphs with maximum degree d, [6,Theorem 1.5] proves that APC can be solved in O d ω−2 n ω/2+1 time.

Additional Related Work
In [14], the authors consider a symmetric variant of k-APC.Here, the input is a directed graph G on n vertices and m edges, and the goal is to compute for all pairs of vertices (s, t), the value of min(k, λ(s, t), λ(t, s)).This easier problem can be solved in O(kmn) time [14].

Organization
The rest of this paper is devoted to proving Theorems 4 and 5.In Section 2 we introduce notation, some useful definitions, and results on matrix computation which will be useful in proving correctness of our algorithms.In Section 3 we provide an intuitive overview of our algorithms for k-APC and k-APVC.In Section 4 we describe a framework of "flow vectors" for capturing connectivity values, and in Section 5 use this framework to prove Theorem 4. In Section 6 we present helpful results about vertex-connectivity, and in Section 7 use these results to prove Theorem 5. We conclude in Section 8, highlighting some interesting open problems suggested by our work.
In Appendix A, we include definitions of problems and conjectures mentioned in Section 1.2.In Appendix B, we discuss how the treatment of k-APVC in [1] differs from our own, and present the proof details for one of the results stated in Section 6.

Graph Assumptions
Throughout, we let G denote a directed graph on n vertices and m edges.Without loss of generality, we assume that the underlying undirected graph of G is connected, i.e., G is weakly connected (since, if not, we could simply run our algorithms separately on each weakly connected component of G), so we have m ≥ n − 1.We assume G has no self-loops, since these do not affect the connectivity or vertex-connectivity values between distinct vertices.In Sections 4 and 5 we focus on the k-APC problem, and so allow G to have parallel edges between vertices (i.e., G can be a multigraph).We assume however, without loss of generality, that for any distinct vertices s and t, there are at most k edges from s to t (since if there were more than k parallel edges from s to t, we could delete some and bring the count of parallel edges down to k without changing the value of min(k, λ(s, t))).In Sections 6 and 7 we focus on the k-APVC problem, and so assume that G is a simple graph with no parallel edges, since parallel edges from u to v cannot affect the value of a vertex connectivity ν(s, t), unless u = s and v = t, in which case the value of ν(s, t) is simply increased by the number of additional parallel edges from s to t.

Graph Terminology and Notation
Given an edge e from u to v in G, we write e = (u, v).We call u the tail of e and v the head of e. Vertices which are tails of edges entering a vertex v are called in-neighbors of v. Similarly, vertices which are heads of edges exiting v are called out-neighbors of v. Given a vertex u in G, we let E in (u) denote the set of edges entering u, and E out (u) denote the set of edges exiting u.Similarly, V in (u) denotes the set of in-neighbors of u, and V out (u) denotes the set of out-neighbors of u.Furthermore, we define Given vertices s and t, an (s, t)-cut is a set C of edges, such that deleting the edges in C produces a graph with no s to t path.By Menger's theorem, the size of a minimum (s, t)-cut is equal to the connectivity λ(s, t) from s to t.Similarly, an (s, t)-vertex cut is a set of C of vertices with s, t ∈ C , such that deleting C produces a graph with no s to t path.Clearly, a vertex cut exists if and only if (s, t) is not an edge.When (s, t) is not an edge, Menger's theorem implies that the size of a minimum (s, t)-vertex cut is equal to the vertex connectivity ν(s, t) from s to t.

Matrix Notation
Let A be a matrix.For indices i and j, we let A[i, j] denote the (i, j) entry of A. More generally, if S is a set of row indices and T a set of column indices, we let A[S, T ] denote the submatrix of A restricted to rows from S and columns from T .Similarly, A[S, * ] denotes A restricted to rows from S, and A[ * , T ] denotes A restricted to columns from T .We let A denote the transpose of A. If A is a square matrix, then we let adj(A) denote the adjugate of A. If A is invertible, we let A −1 denote its inverse.If a theorem, lemma, or proposition statement refers to A −1 , it is generally asserting that A −1 exists (or if A is a random matrix, asserting that A −1 exists with some probability) as part of the statement.We let I denote the identity matrix (the dimensions of this matrix will always be clear from context).Given a vector v, for any index i we let v[i] denote the i th entry in v.We let 0 denote the zero vector (the dimensions of this vector will always be clear from context).Given a positive integer k, we let [k] = {1, . . ., k} denote the set of the first k positive integers.

Matrix and Polynomial Computation
Given a prime p, we let F p denote the finite field on p elements.Arithmetic operations over elements of F p can be performed in Õ(log p) time.
We now recall some well-known results about computation with matrices and polynomials, which will be useful for our algorithms.Proof.It suffices to verify that the product of (I − AB) with the right hand side of the above equation yields the identity matrix.Indeed, we have which simplifies to I, as desired.

Proposition 7.
Let A be an a × a matrix over F p .We can compute the inverse A −1 (if it exists) in O(a ω ) field operations.

3
Proof Overview

Flow Vector Encodings
Previous algorithms for APC [6] and its variants work in two steps: Step 1: Encode In this step, we prepare a matrix M which implicitly encodes the connectivity information of the input graph.

Step 2: Decode
In this step, we iterate over all pairs (s, t) of vertices in the graph, and for each pair run a small computation on a submatrix of M to compute the desired connectivity value.
The construction in the encode step is based off the framework of flow vectors, introduced in [6] as a generalization of classical techniques from network-coding.We give a high-level overview of how this method has been previously applied in the APC problem. 4iven the input graph G, we fix a source vertex s.Let d = deg out (s), and let F be some ground field. 5Our end goal is to assign to each edge e in the graph a special vector e ∈ F d which we call a flow vector.
First, for each edge e ∈ E out (s), we introduce a d-dimensional vector v e .These vectors intuitively correspond to some starting flow that is pumping out of s.It is important that these vectors are linearly independent (and previous applications have always picked these vectors to be distinct d-dimensional unit vectors).We then push this flow through the rest of the graph, by having each edge get assigned a vector which is a random linear combination of the flow vectors assigned to the edges entering its tail.That is, given an edge e = (u, v) with u = s, the final flow vector e will be a random linear combination of the flow vectors for the edges entering u.If instead the edge e = (s, v) is in E out (s), the final flow vector e will be a random linear combination of the flow vectors for the edges entering s, added to the initial flow v e .
The point of this random linear combination is to (with high probability) preserve linear independence.In this setup, for any vertex v and integer , if some subset of flow vectors assigned to edges in E in (v) is independent, then we expect that every subset of at most flow vectors assigned to edges in E out (v) is also independent.This sort of behavior turns out to generalize to preserving linear independence of flow vectors across cuts, which implies that (with high probability) for any vertex t, the rank of the flow vectors assigned to edges in E in (t) equals λ(s, t).
Intuitively, this is because the flow vectors assigned to edges in E in (t) will be a linear combination of the λ(s, t) flow vectors assigned to edges in a minimum (s, t)-cut, and the flow vectors assigned to edges in this cut should be independent.
Collecting all the flow vectors as column vectors in a matrix allows us to produce a single matrix M s , such that computing the rank of M s [ * , E in (t)] yields the desired connectivity value λ(s, t) (computing these ranks constitutes the decode step mentioned previously).Previous work [6,1] set the initial pumped v e to be distinct unit vectors.It turns out that for this choice of starting vectors, it is possible to construct a single matrix M (independent of a fixed choice of s), such that rank queries to submatrices of M correspond to the answers we wish to output in the APC problem and its variants.
In Section 3.2 we describe how we employ the flow vector framework to prove Theorem 4. Then in Section 3.3, we describe how we modify these methods to prove Theorem 5.

All-Pairs Connectivity
Our starting point is the Õ(m ω ) time algorithm for APC presented in [6], which uses the flow vector encoding scheme outlined in Section 3.1.
Let K be an m × m matrix, whose rows and columns are indexed by edges in the input graph.For each pair (e, f ) of edges, if the head of e coincides with the tail of f , we set K[e, f ] to be a uniform random field element in F. Otherwise, K[e, f ] = 0.These field elements correspond precisely to the coefficients used in the random linear combinations of the flow vector framework.Define the matrix (1) Then [6] proves that with high probability, for any pair (s, t) of vertices, we have With this setup, the algorithm for APC is simple: first compute M (the encode step), and then for each pair of vertices (s, t), return the value of rank M [E out (s), E in (t)] as the connectivity from s to t (the decode step).By Equation ( 1), we can complete the encode step in Õ(m ω ) time, simply by inverting an m × m matrix with entries from F. It turns out we can also complete the decode step in the same time bound.So this gives an Õ(m ω ) time algorithm for APC.
Suppose now we want to solve the k-APC problem.A simple trick (observed in the proof of [1,Theorem 5.2] for example) in this setting can allow us to speed up the runtime of the decode step.However, it is not at all obvious how to speed up the encode step.To implement the flow vector scheme of Section 3.1 as written, it seems almost inherent that one needs to invert an m × m matrix.Indeed, an inability to overcome this bottleneck is stated explicitly as part of the motivation in [1] for focusing on the k-APVC problem instead.

Our Improvement
The main idea behind our new algorithm for k-APC is to work with a low-rank version of the matrix K used in Equation ( 1) for the encode step.
Specifically, we construct certain random sparse matrices L and R with dimensions m×kn and kn × m respectively.We then set K = LR, and argue that with high probability, the matrix M defined in Equation ( 1) for this choice of This equation is just a k-bounded version of Equation ( 2).By Proposition 6, we have Note that (I − RL) is a kn × kn matrix.So, to compute M (and thus complete the encode step) we no longer need to invert an m × m matrix!Instead we just need to invert a matrix of size kn × kn.This is essentially where the Õ ((kn) ω ) runtime in Theorem 4 comes from.
Conceptually, this argument corresponds to assigning flow vectors through the graph by replacing random linear combinations with random "low-rank combinations."That is, for an edge e ∈ E out (u) exiting a vertex u, we define the flow vector at e to be where the inner summation is over all edges f entering u, f denotes the flow vector assigned to edge f , and the L i [f, u] and R i [u, e] terms correspond to random field elements uniquely determined by the index i and some (edge, vertex) pair.
Here, unlike in the method described in Section 3.1, the coefficient in front of f in its contribution to e is not uniquely determined by the pair of edges f and e.Rather, if edge f enters node u, then it has the same set of "weights" L i [f, u] it contributes to every flow vector exiting u.However, since we use k distinct weights, this restricted rule for propagating flow vectors still suffices to compute min(k, λ(s, t)).
A good way to think about the effect of this alternate approach is that now for any vertex v and any integer ≤ k, if some subset of flow vectors assigned to edges in E in (v) is independent, then we expect that every subset of at most flow vectors assigned to edges in E out (v) is also independent.In the previous framework, this result held even for > k.By relaxing the method used to determine flow vectors, we achieve a weaker condition, but this is still enough to solve k-APC.
This modification makes the encode step more complicated (it now consists of two parts: one where we invert a matrix, and one where we multiply that inverse with other matrices), but speeds it up overall.To speed up the decode step, we use a variant of an observation from the proof of [1,Theorem 5.2] to argue that we can assume every vertex in our graph has indegree and outdegree k.By Proposition 8 and Equation ( 3), this means we can compute min(k, λ(s, t)) for all pairs (s, t) of vertices in Õ(k ω n 2 ) time.So the bottleneck in our algorithm comes from the encode step, which yields the Õ ((kn) ω ) runtime.

All-Pairs Vertex Connectivity
Our starting point is the Õ ((kn) ω ) time algorithm in [1], which computes min(k, ν(s, t)) for all pairs of vertices (s, t) which are not edges.That algorithm is based off a variant of the flow vector encoding scheme outlined Section 3.1.Rather than assign vectors to edges, we instead assign flow vectors to vertices (intuitively this is fine because we are working with vertex connectivities in the k-APVC problem).The rest of the construction is similar: we imagine pumping some initial vectors to s and its out-neighbors, and then we propagate the flow through the graph so that at the end, for any vertex v, the flow vector assigned to v is a random linear combination of flow vectors assigned to in-neighbors of v. 6Let K be an n × n matrix, whose rows and columns are indexed by vertices in the input graph.For each pair (u, v) of vertices, if there is an edge from u to v, we set K[u, v] to be a uniform random element in F. Otherwise, K[u, v] = 0.These entries correspond precisely to coefficients used in the random linear combinations of the flow vector framework.Now define the matrix Then we argue that for any pair (s, t) of vertices, we have Previously, [1, Proof of Lemma 5.1] sketched a different argument, which shows that rank M [V out (s), V in (t)] = ν(s, t) when (s, t) is not an edge.As we discuss in Appendix B.1, this claim does not necessarily hold when (s, t) is an edge.We use Equation ( 5) to solve k-APVC.For the encode step, we compute M .By Equation (4), we can do this by inverting an n × n matrix, which takes Õ(n ω ) time.For the decode step, by Equation ( 5) and Proposition 8, we can compute min(k, ν(s, t)) for all pairs (s, t) of vertices in asymptotically time, where the sum is over all vertices s and t in the graph.The runtime bound we get here for the decode step is far too high -naively computing the ranks of submatrices is too slow if the graph has many high-degree vertices.
To avoid this slowdown, [1] employs a simple trick to reduce degrees in the graph: we can add layers of k new nodes to block off the ingoing and outgoing edges from each vertex in the original graph.That is, for each vertex s in G, we add a set S of k new nodes, replace the edges in E out (s) with edges from s to all the nodes in S, and add edges from every node in S to every vertex originally in V out (s).Similarly, for each vertex t in G, we add a set T of k new nodes, replace the edges in E in (t) with edges from all the nodes in T to t, and add edges from every vertex originally in V in (t) to every node in T .
It is easy to check that this transformation preserves the value of min(k, ν(s, t)) for all pairs (s, t) of vertices in the original graph where (s, t) is not an edge.Moreover, all vertices in the original graph have indegree and outdegree exactly k in the new graph.Consequently, the decode step can now be implemented to run in Õ(k ω n 2 ) time.Unfortunately, this construction increases the number of vertices in the graph from n to (2k + 1)n.As a consequence, in the encode step, the matrix K we work with is no longer n × n, but instead is of size (2k + 1)n × (2k + 1)n.Now inverting I − K to compute M requires Õ ((kn) ω ) time, which is why [1] obtains this runtime for their algorithm.

Our Improvement
Intuitively, the modification used by [1] to reduce degrees in the graph feels very inefficient.This transformation makes the graph larger in order to "lose information" about connectivity values greater than k.Rather than modify the graph in this way, can we modify the flow vector scheme itself to speed up the decode step?Our algorithm does this, essentially modifying the matrix of flow vectors to simulate the effect of the previously described transformation, without ever explicitly adding new nodes to the graph.
Instead of working directly with the matrix M from Equation ( 4), for each pair (s, t) of vertices we define a (k + 1) × (k + 1) matrix which is obtained from multiplying a submatrix of M on the left and right by small random matrices B s and C t , with k + 1 rows and columns respectively.Since B s has k + 1 rows and C t has k + 1 columns, we can argue that with high probability, Equation (5) implies that rank M s,t = min(k + 1, ν(s, t) + 1) if (s, t) is an edge min(k + 1, ν(s, t)) otherwise.
So we can compute min(k, ν(s, t)) from the value of rank M s,t .This idea is similar to the preconditioning method used in algorithms for computing matrix rank efficiently (see [5] and the references therein).Conceptually, we can view this approach as a modification of the flow vector framework.Let d = deg out (s).As noted in Section 3.1, previous work 1. starts by pumping out distinct d-dimensional unit vectors to nodes in V out (s), and then 2. computes the rank of all flow vectors of vertices in V in (t).
In our work, we instead 1. start by pumping out (d + 1) random (k + 1)-dimensional vectors to nodes in V out [s], and then 2. compute the rank of (k + 1) random linear combinations of flow vectors for vertices in This alternate approach suffices for solving the k-APVC problem, while avoiding the slow Õ((kn) ω ) encode step of previous work.
So, in the decode step of our algorithm, we compute min(k, ν(s, t)) for each pair (s, t) of vertices by computing the rank of the (k + 1) × (k + 1) matrix M s,t , in Õ(k ω n 2 ) time overall.
Our encode step is more complicated than previous work, because not only do we need to compute the inverse (I − K) −1 , we also have to construct the M s,t matrices.Naively computing each M s,t matrix separately is too slow, so we end up using an indirect approach to compute all entries of the M s,t matrices simultaneously, with just O(k 2 ) multiplications of n × n matrices.This takes Õ(k 2 n ω ) time, which is the bottleneck for our algorithm.

Flow Vector Encoding
The arguments in this section are similar to the arguments from [6, Section 2], but involve more complicated proofs because we work with low-rank random matrices as opposed to generic random matrices.Fix a source vertex s in the input graph G. Let d = deg out (s) denote the number of edges leaving s.Let e 1 , . . ., e d ∈ E out (s) be the outgoing edges from s.
Take a prime p = Θ(m 5 ).Let u 1 , . . ., u d be distinct unit vectors in F d p .Eventually, we will assign each edge e in G a vector e ∈ F d p , which we call a flow vector.These flow vectors will be determined by a certain system of vector equations.To describe these equations, we first introduce some symbolic matrices.
For each index i ∈ [k], we define an m × n matrix X i , whose rows are indexed by edges of G and columns are indexed by vertices of G, such that for each edge e = (u, v), entry X i [e, v] = x i,ev is an indeterminate.All entries in X i not of this type are zero.
Similarly, we define n × m matrices Y i , with rows indexed by vertices of G and columns indexed by edges of G, such that for every edge f = (u, v), the entry Y i [u, f ] = y i,uf is an indeterminate.All entries in Y i not of this type are zero.
Let X be the m × kn matrix formed by horizontally concatenating the X i matrices.Similarly, let Y be the kn × m matrix formed by vertically concatenating the Y i matrices.Then we define the matrix By construction, Z is an m × m matrix, with rows and columns indexed by edges of G, such that for any edges e = (u, v) and f = (v, w), we have and all other entries of Z are set to zero.Consider the following procedure.We assign independent, uniform random values from F p to each variable x i,ev and y i,uf .Let L i , L, R i , R, and K be the matrices over F p resulting from this assignment to X i , X, Y i , Y , and Z respectively.In particular, we have Now, to each edge e, we assign a flow vector e ∈ F d p , satisfying the following equalities: 1. Recall that e 1 , . . ., e d are all the edges exiting s, and u 1 , . . ., u d are distinct unit vectors in F d p .For each edge e i ∈ E out (s), we require its flow vector satisfy 2. For each edge e = (u, v) with u = s, we require its flow vector satisfy A priori it is not obvious that flow vectors satisfying the above two conditions exist, but we show below that they do (with high probability).Let H s be the d × m matrix whose columns are indexed by edges in G, such that the column associated with e i is u i for each index i, and the rest of the columns are zero vectors.Let F be the d × m matrix, with columns indexed by edges in G, whose columns F [ * , e] = e are flow vectors for the corresponding edges.Then Equations ( 9) and ( 10) are encapsulated by the simple matrix equation The following lemma shows we can solve for F in the above equation, with high probability.
Proof.Since the input graph has no self-loops, by Equation ( 7) and the discussion immediately following it, we know that the diagonal entries of the m × m matrix Z are zero.By Equation (7), each entry of Z is a polynomial of degree at most two, with constant term set to zero.Hence, det(I − Z) is a polynomial over F p with degree at most 2m, and constant term equal to 1.In particular, this polynomial is nonzero.Then by the Schwartz-Zippel Lemma (Proposition 9), det(I − K) is nonzero with probability at least Suppose from now on that det(I−K) = 0 (by Lemma 10, this occurs with high probability).Then with this assumption, we can solve for F in Equation (11) to get This equation will allow us to relate ranks of collections of flow vectors to connectivity values in the input graph.
Lemma 11.For any vertex t in G, with probability at least 1 − 2/m 3 , we have Proof.Abbreviate λ = λ(s, t).Conceptually, this proof works by arguing that the flow vectors assigned to all edges entering t are linear combinations of the flow vectors assigned to edges in a minimum (s, t)-cut of G.
Let S be the set of nodes reachable from s without using an edge in C, and let T be the set of nodes which can reach t without using an edge in C. By definition of an (s, t)-cut, S and T partition the vertices in G.
Let E be the set of edges e = (u, v) with v ∈ T .
Finally, let H be a matrix whose columns are indexed by edges in E , such that the column associated with an edge e ∈ C is e, and all other columns are equal to 0.
Then by Equations ( 9) and ( 10), we have Using similar reasoning to the proof of Lemma 10, we have det(I −K ) = 0 with probability at least 1 − 1/m 3 .If this event occurs, we can solve for F in the previous equation to get Since H has at most λ nonzero columns, rank H ≤ λ.So by the above equation, rank ] is a submatrix of F .Combining this with the previous results, we see that rank F [ * , E in (t)] ≤ λ, as desired.The claimed probability bound follows by a union bound over the events that I − K and I − K are both invertible.Lemma 12.For any vertex t in G, with probability at least 1 − 2/m 3 , we have rank F [ * , E in (t)] ≥ min(k, λ(s, t)).
Proof.Abbreviate λ = min(k, λ(s, t)).Intuitively, our proof argues that the presence of edgedisjoint paths from s to t leads to certain edges in E in (t) being assigned linearly independent flow vectors (with high probability), which then implies the desired lower bound.By Menger's theorem, G contains λ edge-disjoint paths P 1 , . . ., P λ from s to t.
Consider the following assignment to the variables of the symbolic matrices X i and Y i .For each index i ≤ λ and edge e = (u, v), we set variable x i,ev = 1 if e is an edge in P i .Similarly, for each index i ≤ λ and edge f = (u, v), we set variable y i,uf = 1 if f is an edge in P i .All other variables are set to zero.In particular, if i > λ, then X i and Y i have all their entries set to zero.With respect to this assignment, the matrix X i Y i (whose rows and columns are indexed by edges in the graph) has the property that (X i Y i )[e, f ] = 1 if f is the edge following e on path P i , and all other entries are set to zero.
Then by Equation ( 6), we see that under this assignment, Z[e, f ] = 1 if e and f are consecutive edges in some path P i , and all other entries of Z are set to zero.For this particular assignment, because the P i are edge-disjoint paths, Equations ( 9) and (10) imply that the last edge of each path P i is assigned a distinct d-dimensional unit vector.These vectors are independent, so, rank F [ * , E in (t)] = λ in this case.
With respect to this assignment, this means that F [ * , E in (t)] contains a λ × λ full-rank submatrix.Let F be a submatrix of F [ * , E in (t)] with this property.Since F has full rank, we have det F = 0 for the assignment described above.Now, before assigning values to variables, each entry of adj(I − Z) is a polynomial of degree at most 2m.So by Equation ( 12), det F is equal to some polynomial P of degree at most 2λm, divided by (det(I − Z)) λ .We know P is a nonzero polynomial, because we saw above that det F is nonzero for some assignment of values to the variables (and if P were the zero polynomial, then det F would evaluate to zero under every assignment).
By Lemma 10, with probability at least 1−1/m 3 , a random evaluation to the variables will have det(I − Z) evaluate to a nonzero value.Assuming this event occurs, by Schwartz-Zippel Lemma (Proposition 9), a random evaluation to the variables in Z will have det F = 0 with probability at least 1 − (2λm)/p ≥ 1 − 1/m 3 by setting p ≥ 2m 5 .
So by union bound, a particular λ × λ submatrix of F [ * , E in (t)] will be full rank with probability at least 1 − 2/m 3 .This proves the desired result.

Lemma 13. Fix vertices s and t. Define
Proof.The definition of H s together with Equation ( 12) implies that By union bound over Lemmas 11 and 12, with probability at least 1 − 4/m 3 the inequalities simultaneously hold.The desired result follows.

Connectivity Algorithm
In this section, we present our algorithm for k-APC.

Graph Transformation
We begin by modifying the input graph G as follows.For every vertex v in G, we introduce two new nodes v out and v in .We replace each edge (u, v) originally in G is by the edge (u out , v in ).We add k parallel edges from v to v out , and k parallel edges from v in to v, for all u and v.We call vertices present in the graph before modification the original vertices.Suppose G originally had n nodes and m edges.Then the modified graph has n new = 3n nodes and m new = m + 2kn edges.For any original vertices s and t, edge-disjoint paths from s to t in the new graph correspond to edge disjoint paths from s to t in the original graph.Moreover, for any integer ≤ k, if the original graph contained edge-disjoint paths from s to t, then the new graph contains edge-disjoint paths from s to t as well.
Thus, for any original vertices s and t, the value of min(k, λ(s, t)) remains the same in the old graph and the new graph.So, it suffices to solve k-APC on the new graph.In this new graph, the indegrees and outdegrees of every original vertex are equal to k.Moreover, sets E out (s) and E in (t) are pairwise disjoint, over all original vertices s and t.

Additional Definitions
We make use of the matrices defined in Section 4, except now these matrices are defined with respect to the modified graph.In particular, K, L, and R are now matrices with dimensions m new × m new , m new × n new , and n new × m new respectively.Define L to be the kn × n new matrix obtained by vertically concatenating L[E out (s), * ] over all original vertices s.Similarly, define R to be the n new × kn matrix obtained by horizontally concatenating R[ * , E in (t)] over all original vertices t.

The Algorithm
Using the above definitions, we present our approach for solving k-APC in Algorithm 1. Proof.By Lemma 10, with probability at least 1 − 1/(m new ) 4 the matrix I − K is invertible.Going forward, we assume that I − K is invertible.
By Lemma 13, with probability at least 1 − 4/(m new ) 3 , we have for any given original vertices s and t.By union bound over all n 2 ≤ (m new ) 2 pairs of original vertices (s, t), we see that Equation ( 14) holds for all original vertices s and t with probability at least 1 − 4/(m new ).Since I − K is invertible, by Equation ( 8) and Proposition 6 we have Using the above equation in Equation (14) shows that for original vertices s and t, the quantity min(k, λ(s, t)) is equal to the rank of where we use the fact that I[E out (s), E in (t)] is the all zeroes matrix, since in the modified graph, E out (s) and E in (t) are disjoint sets for all pairs of original vertices (s, t).
Then by definition of L and R, the above equation and discussion imply that which proves that Algorithm 1 outputs the correct answers.
A union bound over the events that I − K is invertible and that Equation ( 14) holds for all (s, t), shows that Algorithm 1 is correct with probability at least 1 − 5/(m new ).
We are now ready to prove our main result.Theorem 4. For any positive integer k, k-APC can be solved in Õ((kn) ω ) time.
Proof.By Theorem 14, Algorithm 1 correctly solves the k-APC problem.We now argue that Algorithm 1 can be implemented to run in Õ((kn) ω ) time.
In step 1 of Algorithm 1, we need to compute (I − RL) −1 .
From the definitions of R and L, we see that to compute RL, it suffices to compute the products R i L j for each pair of indices (i, j)

and its
Recall from Section 2 that given a vertex v in G, we let V in [v] = V in (v) ∪ {v} be the set consisting of v and all in-neighbors of v, and V out [v] = V out (v) ∪ {v} be the set consisting of v and all out-neighbors of v.The following proposition7 is based off ideas from [6, Section 2] and [1, Section 5].We present a complete proof of this result in Appendix B.2.
Proposition 15.For any vertices s and t in G, with probability at least 1 − 3/n 3 , the matrix (I − K) is invertible and we have Proposition 15 shows that we can compute vertex connectivities in G simply by computing ranks of certain submatrices of (I − K) −1 .However, these submatrices could potentially be quite large, which is bad if we want to compute the vertex connectivities quickly.To overcome this issue, we show how to decrease the size of (I − K) −1 while still preserving relevant information about the value of ν(s, t).Lemma 16.Let M be an a × b matrix over F p .Let Γ be a (k + 1) × a matrix with uniform random entries from F p .Then with probability at least 1 − (k + 1)/p, we have Similarly, since ΓM has M as a factor, rank(ΓM ) ≤ rank M .Thus We can view each entry of M as a polynomial of degree at most 1 in the entries of Γ.This means that det M is a polynomial of degree at most r in the entries of Γ.Moreover, if the submatrix Γ[U, T ] = I happens to be the identity matrix, then M = M [S, T ].This implies that det M is a nonzero polynomial in the entries of Γ, because for some assignment of values to the entries of Γ, this polynomial has nonzero evaluation det M [S, T ] = 0 (where we are using the fact that M [S, T ] has full rank).
So by the Schwartz-Zippel Lemma (Proposition 9), the matrix ΓM has rank at least r, with probability at least 1 − r/p.
Together with Equation (17), this implies the desired result.Now, to each vertex u in the graph, we assign a (k + 1)-dimensional column vector b u and a (k + 1)-dimensional row vector c u .
Let B be the (k + 1) × n matrix formed by concatenating all of the b u vectors horizontally, and let C be the n × (k + 1) matrix formed by concatenating all of the c u vectors vertically.For each pair of distinct vertices (s, t), define the (k + 1) × (k + 1) matrix The following result is the basis of our algorithm for k-APVC.matrix, M s,t .To make this approach efficient, we compute the entries of all M s,t matrices simultaneously, using a somewhat indirect argument.
Proof.We prove correctness of Algorithm 2 using the following claim.
Claim 19.For all pairs of indices (i, j) ∈ [k + 1] 2 and all pairs of vertices (s, t), we have where D ij is the matrix computed in step 2 of Algorithm 2.
Proof.By expanding out the expression for D ij from step 2 of Algorithm 2, we have where the sum is over all vertices u, v in the graph (here, we use the fact that P i and Q j are diagonal matrices).By the definitions of A, the P i , and the Q j matrices, we have On the other hand, the definition of M s,t from Equation ( 18) implies that , the above equation and Equation ( 19) imply that for all (i, j) and (s, t), as desired.
By Claim 19, the matrix F s,t computed in step 3 of Algorithm 2 is equal to M s,t .So by Lemma 17, for any fixed pair (s, t) of vertices we have with probability at least 1 − 5/n 3 .Then by a union bound over all pairs of vertices (s, t), we see that Equation (20) holds for all pairs (s, t), with probability at least 1 − 5/n.Assume this event occurs.Then if (s, t) is an edge, by Equation (20) we correctly return as our answer for this pair.
Similarly, if (s, t) is not an edge, by Equation (20) we correctly return as our answer for this pair.This proves the desired result.
With Theorem 18 established, we can prove our result for vertex connectivities.
Theorem 5.For any positive integer k, k-APVC can be solved in Õ(k 2 n ω ) time.
Proof.By Theorem 18, Algorithm 2 correctly solves the k-APVC problem.We now argue that Algorithm 2 can be implemented to run in Õ(k 2 n ω ) time.
In step 1 of Algorithm 2, we need to compute (I − K) −1 .Since K is an n × n matrix, by Proposition 7 we can complete this step in Õ(n ω ) time.
In step 2 of Algorithm 2, we need to compute D ij for each pair (i, j) ∈ [k + 1] 2 .For each fixed pair (i, j), the D ij matrix is defined as a product of five n × n matrices whose entries we know, so this step takes Õ(k 2 n ω ) time overall.
In step 3 of Algorithm 2, we need to construct each F st matrix, and compute its rank.Since each F st matrix has dimensions (k + 1) × (k + 1) and its entries can be filled in simply by reading entries of the D ij matrices we have already computed, by Proposition 8 this step can be completed in Õ(k ω n 2 ) time.
By adding up the runtimes for each of the steps and noting that k ≤ n, we see that Algorithm 2 solves k-APVC in Õ(k 2 n ω ) time, as claimed.

Conclusion
In this paper, we presented algorithms solving k-APC and k-APVC in Õ((kn) ω ) and Õ(k 2 n ω ) time respectively.Many open problems remain concerning the exact time complexity of these problems.We highlight some open questions we find particularly interesting: 1.The most relevant question to our work: can we solve k-APC or k-APVC faster?Is it possible to solve k-APC in Õ(k 2 n ω ) time, as fast as our algorithm for k-APVC?Could there be some moderately large parameter values k ≥ n Ω (1) for which these problems can be solved in Õ(n ω ) time, matching the runtime for constant k? 2. Can we get better conditional lower bounds for k-APC and k-APVC?Currently, no conditional lower bound rules out the possibility that these problems could, for example, be solved in Õ(kn ω ) time.For the APC and APVC problems, can the known n ω(1,2,1)−o (1)  conditional lower bounds be improved 8 to n 4−o (1) conditional lower bounds?3. Recently, [13] showed that there is a nondeterministic verifier for the APVC problem, running in O(n ω (1,2,1) ) time.Is there a nondeterministic verifier for APC with the same runtime?Are there nondeterministic verifiers for the k-APC and k-APVC problems, which run faster than the algorithms from Theorems 4 and 5?

A Conjectures in Fine-Grained Complexity
In the Boolean Matrix Multiplication (BMM) problem, we are given n × n matrices A and B with entries in {0, 1}, and are tasked with computing, for each pair (i, j) ∈ [n] 2 , whether there exists an index k such that A[i, k] = B[k, j] = 1.Using matrix multiplication, we can solve BMM in O(n ω ) time.
The BMM hypothesis9 posits that this is essentially optimal, and asserts that there is no constant δ > 0 such that BMM can be solved in O(n ω−δ ) time.
Let k be a positive integer.In the kSAT problem, we are given a k-CNF (a Boolean formula which can be written as a conjunction of clauses, where each clause is the disjunction of at most k Boolean literals) over n variables, and tasked with determining if there is some assignment of values to the variables which satisfies the k-CNF.
The Strong Exponential Time Hypothesis (SETH) conjectures that for any constant δ > 0, there exists some positive integer k such that kSAT cannot be solved in 2 (1−δ)n poly(n) time.
In the 4-Clique problem, we are given a graph G, and tasked with determining if it contains a clique on four vertices (i.e., four distinct vertices which are mutually adjacent).
Let ω(1, 2, 1) be the smallest positive real such that we can multiply an n × n 2 matrix with an n 2 ×n matrix in n ω(1,2,1)+o (1) time.It is known that 4-Clique can be solved in O n ω (1,2,1)  time.The 4-Clique Conjecture10 asserts that this runtime is essentially optimal, in the sense that for any constant δ > 0, the 4-Clique problem cannot be solved in O n ω(1,2,1)−δ time.

B Vertex Connectivity Encoding Scheme
In Appendix B.1, we describe the result that [1] obtains for computing vertex cuts, and explain how the claims in [1] differ from the arguments in this work.In Appendix B.2, we present a proof of Proposition 15.

B.1 Discussion of Previous Vertex Cuts Algorithm
In [1], the authors present an Õ((kn) ω ) time algorithm for the k-Bounded All-Pairs Minimum Vertex Cut problem.In this problem, we are given a directed graph G on n vertices, and are tasked with returning, for every pair of vertices (s, t), the size of a minimum (s, t)-vertex cut, if this size is less than k.For pairs (s, t) where the size of a minimum (s, t)-vertex cut is at least k, we simply need to return the value k.When (s, t) is not an edge, Menger's theorem implies that the size of a minimum (s, t)vertex cut is equal to the maximum number of internally vertex-disjoint paths from s to t.So, for such pairs (s, t), the k-Bounded All-Pairs Minimum Vertex Cut problem simply requires we compute the value of min(k, ν(s, t)), as in the k-APVC problem.
However, when (s, t) is an edge, as discussed in Section 2, no (s, t)-vertex cut can exist.This is because no matter which vertices outside of s and t we delete, the resulting graph will always have a path of length one from s to t.
In this case, it may be reasonable to define the "size of a minimum (s, t)-vertex cut" to be ∞.With this convention, for pairs of vertices (s, t) which are edges, we simply need to return the value of k in the k-Bounded All-Pairs Minimum Vertex Cut problem.This is precisely what the algorithm of [1] does.
In more detail, the argument sketched in [1, Proof of Lemma 5.1] argues that is equal to the size of a minimum (s, t)-vertex cut, for all pairs of vertices (s, t) which are not edges, with high probability (where K is defined as in Section 3.3).The algorithm from [1, Proof of Theorem 5.2] first modifies the graph, and then computes the value of Equation (21) for every pair of original vertices (s, t) with respect to the new graph, to compute the answers to the k-Bounded All-Pairs Minimum Vertex Cut problem.
As described in Section 3.3, the graph is transformed by introducing for each vertex s a set S of k new nodes, adding edges from s to each node in S, adding edges from all nodes in S to all out-neighbors of s in the original graph, and erasing all edges from s to its original out-neighbors.Similarly, the transformation also introduces for each vertex t a set T of k new nodes, adds edges from all in-neighbors of t to the nodes in T , adds edges from all nodes in T to t, and erases all edges entering t from its original in-neighbors.
If (s, t) was not an edge in the original graph, then (s, t) is still not an edge in the new graph.In this scenario, the vertex connectivity from s to t in the new graph turns out to be min(k, ν(s, t)).Since (s, t) is not an edge, the value ν(s, t) coincides with the size of a minimum (s, t)-vertex cut.So in this case, returning the value of Equation ( 21) produces the correct answer for the k-Bounded All-Pairs Minimum Vertex Cut problem.
Suppose now that (s, t) is an edge in the original graph.Then (s, t) will not be an edge in the new graph, since the new out-neighbors of s are all distinct from the new in-neighbors of t.However, the transformation ensures that in the new graph there are k internally vertex-disjoint paths from s to t, because each of the k new out-neighbors of s has an edge to each of the k new in-neighbors of t.Then in this case, returning the value of Equation ( 21) just amounts to returning the value k.
So the algorithm of [1, Proof of Theorem 5.2] produces the correct answer for the k-Bounded All-Pairs Minimum Vertex Cut problem when (s, t) is an edge, using the convention that the size of a minimum (s, t)-vertex cut is ∞ when (s, t) is an edge.
In summary: the algorithm from [1] runs in Õ((kn) ω ) time and computes min(k, ν(s, t)) for all pairs of vertices (s, t) such that (s, t) is not an edge, but for pairs where (s, t) is an edge, does not return any information about the value of ν(s, t).

Moving From Vertex Cuts to Vertex Connectivities
The quantity in Equation (21) differs from the expression we use Proposition 15, where we index the rows and columns by V out [s] and V in [t], instead of V out (s) and V in (t) respectively.For the purpose of solving k-APVC, we need to work with a different submatrix from the one used in Equation (21), because when (s, t) is an edge, the expression in Equation ( 21) is not necessarily equal to ν(s, t).
For example, suppose G is a graph where deg in (s) = 0, deg out (t) = 1, there is an edge from s to t, and ν(s, t) = 1.Then the proof sketch in [1, Proof of Lemma 5.1] (using the terminology of Section 3.3) suggests pumping unit vectors to nodes in V out (s), using these initial vectors to determine flow vectors for all nodes, and then computing the rank of the flow vectors assigned to nodes in V in (t).In this example, since s has indegree zero and no initial vector is pumped to it, it is assigned the flow vector s = 0. Since V in (t) = {s} in this example, the rank of flow vectors in V in (t) is just zero, even though ν(s, t) = 1.
This issue arises more generally in the proof suggested by [1, Proof of Lemma 5.1] whenever (s, t) is an edge of the graph.Intuitively, this is because a maximum collection of internally vertex-disjoint paths from s to t will always include a path consisting of a single edge from s to t, but if we do not pump out a vector at s, this path will not contribute to the rank of the flow vectors entering t.
To overcome this issue and correctly compute for vertex connectivities for all pairs, we modify the expression from Equation (21) appropriately (by pumping out an initial vector at the source s, and allowing the flow vector assigned to t to contribute to teh rank), which is why our statement of Proposition 15 involves computing the rank of a different submatrix.
The issue described above does not appear when dealing with edge connectivity, essentially because in that case there is always a set of edges whose removal destroys all s to t paths.

B.2 Proof of Vertex Connectivity Encoding
In this section, we provide a proof of Proposition 15, whose statement we recall below.
Proposition 15.For any vertices s and t in G, with probability at least 1 − 3/n 3 , the matrix (I − K) is invertible and we have Our proof of Proposition 15 is similar to the outline in [1, Section 5] and is based off ideas from [6, Section 2], but involves several modifications needed to address issues which arise when dealing with vertex connectivities.
Fix a source node s and target node t in the input graph G. Write v 0 = s.Suppose s has outdegree d = deg out (s).Let v 1 , . . ., v d be the out-neighbors of s from V out (s).
Take a prime p = Θ(n 5 ) (this is the same prime p from Section 6).Let u 0 , . . ., u d denote distinct unit vectors in F d+1 p .Eventually, we will assign each vertex v in G a vector v ∈ F d+1 p , which we call a flow vector.These flow vectors are determined by a system of vector equations.To describe these equations, we first need to introduce some symbolic matrices.
Let Z be an n × n matrix, whose rows and columns are indexed by vertices in G.
If (u, v) is an edge, we set Z[u, v] = z uv to be an indeterminate, and otherwise Z[u, v] = 0. Consider the following procedure.We assign independent, uniform random values from the field F p to each variable z uv .Let K be the n × n matrix resulting from this assignment to the variables in Z (this agrees with the definition of K in Section 6).Now, to each vertex v, we assign a flow vector v, satisfying the following equalities: 1. Recall that V out [s] = {v 0 , . . ., v d }.For each vertex v i , we require its flow vector satisfy 2. For each vertex v ∈ V out [s], we require its flow vector satisfy It is not obvious that such flow vectors exist, but we show below that they do (with high probability over the random assignment to the z uv variables).Let H s denote the (d + 1) × n matrix whose columns are indexed by vertices in G, such that the column associated with v i is v i for each index 0 ≤ i ≤ d, and the rest of the columns are zero vectors.Let F be the (d + 1) × n matrix, with columns indexed by vertices in G, such that the column associated with a vertex v is the corresponding flow vector v.
Then Equations ( 22) and (23) are captured by the matrix equation We will prove that flow vectors v satisfying the above conditions exist, by showing that we can solve for F in Equation (24).To do this, we use the following lemma.
Proof.Each entry of Z is a polynomial of degree at most one with constant term zero.Since the input graph has no self-loops, the diagonal entries of Z are all zeros.
Thus, det(I − Z) is a polynomial of degree at most n and constant term 1 (which means this polynomial is nonzero).So by the Schwartz-Zippel Lemma (Proposition 9), det(I − K) is nonzero with probability at least 1 − n/p ≥ 1/n 4 (by taking p ≥ n 5 ) as claimed.
Suppose from now on that det(I − K) = 0 (by Lemma 20, this occurs with high probability).In this case, the flow vectors are well-defined, and by Equation (24) occur as columns of Lemma 21.For any vertex t in G, with probability at least 1 − 1/n Let G be the graph G with edge (s, t) removed (if (s, t) is not an edge, then G = G).Let C be a minimum (s, t)-vertex cut of G .This means that C is a minimum size set of nodes (where s, t / ∈ C ) such that deleting C from G produces a graph with no s to t path.After removing the nodes in C from G , let S be the set of vertices reachable from s, and T be the set of vertices which can reach t.
If Note that v = s.Indeed, if (s, t) is an edge, then s ∈ C, so v = s is forced since v ∈ C. If (s, t) is not an edge, then by definition of a vertex cut, s can have no edge to T and s is not in T , which means that s ∈ V , again forcing v = s.
We first handle the case where v = t.Case 1: v = t In this case, by definition of a vertex cut, v ∈ T .Thus, the in-neighbors of v are all members of V .By the discussion at the beginning of this proof, v = s.
We claim that v ∈ V out (s).Indeed, suppose to the contrary that v ∈ V out (s).By the case assumption, v = t.By definition, v ∈ C and v has an edge to T .This means there is a path of length two from s to a vertex in T , not using any vertices in C.This contradicts the definition of an (s, t)-vertex cut.So it must be the case that v ∈ V out (s) as claimed.
So in this case, we have shown that for v ∈ V \ C, we have V in (v) ⊆ V and v ∈ V out (s).It follows from Equation (23) and the definitions of F and K that Finally, let deg in (u) = |E in (u)| and deg out (u) = |E out (u)| denote the indegree and outdegree of u respectively.

Proposition 6 .
Let A be an a × b matrix, and B be a b × a matrix.If (I − BA) is invertible, then the matrix (I − AB) is also invertible, with inverse (I − AB) −1 = I + A(I − BA) −1 B.

Proposition 8 ([ 5 ,
Theorem 1.1]).Let A be an a × b matrix over F p .Then for any positive integer k, we can compute min(k, rank A) in O(ab + k ω ) field operations.Proposition 9 (Schwartz-Zippel Lemma [12, Theorem 7.2]).Let f ∈ F p [x 1 , . . ., x r ] be a degree d, nonzero polynomial.Let a be a uniform random point in F r p .Then f ( a) is nonzero with probability at least 1 − d/p.

Indeed, for any
edge e = (u, v) ∈ E , if u ∈ S then e ∈ C so H [ * , e] = e, and there can be no edge f ∈ E entering u, so (F K )[ * , e] = 0.If instead u ∈ T , then H [ * , e] = 0, but every edge f entering u is in E , so by Equation (10), we have (F K )[ * , e] = F [ * , e] as desired.

Algorithm 1 1 : 2 : 3 :Theorem 14 .
Our algorithm for solving k-APC.Compute the n new × n new matrix (I − RL) −1 .Compute the kn new × kn new matrix M = L(I − RL) −1 R. For each pair (s, t) of original vertices, compute rank M [E out (s), E in (t)]and output this as the value for min(k, λ(s, t)).With probability at least 1 − 5/(m new ), Algorithm 1 correctly solves k-APC.
So, it suffices to show that ΓM has rank at least min(k + 1, rank M ).Set r = min(k + 1, rank M ).Then there exist subsets S and T of row and column indices respectively, such that |S| = |T | = r and M [S, T ] has rank r.Now, let U be an arbitrary set of r rows in Γ.Consider the matrix M = (ΓM )[U, T ].
(s, t) is an edge, set C = C ∪ {s, t}.Otherwise, set C = C .By Menger's theorem, |C| = ν if (s, t) is not an edge in G, and otherwise |C| = ν + 1.This is because in addition to the edge (s, t), we can find |C | internally-vertex disjoint paths from s to t, so ν(s, t) = |C | + 1 = |C| − 1.Let V be the set of vertices which are in T , or have an edge to a vertex in T .Then set K = K[V , V ] and F = F [ * , V ].Now define the matrix H = F − F K .By definition, the columns of H are indexed by vertices in V .Claim 22.For all v ∈ V \ C, we have H [ * , v] = 0. Proof.Take v ∈ V \ C.
3, we haverank F [ * , V in [t]] ≤ ν(s, t) + 1 if (s, t) is an edge Abbreviate ν = ν(s, t).Conceptually, this proof works by arguing that the flow vectors assigned to all in-neighbors of t are linear combinations of the flow vectors assigned to nodes in a minimum (s, t)-vertex cut of the graph G with edge (s, t) removed.