SIAM J. COMPUT. c 2013 Society for Industrial and Applied Mathematics Vol. 42, No. 3, pp. 733–751

GRAPH CONNECTIVITIES, NETWORK CODING, AND EXPANDER GRAPHS∗

HO YEE CHEUNG†,LAPCHILAU†, AND KAI MAN LEUNG†

Abstract. We present a new algebraic formulation for computing edge connectivities in a directed graph, using ideas developed in network coding. This reduces the problem of computing edge connectivities to solving systems of linear equations, thus allowing us to use tools in to design new . Using the algebraic formulation, we obtain faster algorithms for computing single source edge connectivities and all pairs edge connectivities. In some settings, the amortized time to compute the edge connectivity for one pair is sublinear. Through this connection, we have also found an interesting use of expanders and superconcentrators to design fast algorithms for some graph connectivity problems.

Key words. graph connectivities, network coding, expander graphs, linear equations, random- ized algorithms

AMS subject classifications. 05C40, 05C50, 05C85, 68Q25, 68W20

DOI. 10.1137/110844970

1. Introduction. Graph connectivity is a basic concept that measures the reli- ability and efficiency of a graph. The edge connectivity from vertex s to vertex t is defined as the size of a minimum s-t cut or, equivalently, the maximum number of edge disjoint paths from s to t. Computing edge connectivities is a classical and well- studied problem in combinatorial optimization. Most known algorithms for solving this problem are based on network flow techniques (see, e.g., [34]). Even and Tarjan [12] introduced the fastest to compute s-t edge con- nectivity in a simple directed graph and running in O(min{m1/2,n2/3}·m)time, where m is the number of edges and n is the number of vertices. To compute the edge connectivities for many pairs, however, it is not known how to do it faster than computing edge connectivity for each pair separately, even when the pairs share the source or the sink. For instance, it is not known how to compute all pairs edge con- nectivities faster than computing s-t edge connectivity for Θ(n2)pairs.Thisisin contrast to the problem in undirected graphs, where all pairs edge connectivities can be computed in O˜(mn) time by constructing a Gomory–Hu tree [6]. Network coding is an innovative method for transmitting information in a com- puter network. The fundamental result is a max-information-flow min-cut theorem for multicasting [1]: if the edge connectivity from the source vertex s to each sink vertex ti is at least k, then one can transmit k units of information to all sink vertices simultaneously by performing encoding and decoding at the vertices. An elegant alge- braic framework has been developed for constructing efficient network coding schemes for multicasting [29, 26]. In this paper, we use the techniques developed in network coding to obtain a new algebraic formulation for computing edge connectivities. This reduces the problem

∗Received by the editors August 19, 2011; accepted for publication (in revised form) December 26, 2012; published electronically May 2, 2013. A preliminary version of this paper appeared in Proceedings of the 52nd Annual IEEE Symposium on Foundations of , 2011. http://www.siam.org/journals/sicomp/42-3/84497.html †The Chinese University of Hong Kong, Shatin, N.7., Hong Kong ([email protected], [email protected], [email protected]). The second author’s research was supported by HK RGC grants 413609 and 413411. 733 734 HO YEE CHEUNG, LAP CHI LAU, AND KAI MAN LEUNG

of computing edge connectivities to solving systems of linear equations and opens up new directions in the design of algorithms for the problem. One advantage of the technique is that the edge connectivities from a source vertex to all other vertices can be computed simultaneously (as in the max-information-flow min-cut theorem). This leads to faster algorithms for computing single source edge connectivities and all pairs edge connectivities, and in some settings the amortized time to compute the edge connectivity for one pair is sublinear. In the process, we have also found an interesting use of expanders and superconcentrators to design fast algorithms for graph connectivity problems. 1.1. Our results. Our new algebraic formulation for computing edge connectiv- ities is inspired by the random linear coding algorithm [18] for constructing network codes. Let G =(V,E) be a directed graph. Let s be the source vertex with out degree d, with outgoing edges e1,...,ed.Toeachedgee ∈ E we associate a vector fe of dimension d, where each entry in fe is an element from a large enough finite field F. The vectors fe are required to satisfy the following properties: (1) the vectors on e1,...,ed are linearly independent, and (2) the vector on an edge e =(v, w)isa random linear combination of the incoming vectors of v. Once we obtain the vectors, we can compute the edge connectivities from the source vertex as follows. Theorem 1.1 (informal statement). With high probability there is a unique solution to the vectors, and the edge connectivity from s to t is equal to the rank of theincomingvectorsoft for any t ∈ V − s. See Figure 1.1 for an example and Theorem 2.1 for the formal statement. This formulation was previously known for only directed acyclic graphs [22, 36]. For general

Fig. 1.1. In this example, three independent vectors f1, f2 and f3 are sent from the source s. Other vectors are a linear combination of the incoming vectors, according to the random coefficients on the dotted lines. All operations are done in the field of size 11. To compute the edge connectivity from s to v2, for instance, we compute the rank of (f2,f4,f5) which is 3 in this example. GRAPH CONNECTIVITIES, NETWORK CODING, EXPANDERS 735

directed graphs, network coding schemes require convolution codes [11, 28], and it is not known how to use these to compute edge connectivities. Our contribution is a simple formulation that can be used to compute edge connectivities. The algebraic formulation reduces the problem of computing edge connectivities to solving systems of linear equations. We call the step to compute the vectors fe the encoding step and call the step to compute the ranks the decoding step. The formulation has the advantage that after the encoding step has been done, the edge connectivities from the source vertex s to all other vertices can be computed readily. We first present algorithmic results on single source edge connectivities and then algorithmic results on all pairs edge connectivities.

1.1.1. Single source edge connectivities. In directed acyclic graphs, the en- coding step can be implemented directly without solving linear equations, but the resulting algorithm is not competitive with the existing algorithms. By a simple transformation using superconcentrators [37, 19], we show how to implement the en- coding step optimally by this direct approach. This can be used to improve the random linear coding algorithm [18] for network coding. Also we obtain a faster algo- rithm for computing single source edge connectivities in directed acyclic graphs. The algorithm runs in linear time when d is a constant, and by a simple reduction this can be used to return all vertices with edge connectivity at most d from the source s in linear time. Theorem 1.2. Given a simple directed acyclic graph and a source vertex s with out-degree d, the encoding step can be done in O(dm) time, and the edge connectivities from s to all vertices can be computed in O(dω−1m) time with high probability, where ω ≈ 2.38 is the matrix multiplication exponent. In some graphs, the system of linear equations can be solved more efficiently. For instance, we can use a recent result of Alon and Yuster [3] to perform the encod- ing step faster in directed planar graphs with constant maximum degree. The best known algorithm for computing single source edge connectivities in directed planar graphs requires O(n2)timebyusinganO(n) time algorithm to compute s-t edge connectivity [8]. Theorem 1.3. Given a simple directed planar graph with constant maximum de- gree and a source vertex s, the edge connectivity from s to all vertices can be computed in O(nω/2) time with high probability. 1.1.2. All pairs edge connectivities. For general directed graphs, we show that all pairs edge connectivities can be computed in one matrix inversion time, in- stead of solving the linear equations for each source vertex separately. The algorithm is faster when the graph has O(n1.93) edges. For example, when m = O(n), it takes O(nω) time, while the best known algorithm takes O(n3.5)time. Theorem 1.4. Given a simple directed graph, the edge connectivities between all pairs of vertices can be computed in O(mω) time with high probability, where m is the number of edges in the graph. We show that the matrix inversion can be computed more efficiently for graphs that are “well-separable” (which will be defined in section 4.2), which includes planar graphs, bounded genus graphs, fixed minor free graphs, etc. The resulting√ algorithm is faster than that for general graphs when the maximum degree is O( n). Theorem 1.5. Given a simple well-separable directed graph with maximum degree d, the edge connectivities between all pairs of vertices can be computed in O(dω−2nω/2+1) time with high probability. 736 HO YEE CHEUNG, LAP CHI LAU, AND KAI MAN LEUNG

1.1.3. Edge splitting-off. The idea of transforming the graph using supercon- centrators can also be used in other graph connectivity problems. In section 5 we show how to use expanders and superconcentrators to speed up the algorithms for edge splitting-off operations preserving edge connectivities in undirected and directed graphs. 1.2. Related work. The standard way to solve the s-t edge connectivity prob- lem in directed graphs is by network flow techniques. For simple directed graphs, the best known algorithm is an O(min{n2/3,m1/2}·m) time algorithm [12] by the block- ing flow method. As mentioned previously, in directed graphs it is not known how to compute all pairs edge connectivities faster than s-t edge connectivity for Ω(n2) pairs separately. This is in contrast to the problem in undirected graphs, where all pairs edge connectivities can be computed in O˜(mn) time by constructing a Gomory– Hu tree [6], which is much faster than computing edge connectivities for Ω(n2)pairs. There are many improvements in special cases of the s-t edge connectivity problem√ in directed graphs. For bipartite matching, the best known algorithms are an O(m n) time algorithm [20] by the blocking flow method and an O(nω) time algorithm [33, 17] by algebraic techniques. It is known that the bipartite matching problem is equivalent to the s-t vertex connectivity problem in directed graphs, and so the above results hold for√ the latter problem as well [9]. For simple undirected graphs, there is an O(n3/2 m) time algorithm [16] by a combination of the blocking flow method and a graph sparsification technique, and the best known algorithm is an O˜(n2.2) time algorithm [24] by extending [16] with random sampling. In directed planar graphs, there is an optimal O(n) time algorithm for computing s-t edge connectivity [8]. For network coding, the max-information-flow min-cut theorem for multicasting was first proved by an information theoretic argument [1]. Later, it was shown that lin- ear network coding was enough to achieve the max-flow min-cut theorem for multicas- ting [29], and an algebraic framework was developed [26]. Then a polynomial time de- terministic algorithm was obtained to construct optimal linear coding schemes [23] for multicasting in directed acyclic graphs. Convolution codes were used [11, 28] to extend the algorithm in [23] for multicasting in general directed graphs. Subsequently, a sim- ple polynomial time randomized algorithm was obtained for constructing optimal lin- ear coding schemes for multicasting [18], and our algorithm is based on this approach. Subsequent to the conference version of this paper, the connection between net- work coding, matrix rank, and superconcentrators was used to obtain a faster al- gorithm [10] for computing matrix rank; a superconcentrator was used to efficiently compress the input matrix into a smaller one by doing random linear coding. 1.3. Techniques. The starting observation is that the random linear coding algorithm [18] for network coding does not require knowledge of the graph topol- ogy, and it could be used to compute the edge connectivities from the source to the sinks. Actually, this observation was already made for directed acyclic graphs in earlier work [22, 36]. For general directed graphs, however, network coding schemes are more complicated (even for random linear coding), as convolution codes are re- quired [11, 28], and it is not known how to use these to compute edge connectivities. Our contribution is to come up with a simple formulation that can be used to compute edge connectivities. The simple coding scheme (without using convolution codes) also allows us to design more efficient algorithms. The proof extends the ideas developed in the random linear coding algorithm. We show a simple transformation using expanders and superconcentrators [37, 19] to design fast algorithms for some graph connectivity problems. In directed graphs, GRAPH CONNECTIVITIES, NETWORK CODING, EXPANDERS 737

the idea is to replace a vertex of indegree d and outdegree d by a superconcentrator with d inputs and d outputs. This reduces the maximum degree of the graph signifi- cantly, while preserving the edge connectivities and increasing the number of vertices only moderately. For random linear coding, using the direct algorithm in the resulting graph gives an optimal algorithm in the original graph. For edge splitting-off, using the straightforward algorithm in the resulting graph gives considerable improvement over the same algorithm in the original graph. In undirected graphs, we can use constant degree expander graphs for the same purpose. For all pairs edge connectivities, we observe that if we change the source vertex, the system of linear equations is similar, and so we could compute the n single source edge connectivities in one matrix inverse time. For graphs with good separators, we show how to compute the inverse faster by a divide and conquer algorithm, using Schur’s formula [39] and the Sherman–Morrison–Woodbury [38] formula, which may be of independent interest. We note that the algorithmic results on all pairs edge connectivities can also be derived from the matrix formulation given by Ingleton and Piff [9, 21] for vertex connectivities.

1.4. Organization. We present the algebraic formulation in section 2 and prove a formal statement of Theorem 1.1. In section 3, we present algorithms for single source edge connectivities and prove Theorems 1.2 and 1.3. In section 4, we present algorithms for all pairs edge connectivities and prove Theorems 1.4 and 1.5. Finally, we show the use of expanders and superconcentrators in the edge splitting-off problem in section 5.

2. Algebraic formulation for graph connectivities. Throughout the paper we consider uncapacitated directed graphs, i.e., where each edge is of the same ca- pacity. We begin with some notation and definitions for graphs and matrices. In a directed graph G =(V,E), an edge e =(u, v) is directed from u to v,andwe say that u is the tail of e and v is the head of e. For any vertex v ∈ V , we define δin(v)={uv | uv ∈ E} as the set of incoming edges of v and din(v)=|δin(v)|; similarly we define δout(v)={vw | vw ∈ E} as the set of outgoing edges of v and dout(v)=|δout(v)|. For a subset S ⊆ V , we define δin(S)={uv | u/∈ S, v ∈ S, uv ∈ E} and din(S)=|δin(S)|. Given a matrix M, the submatrix containing rows S and columns T is denoted by MS,T . A submatrix containing all rows (or columns) is denoted by M∗,T (or MS,∗), and an entry of M is denoted by Mi,j . We formally define the algebraic formulation for computing graph connectivities. Given a directed graph G =(V,E) and a specified source vertex s, we are interested in computing the edge connectivities from s to other vertices. Let m = |E| and out out E = {e1,e2,...,em}.Letd = d (s)andδ (s)={e1,...,ed}.LetF be a finite d field. For each edge e ∈ E, we associate a global encoding vector fe ∈ F of dimension d where each entry is in F.Wesayapairofedgese and e is adjacent if the head of e isthesameasthetailofe, i.e., e =(u, v)ande =(v, w)forsomev ∈ V .For  each pair of adjacent edges e and e,weassociatealocal encoding coefficient ke,e ∈ F. Given the local encoding coefficients for all pairs of adjacent edges in G,wesaythat the global encoding vectors are a networkcodingsolutionif the following two sets of equations are satisfied: out e ∈ δ s f k  · f  e e 1. For each edge i ( ), we have ei = e∈δin(s) e ,ei e + i,where i is the ith vector in the standard basis. 2. For each edge e =(v, w) with v = s,wehavefe = e∈δin(v) ke,e · fe . The main theorem in this section is the following formal statement of Theorem 1.1. 738 HO YEE CHEUNG, LAP CHI LAU, AND KAI MAN LEUNG

Theorem 2.1. Let F be a finite field with |F| =Ω(mc+2) for some integer c.If we choose each local encoding coefficient independently and uniformly at random from F, then with probability at least 1 − O(1/mc), the following hold: 1. There is a unique network coding solution for the global encoding vectors fe. in 2. For t ∈ V − s,letδ (t)={a1,...,al}; the edge connectivity from s to t is f ,f ,...,f equal to the rank of the matrix ( a1 a2 al ). We will prove Theorem 2.1 in the remainder of this section. First, we rewrite the requirements of a network coding solution in matrix form: ⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ⎛ ⎞ ke1,ej ⎜ ⎟ ⎜ ⎟ ⎜ ⎟⎜ . ⎟ ⎜ ⎟ ⎜ | ⎟ ⎜ | ⎟⎜ . ⎟ ⎜ ||||⎟ ⎜··· f ···⎟ ⎜··· f ···⎟⎜··· k ···⎟ ⎜e ··· e  ··· ⎟ . ⎜ ej ⎟=⎜ ej ⎟⎜ ei,ej ⎟+⎜ 1 d 0 0⎟ ⎝ | ⎠ ⎝ | ⎠⎜ . ⎟ ⎝ ||||⎠ ⎝ . ⎠

kem,ej

Let F be the d × m matrix (fe1 ,...,fem ). Let K be the m × m matrix where Ki,j =

kei,ej when ei and ej are adjacent edges, and 0 otherwise. Let Hs be the d×m matrix     (e1,...,ed, 0, 0,...,0) where 0 denotes the all zero vector of dimension d. Then the network coding equations are equal to the following matrix equation:

(2.1) F = FK + Hs.

To prove the first part of Theorem 2.1, we will prove in the following lemma that (I − K) is nonsingular with high probability. Then the above equation can be −1 rewritten as F = Hs(I − K) , which implies that the global encoding vectors are uniquely determined. Lemma 2.2. Given the conditions in Theorem 2.1,thematrix(I − K) is nonsingular with probability at least 1 − O(1/mc+1). Proof. Since the diagonal entries of K are zero, the diagonal entries of I−K are all one. By treating each entry of K as an indeterminant Ki,j, it follows that det(I−K)= 1+p(...,Ki,j ,...)wherep(...,Ki,j ,...) is a polynomial of the indeterminates with total degree at most m.Notethatdet(I − K) is not a zero polynomial since there is a constant term. Hence, by the Schwartz–Zippel lemma [35], if |F| =Ω(mc+2)and each Ki,j is a random element in F,thendet(I − K) = 0 with probability at most O(1/mc+1), proving the lemma. After we obtain the global encoding vectors, we would like to show that the edge connectivities can be determined from the ranks of these vectors. Consider a vertex t ∈ V − s δin t {a ,...,a } M d × l f ,f ,...,f .Let ( )= 1 l and let t be the matrix ( a1 a2 al ). Let the edge connectivity from s to t be λs,t. We prove in the following lemma that rank(Mt)=λs,t with high probability. Lemma 2.3. Given the conditions of Theorem 2.1, we have rank(Mt)=λs,t with probability at least 1 − O(1/mc+1). Proof. First, we prove that rank(Mt) ≤ λs,t with high probability. The plan is to show that the global encoding vector on each incoming edge of t is a linear combination of the global encoding vectors in an s-t cut with high probability. In particular this holds for a minimum s-t cut and implies that rank(Mt) ≤ λs,t.The proof idea is to contract the source side of the cut and then apply the argument in Lemma 2.2. Consider a minimum s-t cut δin(T )whereT ⊂ V with s/∈ T and in    t ∈ T and d (T )=λs,t.LetE = {e1,...,em } be the set of edges in E with in   their heads in T .Letλ = λs,t and assume δ (T )={e1,...,eλ}. See Figure 2.1(a) GRAPH CONNECTIVITIES, NETWORK CODING, EXPANDERS 739

Fig. 2.1.

   for an illustration. Let F be the d × m matrix (fe ,...,fe ). Let K be the 1 m m × m submatrix of K restricted to the edges in E.LetH be the d × m matrix f  ,...,f  ,,..., ( e1 eλ 0 0). Then, by the network coding requirements, the matrices satisfy the equation

F  = F K + H.

By the same argument as in Lemma 2.2, the matrix (I − K) is nonsingular with probability at least 1 − O(1/mc+1). So the above matrix equation can be rewritten as F  = H(I − K)−1. This implies that every global encoding vector in F  is a linear combination of the global encoding vectors in H, which are the global encoding in in vectors in the cut δ (T ). Therefore, the rank(Mt) ≤ d (T )=λs,t. Next, we prove that rank(Mt) ≥ λs,t with high probability. The proof idea is that the rank does not increase if we restrict our attention to a subgraph, and we will use the edge disjoint paths as the subgraph to establish the rank. The plan is   to show that there is a λ × λ submatrix Mt of Mt such that det(Mt) is a nonzero polynomial of the local encoding coefficients with small total degree. We use the edge  disjoint paths from s to t to define Mt.Letλ = λs,t and P1,...,Pλ be a set of λ edge  disjoint paths from s to t.Setke,e = 1 for every pair of adjacent edges e ,e ∈ Pi for every i, and set all other local encoding coefficients to be zero. See Figure 2.1(b) for an illustration. Then each path sends a distinct unit vector of the standard basis to t, and thus Mt contains a λ × λ identity matrix as a submatrix. Call this λ × λ   submatrix Mt. Next we show that the det(Mt) is a nonzero polynomial of the local encoding coefficients with small total degree. Recall that F = H(I − K)−1.By considering the adjoint matrix of I − K, each entry of (I − K)−1 is a polynomial of the local encoding coefficients with total degree m divided by det(I − K), and thus  thesameistrueforeachentryofF . Hence, det(Mt)isadegreeλm polynomial of the local encoding coefficients divided by (det(I − K))λ. By using the edge disjoint paths P1,...,Pλ, we have shown that there is a choice of the local encoding coefficients   so that rank(Mt )=λ.Thusdet(Mt) is a nonzero polynomial of the local encoding coefficients. Conditioned on the event that det(I −K) is nonzero, the probability that  c+2 c+1 det(Mt) is zero is at most O(λ/m ) ≤ O(1/m ) by the Schwartz–Zippel lemma. By bounding the probability that det(I − K) = 0 using Lemma 2.2, we obtain that  c+1  the probability that det(Mt)=0isatmostO(1/m ). This implies that Mt is a 740 HO YEE CHEUNG, LAP CHI LAU, AND KAI MAN LEUNG

 full rank submatrix with high probability, and thus rank(Mt) ≥ rank(Mt)=λ.We c+1 conclude that rank(Mt)=λs,t with probability at least 1 − O(1/m ) by the union bound. Thus the probability that rank(Mt) = λs,t for some t ∈ V − s is at most n · O(1/mc+1) ≤ O(1/mc) by the union bound, and this proves the second part of Theorem 2.1. Therefore, we need only to set c tobeaconstanttoguaranteeahigh probability result, while each field operation can be done in O(log m)time. 3. Single source edge connectivities. The algebraic formulation can be used to compute the edge connectivities from one source vertex to all other vertices. In general, the encoding step requires solving systems of linear equations with m variables and m equations. In this section, we will show how to obtain faster algorithms for directed acyclic graphs and directed planar graphs. 3.1. Directed acyclic graphs. In directed acyclic graphs, one can compute the global encoding vectors directly by following the topological ordering of the graph. We can first preprocess the graph by a breadth first search to remove all vertices that are not connected from the source vertex. Then the source vertex s is the only vertex with indegree zero, and we set the global encoding vectors of its outgoing edges to be the vectors in the standard basis, as required by the first condition for the network coding solution. We assign random local encoding coefficients to each pair of adjacent edges. Then we process the remaining vertices following the topological ordering of the graph, so that when each vertex v is processed all the vectors of its incoming edges are already computed. For each outgoing edge of v, we compute its vector by taking a linear combination of the vectors of the incoming edges of v, according to the local encoding coefficients. It is easy to see that the global encoding vectors of all edges will be computed, and the resulting vectors satisfy the second requirement of the network coding solution. We consider efficient implementations of this algorithm. Let d be the outdegree of the source vertex s. So each global encoding vector is of dimension d.Foravertex v with indegree din(v), it requires d · din(v) arithmetic operations to compute the vector of one outgoing edge of v, and thus it requires d · din(v) · dout(v)operationsto compute the vectors of all outgoing edges of v. Therefore the total encoding time of in out this straightforward implementation is v∈V −s d · d (v) · d (v),andintheworst case it requires Θ(dnm) steps. An improvement is to use a fast rectangular matrix multiplication algorithm to compute all the outgoing vectors of a vertex, but we will show how to do even better. Observe that the encoding operation is much faster if the indegree of a vertex is a constant. So the idea is to transform the graph into a bounded degree graph, and it turns out that superconcentrators give us an optimal transformation for this purpose. In the following, we will have a short introduction on expanders and superconcentrators, and then come back to the algorithm for directed acyclic graphs. 3.1.1. Expander graphs and superconcentrators. An expander graph G = (V,E) is a sparse graph that exhibits strong connectivity properties. Given a subset S ⊆ V , we define N(S) as the set of vertices in V − S with a neighbor in S. Definition 3.1. A graph G =(V,E) is called an (n, d, c)-expander if it has n vertices, the maximum degree is d,andforallS ⊂ V with |S|≤|V |/2, we have |N(S)|≥c|S|.Thenc is called the expansion of G. There are several explicit constructions for expander graphs with d and c constants (see [19]). Superconcentrators were first defined by Valiant [37] for studying the complexity of linear transformations. GRAPH CONNECTIVITIES, NETWORK CODING, EXPANDERS 741

Fig. 3.1. Replace vertex v by a superconcentrator Γv and “rewire” the edges.

Definition 3.2 (see, [19]). Let G =(V,E) be a directed graph and let I and O be two disjoint subsets of V with |I| = |O| = n. We say that G is a superconcentrator with respect to I and O if for every k and every S ⊆ I and T ⊆ O with |S| = |T | = k, there exist k vertex disjoint paths from S to T . Valiant proved that there exist superconcentrators with O(n) edges; see [19] for a simple recursive construction using bipartite expander graphs. There exist explicit constructions [13] of superconcentrators with the following properties: (1) there are O(n) vertices and O(n) edges, (2) the maximum indegree and the maximum outdegree are constants, and (3) the graphs are directed acyclic. The construction in [13] can be implemented in O(n) time for a superconcentrator with n inputs and n outputs. 3.1.2. Proof of Theorem 1.2. To improve the encoding time, we first trans- form the graph G =(V,E) by replacing each vertex in V − s by a superconcentrator. in out For each vertex v,letdv =max{d (v),d (v)}, replace v by a superconcentrator Γv with |I| = |O| = dv, and “rewire” each incoming edge of v to a distinct vertex in I and each outgoing edge of v from a distinct vertex in O. See Figure 3.1 for an illustration. in out The total transformation time is v∈V O(dv)= v∈V O((d (v)+d (v))) = O(m) where n = |V | and m = |E|. Call the graph after the transformation G. A key point is that the edge con- nectivity from the source s toavertext in G is equal to the edge connectivity from  the source s to Γt in G by thinking of Γt as a node. To see this, any set of edge disjoint paths from s to t in G corresponds to a set of edge disjoint paths from s to Γt in G, because paths sharing a vertex v in G canberoutedusingthedisjointpaths  guaranteed by the superconcentrator Γv in G . By the properties described in section 3.1.1, G is a directed acyclic graph with constant maximum indegree. Thus the global encoding vector of an edge in G can be computed in O(d) time, where d is the outdegree of the source vertex s. Since Γv has O(dv ) edges, the global encoding vectors of the outgoing edges of Γv can be computed in O(d · dv) time. Therefore, all the global encoding vectors can be computed in in out v∈V O(d · dv)= v∈V O(d · (d (v)+d (v))) = O(dm) time. This proves the first part of Theorem 1.2. The encoding time is optimal since writing down all the global encoding vectors would already take O(dm) time. It is surprising that the vectors of all the outgoing  edges of Γv in G can be computed in O(d · dv) time, the same time complexity as computing the vector of just one outgoing edge of v in G. This can be used to improve the random linear coding algorithm [18] for network coding. Let v be a vertex with d incoming edges and d outgoing edges. In random linear network coding, each incoming edge carries a message (an element in a large enough finite field), and each 742 HO YEE CHEUNG, LAP CHI LAU, AND KAI MAN LEUNG

Fig. 3.2. Figure (a) shows an undirected planar graph, and figure (b) shows its separator Z and its two separated components X and Y .

outgoing edge carries a random linear combination of the incoming messages. The straightforward algorithm for computing the d outgoing messages requires Θ(d2)field operations. By the above reduction using superconcentrators, this can be reduced to O(d)fieldoperations.  To compute the edge connectivity from s to Γt in G , by Theorem 2.1 we can  compute the rank of the incoming vectors of Γt in G . For a rectangular matrix of size ω−1 a × b, its rank can be computed in O(ab ) time [17]. So the total decoding time is in ω−1 ω−1 v O(d (v) · d )=O(m · d ). This proves the second part of Theorem 1.2. Our algorithm is faster than running the Even–Tarjan algorithm [12] Ω(n)times for all n and m.Whend is small we can compute single source edge connectivities in linear time. Let λs,t be the edge connectivity from s to t. When the outdegree of s is unbounded, this can be used to obtain an algorithm to compute min{λs,t,d} for all t in linear time for constant d, by adding a new source s with d outgoing edges to s and computing the edge connectivities from s. So, for constant d, we can compute min{λs,t,d} for all t in O(m) field operations where each field operation can be done in O(log n)time. 3.2. Directed planar graphs. One way to compute the global encoding vec- tors is to solve the system of linear equations F (I − K)=Hs. For some graphs with constant maximum degree this system of linear equations can be solved more effi- ciently. The result in this section can be applied to more general classes of bounded degree graphs than the class of bounded degree directed planar graphs, e.g., bounded genus graph and fixed minor free graphs. We say an undirected graph G =(V,E) has an (f(n),α)-separation if V can be partitioned into three parts X, Y, Z such that |X ∪ Z|≤α|V |, |Y ∪ Z|≤α|V |, |Z|≤f(n), and no edges have endpoints in both X and Y . An example is illustrated in Figure 3.2. A class of graphs is hereditary if it is closed under taking subgraphs (e.g., planar graphs). For a hereditary class of graphs, if there is always an (f(n),α)-separation for any n-vertex graph in this class, then one can recursively separate the separated parts X and Y until the separated pieces are small enough. This yields an (f(n),α)-weak separator tree (see [3] for a formal definition). It is known√ that planar graphs, bounded genus graphs,√ and fixed minor free graphs have a ( n, 2/3)-separation [31, 15, 2], and thus a ( n, 2/3)-weak separator tree. Given Ax = b where A is an n × n matrix, the underlying graph of A is an undirected graph with n vertices where there is an edge ij if Ai,j =0or Aj,i =0. GRAPH CONNECTIVITIES, NETWORK CODING, EXPANDERS 743

The nested dissection method of Lipton, Rose, and Tarjan [30] shows that if A is a symmetric positive definite matrix and the underlying graph has an (O(nβ ), 2/3)- weak separator tree, then Ax = b can be solved in O(nωβ) time. In our setting, however, the matrix (I − K) is not symmetric and its elements are from a finite field. Interestingly, Alon and Yuster [3] extended the nested dissection method very recently to solve a system of linear equations Ax = b over any finite field and for any matrix (not necessarily symmetric) whose underlying graph has an (O(nβ ),α)-weak separator tree, and this is exactly what we need. In the following, a family of graphs is δ-sparse if any n-vertex graph in this family has at most δn edges. Theorem 3.3 (Alon and Yuster [3]). Let F be a δ-sparse family of graphs with an O(nγ ) time algorithm to find an (O(nβ),α)-weak separator tree where α is a constant smaller than one. Given a system of linear equations Ax = b where A ∈ Fn×n is nonsingular, b ∈ Fn, and the underlying graph of A is in F, there is a randomized algorithm that finds the unique solution of the system in O(nωβ + nγ + n log n) time with high probability. We are interested in computing the network coding solution for a directed planar graph G =(V,E) with constant maximum degree. If the source vertex has outdegree d, then the global encoding vectors are of dimension d, and the equation F (I − K)= T Hs canbesolvedbyd systems of linear equations of the form (I − K) x = h where h is the transpose of a row of Hs. The underlying graph of (I − K) is not a planar graph but is the line graph of a planar graph. Nevertheless, if the maximum degree of G is a constant, then we can argue that its line graph also has a good separator. Lemma 3.4. Given a simple√ directed planar graph G with constant maximum degree d, its line graph has an (O( n),α)-weak separator tree where α<1. Proof. We use the separator√ theorem by Lipton and Tarjan [31] which states that any planar graph√ has an (O( n), 2/3)-separator, and it can be found in O(n) time. Let Z be an (O( n), 2/3)-separator in G and X, Y be the two separated parts. We consider all the directed edges that have at least one endpoint in Z.Denotethe  set of these√ edges as Z . Since the maximum degree of G is d, which is a constant, |Z| = O( n). We will take Z as the separator of the line graph of G and argue that the two separated parts X and Y  are of size at most αn,whereα is a constant smaller than one. We assume without loss of generality that the graph has no isolated vertices. Since |X ∪ Z|≤2n/3and|Y ∪ Z|≤2n/3, both X and Y are of size at least n/3, and thus there√ are Ω(n) edges with an endpoint in X and similarly for Y .Since Z has at most O( n) edges, the number of directed edges with both endpoints in X is at least Ω(n) and similarly for Y . Since these edges correspond to the vertices in X      and Y , we can conclude that both |X ∪Z | and |Y ∪Z | are at most αn√where α is a constant less than one. This implies that the line graph of G has an (O( n),α)-weak separator tree, where α<1, by repeating this argument recursively in the subgraphs of G containing the edges in X and Y . Since a separator can be found in linear time in planar graphs [31], by applying Theorem 3.3 with γ =1,β =1/2, and δ a constant (since the maximum degree is a constant), we obtain an O(nω/2) time randomized algorithm for solving one system of linear equations (I − K)T x = h. The total encoding time is also O(nω/2)asd is a constant. To compute the edge connectivity from s to a vertex t, by Theorem 2.1 we can just compute the rank of a d × l matrix where l ≤ d,andthiscanbedonein constant time. Therefore the total decoding time is O(n). This proves Theorem 1.3. The same√ result holds for bounded genus graphs with constant maximum degree, since an (O( n), 2/3) separator can be found in linear time [15]. For fixed minor free graphs with constant maximum degree, there is an O(n1.5) time algorithm [2] 744 HO YEE CHEUNG, LAP CHI LAU, AND KAI MAN LEUNG √ for finding an (O( n), 2/3) separator, and this gives an O(n1.5) time algorithm for computing single source edge connectivities in this class of graphs. Alon and Yuster [3] showed how to improve the time complexity to O(n3ω/(3+ω))=O(n1.33)byusinga faster algorithm to find a larger separator (so γ is smaller but β is bigger), and this improved algorithm can be used for computing single source edge connectivities as well. Very recently, Kawarabayashi and Reed [25] proposed an O(n1+) time algorithm for finding a separator in fixed minor-free graphs for any >0, and this can be used to improve the running time. 4. All pairs edge connectivities. In this section we first show how to compute all pairs edge connectivities in general directed graphs, and then show how to improve the running time for graphs with good separators.

4.1. General directed graphs. To solve F = FK + Hs, one can compute the −1 −1 ω inverse of (I − K) and get F = Hs(I − K) .IttakesO(m ) time to compute (I − K)−1 since the matrix (I − K) is of size m × m, but we observe that all pairs edge connectivities can be computed readily once we have (I − K)−1. In our setup, out out out Hs is a d (s) × m matrix with a d (s) × d (s) identity matrix in the columns out −1 corresponding to δ (s). So F is just equal to ((I − K) )δout (s),∗ up to permuting rows. Therefore (I − K)−1 contains all the global encoding vectors for all source vertices, and thus the total encoding time for all pairs is O(mω). To compute the edge connectivity from s to t, by Theorem 2.1 we compute the −1 rank of F∗,δin(t) and this is just equal to the rank of ((I −K) )δout(s),δin(t).Asshown −1 in section 3.1, given a vertex s; computing the ranks of ((I − K) )δout(s),δin(t) for all t O m · dout s ω−1 O m · can be done in ( ( ( )) ) time. So the total decoding time is s∈V ( out ω−1 out out ω−1 (d (s)) ). Since d (s) ≤ n in a simple graph, s∈V O((d (s)) )isatmost m ω−1 2 ω−2 O( n · n ). This implies that the total decoding time is at most O(m n ), which is O(mω)sincem ≥ n. This proves Theorem 1.4. Our algorithm is faster than running the Even–Tarjan algorithm for Ω(n2)pairs as long as m = O(n1.93). For m = O(n) our algorithm runs in O(nω) time, while running, the Even–Tarjan algorithm for Ω(n2)pairstakesO(n3.5) time. We note that Theorems 1.4 and 1.5 can also be derived from the matrix formulation of Ingleton and Piff [21, 9] for vertex connectivities. By transforming to line graphs, the resulting matrix is similar to (I − K)−1. 4.2. Directed graphs with good separators. We show a faster method for computing (I − K)−1 when its underlying graph has a weak separator tree (see sec- tion 3.2). This would imply faster algorithms for computing all pairs edge connectiv- ities in directed fixed minor free graphs when the maximum degree is small. Let AB M , = CD where A and D are square matrices. If A is nonsingular, then S = D − CA−1B is called the Schur complement of A. Lemma 4.1 (Schur’s formula [39]). Let M and A, B, C, D be matrices as defined above. Then det(M)=det(A) × det(S).IfA and S are nonsingular, then A−1 A−1BS−1CA−1 −A−1BS−1 M −1 + . = −S−1CA−1 S−1 Our observation is that for graphs with good separators, we can find a partition of (I − K) such that B and C are of low rank, so that we can compute (I − K)−1 faster by a divide and conquer algorithm. GRAPH CONNECTIVITIES, NETWORK CODING, EXPANDERS 745

The rest of this section is organized as follows. In section 4.2.1, we will show that if a matrix is “well-separable” (to be defined in the next section), then its inverse can be computed more efficiently. Then, in section 4.2.2, we show that the matrix I − K for graphs with good separators is well-separable and conclude that the edge connectivities in such graphs can be computed efficiently. 4.2.1. Inverse of well-separable matrix. We say an n×n matrix M is (r, α)- well-separable (α is a constant smaller than one) if M is invertible and can be written as AB M = CD

so that both A and D are (r, α)-well-separable square matrices with dimension no more than αn,andalsobothB and C are of rank no more than r. In this section, we are going to show that the inverse of a well-separable matrix can be computed in O(rω−2n2)time. To compute M −1, we first compute the inverses of A and D recursively. We will compute M −1 using Schur’s formula. A key step is to use the Sherman–Morrison– Woodbury formula to compute S−1 efficiently, instead of computing D − CA−1B and then (D − CA−1B)−1. The Sherman–Morrison–Woodbury formula tells us how to compute the (D +UV T )−1 efficiently if D−1 is known and U, V are low rank matrices. Lemma 4.2 (Sherman–Morrison–Woodbury [38]). Let M be an n × n matrix, U be an n × k matrix, and V be an n × k matrix. Suppose that M is nonsingular. Then • M + UV T is nonsingular if and only if I + V T M −1U is nonsingular. • if M + UV T is nonsingular, then

(M + UV T )−1 = M −1 − M −1U(I + V T M −1U)−1V T M −1.

T T First, since rank(B), rank(C) ≤ r, we can write B = BuBv ,andC = CuCv ω−2 2 where Bu, Bv, Cu,andCv are size O(n)× r matrices. This can be done in O(r n ) time. Lemma 4.3. If we have A−1 and D−1, then we can compute S−1 =(D − CA−1B)−1 in O(rω−2n2) time. Proof. By Schur’s formula, S = D −CA−1B is nonsingular if M −1 and A−1 exist. The proof consists of two steps. We will first write CA−1B as a product of two low rank matrices. Then we use the Sherman–Morrison–Woodbury formula to compute S−1 efficiently. In the following, rectangular matrix multiplications will be done by dividing each matrix into submatrices of size r × r. Multiplications between these submatrices can be done in O(rω )time. −1 −1 T −1 First, we consider CA B, which is equal to (CA Bu)Bv . C(A Bu) is of size O(n)×r and can be computed using O(n2/r2) submatrix multiplications of size r ×r. −1 −1 T By putting U = CA Bu and V = Bv,wehaveCA B = UV where U and V are of size O(n) × r. Now, we can use the Sherman–Morrison–Woodbury formula to compute (D + UV T )−1 efficiently since D−1 is known and U, V are low rank matrices. By the formula,

S−1 = D−1 − D−1U(I + V T D−1U)−1V T D−1.

Similar to the above, V T D−1U can be computed using O(n2/r2) submatrix multi- plications. Since S is nonsingular, (I + V T D−1U)−1 exists by Lemma 4.2, and it can be computed in one submatrix multiplication time, as I + V T D−1U is of size 746 HO YEE CHEUNG, LAP CHI LAU, AND KAI MAN LEUNG

r × r. Finally, since (D−1U)T and (V T D−1)arer × O(n) matrices, we can compute (D−1U)(I + V T D−1U)−1(V T D−1)usingO(n2/r2) submatrix multiplications. Hence the overall time complexity is O(rω · n2/r2)=O(rω−2n2). Using Lemma 4.3, we can now compute M −1 using Schur’s formula efficiently. Lemma 4.4. If we have A−1, D−1,andS−1, then we can compute M −1 in O(rω−2n2) time. Proof. By Schur’s formula, to compute M −1 we need to compute A−1BS−1CA−1, A−1BS−1,andS−1CA−1. These multiplications all involve some O(n) × r matrices Bu, Bv, Cu,andCv as follows: −1 −1 −1 −1 T −1 −1 • A BS CA =(A Bu)(Bv S CA ), −1 −1 −1 T −1 • A BS =(A Bu)(Bv S ), −1 −1 −1 T −1 • S CA =(S Cu)(Cv A ). All steps during computation of these products involve only O(n) × r (or r × O(n)) matrices. Thus we can avoid computing the product of two n × n matrices. Hence they all only take O(n2/r2) submatrix multiplications to compute. Therefore the total time complexity is O(rω · n2/r2)=O(rω−2n2). By Lemmas 4.3 and 4.4, we can compute M −1 in O(rω−2n2) time if we are given A−1, D−1, and also rank factorization of B and C. We can then use a recursive algorithm to compute M −1. Theorem 4.5. If an n × n matrix M is (r, α)-well-separable, and the separation can be found in O(nγ ) time, then M −1 can be computed in O(nγ + rω−2n2) time. Proof. First, we analyze the time to compute M −1.WeuseanO(nγ ) time algorithm to find an (r, α)-well-separable partition of M. By the property of the T partition, both B and C are matrices of rank at most r. Then we can write B = BuBv T ω−2 2 and C = CuCv in O(r n )timewhereBu, Bv, Cu,andCv are all O(n)×r matrices. We then compute A−1 and D−1 recursively, as A and D by definition are also (r, α)- separable. Using these inverses we can apply Lemma 4.3 to compute S−1,andthen apply Lemma 4.4 to compute M −1 using A−1,D−1,andS−1.Thus,givenA−1 and D−1, we can compute M −1 in O(rω−2n2) time. Let f(n) be the time to compute M −1 of size n × n.Then

f(n)=f(αn)+f((1 − α)n)+O(nγ )+O(rω−2n2),

and it can be shown by induction that f(n)=O(nγ + rω−2n2). 4.2.2. Directed graphs with good separators. In this section, we show that all pairs edge connectivities in planar graphs, bounded genus graphs, and fixed minor free graphs can be computed in O(dω−2nω/2+1)time. We will first see that the underlining matrix I − K for these graphs is well sep- arable. Thus we can apply Theorem 4.5, together with the fact the these graphs have O(n) edges, to obtain an O(dω−2nω/2+1) time algorithm to compute (I − K)−1. Finally, we show that the time to compute the required ranks of all submatrices in (I − K)−1 is O(dω−2nω/2+1). Lemma√ 4.6. Given a fixed minor free graph G,thematrixI − K of G is (O(d n, α)-well-separable for some constant α<1. Proof. First recall that an n × n matrix is (f(n),α)-well-separable if we can par- tition the matrix so that submatrices A and D are square matrices having dimension ≤ αn and are also (f(n),α)-well-separable, while submatrices B and C are of rank at most f(n). We will use the fact√ that a fixed minor free graph G (and its sub- graphs) has O(n)edgesandan(O( n), 2/3)-separation (recall the definition from section 3.2). GRAPH CONNECTIVITIES, NETWORK CODING, EXPANDERS 747

To show that I − K is well-separable, we use induction on the number of edges of the graph. We will first show the inductive step and then the base case. For the inductive step, we can use a separator to divide the graph√ into three parts X, Y, Z such that |X ∪ Z|≤2n/3, |Y ∪ Z|≤2n/3, and |Z| = O( n), and there are no edges between X and Y .LetE1 be the set of edges with at least one endpoint in X and let E2 be E − E1. We partition I − K as follows: E E 1 2 E AB 1 . E2 CD

Since |Y | =Ω(n) and each vertex in Y is of degree at least 1, we have |E1| =Ω(n)and |E2| =Ω(n), and thus |E1|, |E2|≤αn for some constant α<1. Let F1 be the subset of E1 with one endpoint in Z; define F2 similarly for E2.Thenanyedgein√ E1 − F1 does not share an endpoint with any edge in E2 −√F2.Since|Z| = O( n)andeach vertex is of degree at√ most d, there are at√ most O(d n) edges with one endpoint in Z, and√ thus |F1| = O(d n)and|F2| = O(d n). Therefore, submatrices√B and C have O(d n) nonzero rows and columns, and thus are of rank at most O(d n). Also I −K must be invertible because I − K has ones on its diagonal, and thus det(I − K)isa nonzero polynomial. Matrices A and D correspond to matrices√ I −K for subgraphs of G, and by the inductive hypothesis √A and D are (O(d n),α)-well-separable. Hence we can conclude that I − K is (O(d n),α)-well-separable. For the base case of the induction, observe that any small enough graph must be separable. For any graph with the number of edges√ less than a small constant c,we can safely assume that its matrix I − K is (O(d n),α)-well-separable because any way to partition the edge set into halves gives B and C of rank less than c. Lemma 4.7. With probability at least 1 − O(m log m)/|F|,thematrixI − K of a fixed minor free graph G remains well-separable after substituting random values in ki,j . Proof. It suffices to analyze the probability that all of I − K, A,andD remain invertible after substituting random values to ki,j .Notethatdet(I − K)isadegree m polynomial not identically equal to zero, because I − K has ones on its diagonal. Thus, by the Schwartz–Zippel lemma, I − K is invertible with probability at least 1 − m/|F|.SinceA and D correspond to matrices I − K for subgraphs of G,we can apply the same argument to A and D recursively. There are O(log m) levels of recursions, and in each level the sum of the polynomial degrees in all the subproblems is m. Therefore, all the required matrices are invertible with probability at least − O m m /|F| 1 ( log ) . √ By Lemma 4.7 we conclude that I − K is (O(d n),α)-well-separable. We can now apply Theorem 4.5 with γ =1.5[2].So(I − K)−1 can be computed in O(n1.5 + √ ω−2 2 ω−2 ω/2+1 (d n) n )=O(d n ) time. For the decoding time, by an argument similar out ω−1 to that in section 4.1, the total decoding time is s∈V O(m · (d (s)) ). Since out n ω−1 2 ω−2 m = O(n)andd (s) ≤ d,thisisatmostO(n · d · d )=O(n d ), which is dominated by the encoding time. Thus√ we obtain the following corollary. This is faster than Theorem 1.4 when d = O( n). Corollary 4.8. All pairs edge connectivities can be computed in O(dω−2nω/2+1) time for any directed fixed minor free graph with maximum degree d.

5. Edge splitting-off. In this section, we show that expanders and supercon- centrators can be applied to design fast algorithms for another well-studied graph connectivity problem. 748 HO YEE CHEUNG, LAP CHI LAU, AND KAI MAN LEUNG

Splitting-off a pair of edges (ux, xv) means deleting these two edges and adding a new edge uv if u = v. Note that the above definition works for both undirected and directed graphs. Edge splitting-off theorems show the existence of one pair of edges (ux, xv) so that its splitting-off preserves the edge connectivities for all pairs of vertices not involving x. These results are a powerful tool for proving theorems and developing algorithms for many graph connectivity problems, including connectivity augmentation problems, network design problems, tree packing problems, and graph orientation problems (see the references in [27]). Faster algorithms for the splitting-off operation can be used to obtain faster algo- rithms for many graph connectivity problems. There are several existing algorithms for this task (e.g., [14, 5, 7]) in undirected and directed graphs, but most algorithms only preserve global edge connectivity (i.e., the value of the global min-cut). Our results in this section apply to the general setting where all pairs edge connectivities are preserved. In undirected graphs, Mader proved that there is a pair of edges that can be split off in almost all situations. Theorem 5.1 (Mader [32]). Let G =(V,E) be an undirected graph and x ∈ V . If there is no cut edge incident to x and d(x) =3 , then there exists an edge pair (yx,xz) so that its splitting-off preserves the edge connectivity for every pair of vertices a, b ∈ V − x. There is a similar theorem for Eulerian directed graphs where for every vertex its indegree is equal to its outdegree. Theorem 5.2 (Bang-Jensen, Frank, and Jackson [4]). Let G =(V,E) be an Eulerian directed graph and x ∈ V . Then there exists an edge pair (yx,xz) so that its splitting-off preserves the edge connectivity for every ordered pair of vertices a, b ∈ V − x. In undirected graphs, when d(x) is even, Mader’s theorem can be repeatedly applied until x is of degree zero. In Eulerian directed graphs, Theorem 5.2 can also be repeatedly applied until x is of degree zero. We call this a complete splitting-off at x (also known as vertex splitting-off). Our goal is to design a fast algorithm to completely split-off x. A straightforward algorithm is to try every pair of edges on x and check whether the edge connectivities decrease for some pairs after its splitting- off. In the worst case, this requires O((d(x))2) attempts to completely split-off x. We show how to use expanders and superconcentrators to completely split-off x in O(d(x)) attempts in both undirected graphs and directed Eulerian graphs. In undirected graphs, it was proved by Lau and Yung [27] that O(d(x)) attempts are enough to completely split-off x, using a structural theorem of min-cuts. Here we show how to get the same result immediately using expanders. We replace x by a constant degree expander graph Hx with O(d(x)) vertices and “rewire” each edge of x to a distinct vertex in Hx. See Figure 5.1 for an illustration. The graph Hx is required to satisfy the following property: for every subset S ⊆ V (Hx) with |S|≤|V (Hx)|/2, it holds that d(S) ≥|S| where d(S)isthenumber of edges with exactly one endpoint in S. By Menger’s theorem, it follows that for every S, T ⊆ V (Hx) with |S| = |T |,thereare|S| edge disjoint paths between S and T in Hx. Hence, the edge connectivity between every pair of vertices a, b ∈ V −x in the resulting graph is the same as in the original graph. We can add extra edges to make sure that every vertex in Hx is of even degree. Then every vertex in Hx can be completely split-off by Mader’s theorem. Since every vertex in Hx is of constant degree, we can completely split-off one vertex in Hx in O(1) attempts by the straightforward GRAPH CONNECTIVITIES, NETWORK CODING, EXPANDERS 749

Fig. 5.1. Replace vertex x by a 3-regular expander Hx and “rewire” the edges.

algorithm, and thus we can completely split-off all vertices in Hx in O(d(x)) attempts since Hx has only O(d(x)) vertices. After we completely split-off all vertices in Hx,this is the same as completely split-off x in the original graph, and the edge connectivity between every pair is preserved, and we are done. For the algorithm to be efficient, we need to show that the expander graph Hx can be constructed efficiently, and here we give an example of one such construction. For a d-regular graph G =(V,E), the edge expansion of a set S ⊆|V |/2 is defined as h(S)=d(S)/(d·|S|). The requirement that d(S) ≥|S| for every set S with |S|≤|V |/2 is equivalent to the requirement that h(S) ≥ 1/d for every set S with |S|≤|V |/2. Let h(G)=minS:|S|≤|V |/2 h(S). By Cheeger’s inequality, h(G) ≥ (1 − λ2)/2where λ2 is the second largest eigenvalue in the normalized A(G)/d.Soit suffices to construct a graph with λ2 ≤ 1 − 2/d. Consider the graph Gp =(Vp,Ep) in which Vp = {0,...,p− 1}.Fora ∈ Vp −{0},thevertexa is connected to (a +1) mod p,to(a − 1) mod p, and to its multiplicative inverse a−1 mod p.Thevertex0 is connected to 1 and to p − 1 and has a self-loop. This graph Gp is 3-regular, and it is known that λ2 < 0.9999 (see [19, section 11.1.2]). By taking the 8th power of 8 8 8 8 Gp, denoted by Gp, one can verify that λ2 ≤ 1 − 2/d .SoGp satisfies the property that d(S) ≥|S| for every S with |S|≤|V |/2 and is of constant degree. Since Gp 8 can be constructed in O(p log p)time,Gp can also be constructed in O(p log p)time. 8 Therefore, for a vertex x with degree d(x), we can set Hx to be Gp for p = O(d(x)). In directed graphs, it is not known how to completely split-off a vertex faster than O((din(x))2) attempts, and we show how to do it in O(din(x)) attempts using superconcentrators. The argument is very similar to the undirected case. Replace in in vertex x by a superconcentrator Γx with O(d (x)) inputs and O(d (x)) outputs as in Figure 3.1. The edge connectivity between every pair of vertices in V − x in the resulting graph is the same as in the original graph by the property of the superconcentrator. We can add extra edges within Γx to make sure that every vertex has the same indegree and outdegree. Then, by Theorem 5.2, we can completely in split-off every vertex in Γx. This can be done in O(d (x)) attempts, since one vertex in Γx can be completely split-off in O(1) attempts, as it has constant degree, and in there are O(d (x)) vertices in Γx. After we completely split-off all vertices in Γx,this is the same as completely split-off x in the original graph, and the edge connectivity between every pair is preserved. Recall from section 3.1.1 that a superconcentrator with d inputs and d outputs can be constructed in O(d) time, and so the above reduction is efficient. 750 HO YEE CHEUNG, LAP CHI LAU, AND KAI MAN LEUNG

In general, expander graphs and superconcentrators can be used to reduce the maximum degree significantly while preserving the edge connectivities and increasing the number of vertices only moderately. This may be used to reduce the running time of an algorithm that has a superlinear dependency on the maximum degree. We believe that these reductions will find further applications for other graph connectivity problems. Acknowledgments. We thank Andrej Bogdanov for his help on expanders and superconcentrators and Nick Harvey and an anonymous reviewer for useful comments on the paper.

REFERENCES

[1] R. Ahlswede, N. Cai, S. R. Li, and R. W. Yeung, Network information flow, IEEE Trans. Inform. Theory, 46 (2000), pp. 1204–1216. [2] N. Alon, P. Seymour, and R. Thomas, A separator theorem for nonplanar graphs,J.Amer. Math. Soc., 3 (1990), pp. 801–808. [3] N. Alon and R. Yuster, Solving linear systems through nested dissection, in Proceedings of the 51st Annual IEEE Symposium on Foundations of Computer Science, IEEE Press, Piscataway, NJ, 2010, pp. 225–234. [4] J. Bang-Jensen, A. Frank, and B. Jackson, Preserving and increasing local edge-connectivity in mixed graphs, SIAM J. Discrete Math., 8 (1995), pp. 155–178. [5] A. A. Benczur´ and D. R. Karger, Augmenting undirected edge connectivity in O(n2) time, J. Algorithms, 37 (2000), pp. 2–36. [6] A. Bhalgat, R. Hariharan, T. Kavitha, and D. Panigrahi, An O˜(mn) Gomory-Hu tree construction algorithm for unweighted graphs, in Proceedings of the 39th Annual ACM Symposium on Theory of Computing, ACM, New York, 2007, pp. 605–614. [7] A. Bhalgat, R. Hariharan, T. Kavitha, and D. Panigrahi, Fast edge splitting and Ed- monds’ arborescence construction for unweighted graphs, in Proceedings of the 19th An- nual ACM-SIAM Symposium on Discrete Algorithms, SIAM, Philadelphia, ACM, New York, 2008, pp. 455–464. [8] U. Brandes and D. Wagner, A linear time algorithm for the arc disjoint Menger problem in planar directed graphs, Algorithmica, 28 (2000), pp. 16–36. [9] J. Cheriyan, Randomized O˜(M(|V |)) algorithms for problems in matching theory,SIAMJ. Comput., 26 (1997), pp. 1635–1655. [10] H. Y. Cheung, T. C. Kwok, and L. C. Lau, Fast matrix rank algorithms and applications, in Proceedings of the 44th Annual ACM Symposium on Theory of Computing, ACM, New York, 2012, pp. 549–562. [11] E. Erez and M. Feder, Convolutional network codes, in Proceedings of the IEEE International Symposium on Information Theory, IEEE Press, Piscataway, NJ, 2004, p. 146. [12] S. Even and R. E. Tarjan, Network flow and testing graph connectivity,SIAMJ.Comput., 4 (1975), pp. 507–518. [13] O. Gabber and Z. Galil, Explicit constructions of linear-sized superconcentrators, J. Comput. System Sci., 22 (1981), pp. 407–420. [14] H. N. Gabow, Efficient splitting off algorithms for graphs, in Proceedings of the 26th Annual ACM Symposium on Theory of Computing, ACM, New York, 1994, pp. 696–705. [15] J. R. Gilbert, J. P. Hutchinson, and R. E. Tarjan, A separator theorem for graphs of bounded genus, J. Algorithms, 5 (1984), pp. 391–407. [16] A.V. Goldberg and S. Rao, Flows in undirected unit capacity networks, in Proceedings of the 38th Annual IEEE Symposium on Foundations of Computer Science, IEEE Press, Piscataway, NJ, 1997, pp. 32–34. [17] N. J. A. Harvey, Algebraic algorithms for matching and matroid problems, SIAM J. Comput., 39 (2009), pp. 679–702. [18] T. Ho, M. Medard,´ R. Koetter, D. R. Karger, M. Effros, J. Shi, and B. Leong, A random linear network coding approach to multicast, IEEE Trans. Inform. Theory, 52 (2006), pp. 4413–4430. [19] S. Hoory, N. Linial, and A. Wigderson, Expander graphs and their applications, Bull. Amer. Math. Soc. (N.S.), 43 (2006), pp. 439–561. [20] J. E. Hopcroft and R. M. Karp, An n5/2 algorithm for maximum matchings in bipartite graphs, SIAM J. Comput., 2 (1973), pp. 225–231. GRAPH CONNECTIVITIES, NETWORK CODING, EXPANDERS 751

[21] A. W. Ingleton and M. J. Piff, Gammoids and transversal matroids, J. Combin. Theory Ser. B, 15 (1973), pp. 51–68. [22] S. Jaggi, Design and Analysis of Network Codes, PhD thesis, California Institute of Technol- ogy, Pasadena, CA, 2006. [23] S. Jaggi, P. Sanders, P. A. Chou, M. Effros, S. Egner, K. Jain, and L. M. G. M. Tolhuizen, Polynomial time algorithms for multicast network code construction, IEEE Trans. Inform. Theory, 51 (2005), pp. 1973–1982. [24] D. R. Karger and M. S. Levine, Finding maximum flows in undirected graphs seems easier than bipartite matching, in Proceedings of the 30th Annual ACM Symposium on Theory of Computing, ACM, New York, 1998, pp. 69–78. [25] K. Kawarabayashi and B. Reed, A separator theorem in minor-closed classes, in Proceedings of the 51st Annual IEEE Symposium on Foundations of Computer Science, IEEE Press, Piscataway, NJ, 2010, pp. 153–162. [26] R. Koetter and M. Medard´ , An algebraic approach to network coding, IEEE/ACM Trans. Networking, 11 (2003). pp. 782–795. [27] L. C. Lau and C. K. Yung, Efficient edge splitting-off algorithms maintaining all-pairs edge- connectivities, in Proceedings of the 14th International Conference on Integer Programming and Combinatorial Optimization, Lecture Notes in Comput. Sci. 6080, Springer, Berlin, 2010, pp. 96–109. [28] S. R. Li and R. W. Yeung, On convolutional network coding, in Proceeding of the 2006 IEEE International Symposium on Information Theory, IEEE Press, Piscataway, NJ, 2006, pp. 1743–1747. [29] S. R. Li, R. W. Yeung, and N. Cai, Linear network coding, IEEE Trans. Inform. Theory, 49 (2003), pp. 371–381. [30] R. J. Lipton, D. J. Rose, and R. E. Tarjan , Generalized nested dissection,SIAMJ.Numer. Anal., 16 (1979), pp. 346–358. [31] R. J. Lipton and R. E. Tarjan, A separator theorem for planar graphs, SIAM J. Appl. Math., 36 (1979), pp. 177–189. [32] W. Mader, A reduction method for edge-connectivity in graphs, Ann. Discrete Math., 3 (1978), pp. 145–164. [33] M. Mucha and P. Sankowski, Maximum matchings via Gaussian elimination, in Proceedings of the 45th Annual IEEE Symposium on Foundations of Computer Science, IEEE Press, Piscataway, NJ, 2004, pp. 248–255. [34] A. Schrijver, Combinatorial Optimization, Springer, New York, 2003. [35] J. Schwartz, Fast probabilistic algorithms for verification of polynomial identities,J.ACM, 27 (1980), pp. 701–717. [36] A. L. Toledo and X. Wang, Efficient multipath in sensor networks using diffusion and net- work coding, Internat. J. Sensor Networks, 7 (2010), pp. 176–188. [37] L. Valiant, On non-linear lower bounds in computational complexity, in Proceedings of the 7th Annual ACM Symposium on Theory of Computing ACM, New York, 1975, pp. 45–53. [38] M. A. Woodbury, Inverting Modified Matrices, Memorandum Report 42, Statistical Research Group, Princeton University, Princeton, NJ, 1950. [39] F. Zhang, The Schur Complement and Its Applications, Springer, New York, 2005.