2019 IEEE 60th Annual Symposium on Foundations of Computer Science (FOCS)

Faster Intersection

Deeparnab Chakrabarty Yin Tat Lee Aaron Sidford Dartmouth College University of Washington Stanford University [email protected] Microsoft Research [email protected] [email protected] Sahil Singla Sam Chiu-wai Wong Princeton University Microsoft Research Institute for Advanced Study [email protected] [email protected]

Abstract—In this paper we consider the classic matroid I. are fundamental objects in , and intersection problem: given two matroids M1 =(V,I1) and the abstract definition above generalizes a wide range of M V,I V 2 =( 2) defined over a common ground set , compute concepts ranging from acyclic graphs to linearly independent a set S ∈I1 ∩I2 of largest possible cardinality, denoted by r. We consider this problem both in the setting where each matrices. M V,I M V,I Mi is accessed through an independence oracle, i.e. a routine Given two matroids 1 =( 1) and 2 =( 2) which returns whether or not a set S ∈Ii in Tind time, and over the same ground set, the problem is Mi the setting where each is accessed through a rank oracle, to find a set I ∈I1 ∩I2 with the largest cardinality |I|. This i.e. a routine which returns the size of the largest independent problem generalizes many important combinatorial opti- of S in Mi in Trank time. mization problems such as bipartite , arborescences In each setting we provide faster exact and approximate in digraphs, and packing spanning trees. Unsurprisingly, algorithms. Given an independence oracle, we provide an exact this problem has applications in areas such as electrical O(nr log r ·Tind) time algorithm. This improves upon previous 1.5 best known running times of O(nr ·Tind) due to Cunningham engineering [4], [5] and network coding [6], [7], [8]. 2 3 in 1986 and O˜(n ·Tind + n ) due to Lee, Sidford, and Wong To define the problem algorithmically, one needs to spec- in 2015. We also provide two algorithms which compute a ify access to these matroids. In the literature it is common (1 − )-approximate solution to matroid intersection running in 1.5 1.5 2 −1 −2 1.5 −4.5 to assume access to an independence oracle which takes as times O˜(n / ·Tind) and O˜((n r + r ) ·Tind), S ⊆ V S ∈I O nr/ ·T input a subset and returns whether or not. respectively. These results improve upon the ( ind)- T time algorithm of Cunningham (noted recently by Chekuri We use ind to denote the maximum time taken by such an and Quanrud). oracle to answer a single query. This raises an algorithmic Given a rank oracle, we provide algorithms√ with even better question: in how few queries can the matroid intersection dependence on n and r. We provide an O(n r log n ·Trank)- problem be solved? −1 time exact algorithm and an O(n log n ·Trank)-time algo- Starting from the work of Edmonds [9], many polynomial − rithm which obtains a (1 )-approximation to the matroid time algorithms [10], [11], [1], [12], [13], [2] have been intersection problem. The former result improves over the 3 proposed for the matroid intersection problem. The previous O˜(nr ·Trank + n )-time algorithm by Lee, Sidford, and Wong. The rank oracle is of particular interest as the matroid state-of-the-art captured by two works. One is a classic 1.5 intersection problem with this oracle is a special case (via O(nr ·Tind) time combinatorial algorithm by Cunning- Edmond’s minimax characterization of matroid intersection) ham [1] where r is the cardinality of the largest common of the submodular function minimization (SFM) problem with independent set of the two matroids. The second algorithm an evaluation oracle, and understanding SFM query complexity O˜ n2 ·T n3 is an outstanding open question. is an ( ind + )-time algorithm by Lee, Sidford, and Wong [2] based on fast algorithms implementing the Keywords -Matroids; Combinatorial Optimization; Submod- ellipsoid method. Note that this pays a higher overhead ular Functions than Cunningham’s result and makes many more queries if r  n2/3. This raises the important question, “Is there an I. INTRODUCTION algorithm which obtains the best of both results?” Our first A matroid M =(V,I) is an abstract set system defined result answers this affirmatively (restated as Theorem 18 in over a finite ground set (universe) V of size n where the the main body). collection I⊆2V of independent sets satisfy two properties: Theorem 1. There is an O(nr log r ·T )-time algorithm to (a) A ∈I implies every subset B ⊆ A is also independent, ind solve the matroid intersection problem exactly. i.e., B ∈I, and (b) for any two sets A, B ∈Iwith |A| < |B|, there exists an element e ∈ B \ A such that A + e ∈ Our next result looks at approximate matroid intersection.

2575-8454/19/$31.00 ©2019 IEEE 1146 DOI 10.1109/FOCS.2019.00072 Due to both theoretical and practical reasons, there has been Another reason is that our main ideas with independence extensive recent work [14], [15], [16], [17], [18], [3], [19], oracle arose out of understanding the question with rank [20], [21] in trying to obtain faster (1 ± )-approximation oracle, and so rank oracle forms a good warm-up. In this algorithms for problems which already have polynomial paper we provide the following results on solving matroid time exact algorithms. A (1 − )-approximate algorithm for intersection (both approximately and exactly with a rank 3 matroid intersection would return a set I ∈I1 ∩I2 with oracle), improving over the O˜(nr·Trank +n )-time algorithm |I|≥(1 − )r for r being the cardinality of largest common by Lee, Sidford, and Wong [2]. Later in the paper these are independent set. restated as Theorem 16 and Theorem 17. For matroid intersection, in fact Cunningham’s [1] al- √ Theorem 4. There is an O(n r log n·T )-time algorithm gorithm already gives a (1 − )-approximate solution in rank to exactly solve the matroid intersection problem. There is O(nr/ ·T ) time. This observation was made explicit − ind an O(n 1 log n ·T )-time algorithm to obtain a (1 − )- in a recent paper by Chekuri and Quanrud [3]. Given our rank approximation to the matroid intersection problem. exact algorithm result above, it is natural to wonder if one can obtain faster approximation algorithms. In particular, A. Our Techniques can there be subquadratic approximation algorithms for the matroid intersection algorithm problem? Our second result At a high level our algorithms build upon existing combi- gives an affirmative answer (restated as Theorem 21 in the natorial algorithms, a la Edmonds [9] and Cunningham [1]. main body). We extend these algorithms leveraging the following key √ ideas: the binary search idea which allows fast explo- O n1.5 r/1.5 ·T Theorem 2. There is an ( log ind)-time ration through the exchange graph, the augmenting sets − algorithm to obtain a (1 )-approximation to the matroid methodology which allows multiple parallel augmentations intersection problem. in the exchange graph, and first-order methods which allow efficient sparsification of the ground set. In this section we The above theorem√ has no significant dependence on r, and indeed when r  n, as it stands, it is better to use the explain each idea in greater depth, leaving the full details to subsequent sections. We begin with a refresher and a high- exact algorithm. However, we can get a better result√ (restated as Theorem 55 in the main body) in the regime n  r  level overview of existing combinatorial algorithms. n ; concretely, assume r =Θ(nc) where 1

1147 shows how to spend only O(nr) independence-oracle calls only 1/ phases. However, the “non-amortized” cost is paid (each edge is queried only once in a phase) to sequentially per augmentation, and this can still be O˜(nr) even with 1/ run all the augmentations in a single phase; as in Hopcroft- phases. Indeed, the phases don’t seem to add any advantage. Karp [22], the early phases lead to big√ improvements and It seems unlikely that the binary search idea alone can be the total number of phases is at most O( r). This leads to salvaged to break the “quadratic barrier” (when r ≈ n). 1.5 a total of O(nr ·Tind)-time algorithm. To overcome this and prove Theorem 2, we propose The binary search idea.: We start by describing the the idea of augmenting sets. Recall the idea presented in idea when we have a rank oracle and then discuss the Cunningham’s algorithm: the algorithm is akin to Hopcroft- independence oracle case. The first thing to note is that one Karp [22] in that it runs in phases, and in each phase it doesn’t need the whole exchange graph for an augmentation. augments along multiple augmenting paths. However, the Instead, what we need is to perform a breadth first search big difference is that the augmentations need to be performed (BFS) on this “unknown” exchange graph. And the rank sequentially rather than in parallel as in Hopcroft-Karp, and oracle provides the following access to this graph: for every this takes time. On the other hand, if we could find all the vertex a and every subset B ⊆ V \v,inO(log n) rank-oracle augmentations that can occur up front, then we will save on calls (by doing a binary-search style argument) we can detect the time taken to find them sequentially. This is what our if a has an edge to some vertex in B or not. This suffices notion of augmenting sets achieves. for doing a BFS on the graph in O(n log n ·Trank) time, and An augmenting set is a sequence of disjoint we do it at the beginning of each phase of Cunningham’s B1,A1,B2,...,A,B+1 where alternate subsets are not in, algorithm. and respectively in, the current solution S. More precisely, The second observation is that each phase in Cunning- the set Ai is a subset of vertices at distance exactly 2i from ham’s algorithm can be implemented using O(n log n)-many the source of the exchange graph, and vertices Bi is at rank-oracle calls again. Indeed, once the distances of vertices distance 2i − 1 from the source. Each subset has the same are known, shortest paths can be computed using the afore- cardinality and finally, deleting all the Ai’s and adding all mentioned graph access which the rank-oracle provides us. It the Bi’s preserves independence in both matroids. If the is true that after some augmentations, some vertices will be size of each set is 1, an augmenting set is the same as an misclassified (or will be useless, to borrow Cunningham’s [1] augmenting path. terminology) but such vertices are never queried again. We prove an equivalence between augmenting sets and The latter requires some distance-monotonicity properties a collection of augmenting paths which can be augmented from [1]. Theorem 4 actually√ follows quite easily now: for an sequentially in the exchange graph. We introduce the concept exact algorithm, there are O( r) such phases; for a (1−)- of maximal augmenting sets, and show (a) as long as the 1 approximate algorithm, we need only O( )-phases. Details shortest path is small, say (early phases of the algorithm), of this are given in Section IV. the maximal and maximum augmenting sets are within a Things are a bit trickier using only an independence multiplicative O()-factor, and (b) we show an algorithm to oracle, since we cannot detect, in O(log n) queries, whether find a “near maximal” augmenting set, which allows us to a vertex a has an edge to a subset B or not. Nevertheless, guarantee that in any phase, and for any p, after spending 2 the following is true: for a vertex a/∈ S (recall S is O(n /p ·Tind) time the maximum number of remaining - the current solution) and a subset B ⊆ S,inO(log r) length augmentations is O(p). These final augmentations a O˜ np ·T independence queries we can figure out whether has can be done in ( ind) time√ using the previous binary an edge to/from a vertex in B. This is due to the way search ideas. Setting p ≈ n gives the desired result the exchange graph is defined. Armed with this observa- (Theorem 2). The precise definition of augmenting sets, its tion, after every augmentation, we can perform a BFS of properties, and the details of above ideas are in Section VI. the new exchange graph (i.e., find the distance labels of We are hopeful that this new class of algorithms, which may all vertices) in O(n log r) independence oracle calls plus be of independent interest, find further applications in related an O˜(1) “amortized” independence call per vertex whose problems. distance label changes in the current iteration. Since each Frank-Wolfe sparsification and sampling.: To obtain vertex changes its distance label at most r times, the total Theorem 3, we need one additional idea. Since we are amortized cost is O(nr ·Tind). Since there are at most r being approximate, we can further improve the running augmentations, the total time taken in the (non-amortized time of our algorithm by sparsifying the ground set from 2 part of the) BFS computations is O(nr log r ·Tind). Details n to O˜(r/ ). We first look at the fractional solution to of this are described in Section V. the matroid intersection problem as a Augmenting sets.: Our exact algorithm with indepen- problem. Next, we observe that if we apply a constrained dence oracle queries has two kinds of cost, both of which first-order method (aka the Frank-Wolfe algorithm), each are O˜(nr·Tind)-time. The “amortized” cost which is paid per step of the algorithm corresponds to solving the single “distance increase” per vertex can be made O˜(n/) if we run matroid optimization problem which can be done by the

1148 in O(n log n + n ·Tind) time. Furthermore, theoretic lower bound can be attained for the number of to get an -optimal fractional solution, one needs only queries required for matroid intersection. Unfortunately, the 2 ˜ 2 ˜ n O(n/r ) iterations which takes O( r2 ·Tind) time. only lower bound we are aware of is due to Harvey [32], Next, we apply a sparsification procedure due to [33]. For matroids with r = n/2, Harvey [32] shows a lower O˜ r/2 n−o n ω n Karger [23] that leads us to a ground set with only ( ) bound of (log2 3) ( ) queries. Obtaining an ( ) lower elements (instead of n elements), and which has a (1−O())- bound is a challenging open problem. approximate common independent set. Once the ground set II. PRELIMINARIES shrinks, we can apply the algorithm from the previous sec- tion (using augmenting sets) to get a (1−)-approximate so- Here we provide the notation (Section II-A) and previous 1.5 4.5 lution in O˜(r / ·Tind) time. Taking everything together known results about the matroid intersection (Section II-B) gives us Theorem 3. The details are given in Section VIII. that we use throughout the paper. B. Related Works A. Notation Polynomial time algorithms for matroid intersection are Here we provide the notational conventions we use more than forty years old, with the first algorithms present throughout the paper. in the works of [9], [10], [11]. The running time of Set Notation: We often work with subsets of a finite set these algorithms were O(nr2 ·T ). Indeed, many of these ind V which we call the universe or ground set.ForI ⊆ V papers [11], [24], [25], [12], [26], [13], [2], [19] looked at the def def and a ∈ V we let I + a = I ∪{a} and I − a = I \{a}. weighted matroid intersection problem, and gave polynomial When the universe V is clear from the context, we let time algorithms. def I = V \ I. We often abuse notation A + B := A ∪ B for For certain special matroids faster algorithms are known. better readability. Indeed, when the matroid is given explicitly, one can talk of pure running time instead of oracle queries. For instance, Matroid: A tuple M =(V,I) for finite set V and I⊆2S for exact maximum cardinality√ bipartite matching, the best is called a matroid if (i) for every A ∈I and B ∈I where running time is the O(m n)-time algorithm due to [22] |A| < |B|, there exists an element a ∈ B \ A such that and O˜(m10/7)-time algorithm due to Madry [27]. Here m A ∪ a ∈I, (ii) ∅∈I, and (iii) for every A ⊆ A where is the number of edges in the graph (and so, the number A ∈I,wehaveA ∈I. of elements in the matroid), while n is the number of Independent Sets: We call S ⊆ V independent if S ∈I vertices which is the rank of the matroid. It is instructive√ to O˜ m n ·T and dependent otherwise. Further, for any S ∈Iwe let compare what our results give: we give an ( rank) def freeM(S) = {a ∈ S | S + a ∈I}. and O˜(mn ·Tind) time algorithm. In dense graphs, the best O nω algorithm is an ( )-running time algorithm by [28], : The matroid polytope PM is the convex [29], where ω is the exponent of multiplication. For hull of the indicator vectors of the independent sets of M. linear matroids, the matroid intersection problem can be solved in essentially O(nrω−1)-time [29], [30]. For Intersection Polytope: The matroid intersection matroids, the matroid intersection problem can be solved in polytope is the of the indicator vectors of the √ M , M O(n r log r) time [12], [26]. common independent sets of 1 2. It is well known P ∩P The study of approximate matroid intersection problems that this polytope is given by M1 M2. is newer. As Chekuri and Quanrud [3] note, Cunning- Rank: For a matroid M =(V,I) we define the rank of ham’s analysis implies a O(nr/ ·T )-time algorithm to ind M as rank(M)=maxS∈I |S|. Further, for any S ⊆ V we get an (1 − )-approximate matroid intersection. Huang et def define rankM(S) =maxT ⊆S|T ∈I |T |, i.e., the size of the al. [19] and Chekuri and Quanrud [3] study the approx- largest independent set contained in S. imate weighted version. The former gives an O˜(nr1.5/ · Tind)-time [19], while the latter Circuits: For matroid M =(V,I) we call S ⊆ V a circuit 2 2 gives an O(nr log (1/)/ ·Tind)-time approximation al- if it is a minimal dependent set, i.e., S/∈I but S − a ∈I gorithm. Contrast this with our O˜(nr ·Tind)-time exact for any a ∈ S.ForS ∈Iand a ∈ S such that S + a/∈I 1.5 1.5 and O˜(n / )-time approximate algorithm, albeit for the we let circuitM(S + a) denote a minimal dependent unweighted version. Finally, Guruganesh and Singla [31] subset of S + a. Standard results in matroid theory 1 δ M S a give an 2 + -approximation algorithm for a small but fixed show that circuit ( + ) is uniquely defined as the set constant δ which runs in O(n ·Tind)-time. of elements b ∈ S+a such that S+a−b ∈I(see Lemma 5). We end the introduction with, which to our knowledge, is the only lower bound known for matroid intersection. Exchangeable Pairs: For a matroid M =(V,I) Since we are in the oracle (rank/independence) model, it and S ∈Iwe call a ∈ S and b/∈ S exchangeable is perhaps foreseeable that some non-trivial information if S − a + b ∈I. For a set S ∈Iwe let

1149 def / exchangeM(S) = {(a, b) ∈ S × S | S − a + b ∈I}denote the shortest augmenting path is 1 . The last lemma imposes all exchangeable pairs in S. control over the structure of the exchange graph as we carry out augmentations. Exchange Graph: For matroids M =(V,I ) and 1 1 M M =(V,I ) and S ∈I ∩I we define the exchange Lemma 7 (Cunningham [1]). For any two matroids 1 = 2 2 1 2 V,I M V,I graph G(S)=(V ∪{s, t},ES) as the directed graph with ( 1) and 2 =( 2) with the largest common inde- r S ∈I ∩I vertices V ∪{s, t} where s and t are known as the source pendent set of size , given an a set 1 2 of size and sink vertices respectively. There are the following |S| |S| then for all a ∈ V denote the maximum number of disjoint bases in M. 1 2 we have Oracles: Throughout this paper we assume that given  dG S (s, a) ≥ dG(s, a) and dG S (a, t ) ≥ dG S (a, t) . a matroid M =(V,I) we can only access it through ( ) ( ) ( ) an oracle. We consider two such oracle models. First, an independence oracle, which when queried with any III. EXCHANGE GRAPH EXPLORATION VIA BINARY SEARCH S ⊆ V , determines whether or not S ∈I in time Tind(M). Second, a rank oracle, which when queried with an S ⊆ V , In this section we show how to use rank and independence returns rankM(S) in time Trank(M). Note that for S ⊆ V oracles to efficiently query the exchange graph for a pair S ∈I S |S| we have that if and only if rankM( )= of matroids, M1 =(V,I1) and M2 =(V,I2). These and consequently Tind(M)=O(Trank(M)).Inthe graph exploration primitives form the of our exact typical setting where we have two matroids M1 and and approximate matroid intersection algorithms with a rank def M2 we let Trank = O(Trank(M1)+Trank(M2)) and oracle as well as our exact matroid intersection algorithm def Tind = O(Tind(M1)+Tind(M2)). with an independence oracle. In Section III-A we show how to efficiently find free B. Matroid Theory vertices using a rank oracle and in Section III-B we show Here we provide various standard results about the the how to efficiently find exchangeable pairs using an indepen- structure of matroids and matroid intersection used through- dence oracle. Each routine works by a careful binary search out the paper. The first two lemmas are folklore. with the appropriate oracle and serves an important role in Lemma 5. For matroid M =(V,I) and any S ∈Iand efficiently finding edges in the exchange graph. a ∈ V S a/∈I with + , we have A. Finding Free Vertices using Rank Oracle

circuitM(S + a)={b ∈ S + a | S + a − b ∈I}. We show that given a matroid M =(V,I), an indepen- dent set S ∈I, and a set B ⊆ V , we can efficiently find s, v , ...v ,t Lemma 6 (Shortest augmenting paths). Let 1 a be a free element e ∈ B with respect to S (i.e., S + e ∈I) s t G S a shortest path from to in the exchange graph ( ). Then or conclude that there is none. The procedure FindFree S v − v ... − v v t ∈I ∩I + 1 2 + a−1 + a + 1 2, i.e., augmenting given in Algorithm 1 finds this element by binary search along a shortest augmenting path preserves independence. with the rank oracle. There is a free element of B if and Sometimes we call this an augmentation for brevity. only if rankM(B ∪ S) > rank(S) and consequently we can The next three lemmas will be used extensively in our simply repeatedly divide B in half, querying if this property algorithms. The first two show that to solve matroid inter- still holds. Formally, we analyze the performance of this section approximately, it suffices to stop when the length of algorithm in Lemma 10.

1150 Algorithm 1: FindFree(M =(V,I),S ∈I,B ⊆ Algorithm 2: FindExchange(M =(V,I),S ∈ V ) I,b∈ S,A ⊆ S)

1 Input: matroid M =(V,I), independent set S ∈I, 1 Input: matroid M =(V,I), independent set S ∈I, and subset B ⊆ V element b ∈ S, and a non-empty subset A ⊆ S 2 Output: an element of B ∩ freeM(S) or ∅ if no 2 Output: a ∈ A such that (a, b) ∈ exchangeM(S) or such element exists ∅ if no such element exists 3 if rankM(B ∪ S)=rank(S) then return ∅ ; 3 if S − A + b/∈I then return: ∅ ; 4 while |B| > 1 do 4 while |A| > 1 do B B B 5 Let 1 and 2 be a partition of with 5 Let A1 and A2 be a partition of A with |B |≤ |B|/  |B |≤ |B|/  1 2 and 2 2 |A1|≤ |A|/2 and |A2|≤ |A|/2 B ∪ S > B B B 6 if rankM( 1 ) rankM( 1) then := 1 6 if S − A1 + b ∈I then A := A1 ; ; 7 else A := A2 ; 7 else B := B2 ; 8 end 8 end 9 return the unique element of A = {a} 9 return: the single element in B

b ∈ S A ⊆ S Lemma 10 (Finding Free Vertices). Given matroid M = , and a non-empty subset , the proce- M,S,b,A (V,I), independent set S ∈I, and elements B ⊆ V , the dure FindExchange( ) (Algorithm 2) outputs in O |A| ·T a ∈ A procedure FindFree(M,S,B) (Algorithm 1) outputs in (log( ) ind) time either an element such that (a, b) ∈ exchangeM(S),or∅ if no such element exists O(log(|B|) ·Trank) time either an element of B ∩ freeM(S), or ∅ if no such element exists. Proof: If S −A+b/∈Ithen of course no such a exists. Proof: Note that freeM(S) ∩ B = ∅ if and only Assume S − A + b ∈I. S ∪ B > S B B if rankM( ) rankM( ). Further, if 1 and 2 By considering S ∈I, we can add |A|−1 elements of A B S ∪ B > S partition and rankM( ) rankM( ) then either to S − A + b while preserving independence. In particular, S ∪ B > S S ∪ B > rankM( 1) rankM( ) or rankM( 2) for any partition of A into nonempty A ,A , we must S 1 2 rankM( ). Consequently, the output of the algorithm is have S − A + b ∈Ior S − A + b ∈I. This proves |B| 1 2 correct. Since the size of halves in each iteration of the correctness of FindExchange(M,S,b,A) which just the while loop and the partitions can be done arbitrarily, the repeatedly performs this. running time is also as desired. Since we halve the size of A in each iteration, there can Given an independent set S ∈I ∩I for matroids 1 2 be at most O(log |A|) iterations and the runtime follows. M =(V,I ) and M =(V,I ) and an element a ∈ S, 1 1 2 2 S ∈I ∩I FindFree gives us an efficient way to find both incoming Given an independent set 1 2 for matroids M V,I M V,I a ∈ S, and outgoing arcs of a in the exchange graph G(S). Further, 1 =( 1) and 2 =( 2) and an element it gives an efficient way to find arcs incident to s and t in the FindExchange gives us an efficient way to find both a exchange graph. We leverage this procedure for this purpose incoming and outgoing arcs of in the exchange graph. We in Section IV. will leverage this procedure for this purpose in Section V and Section VI, where we will exploit that this procedure B. Finding Exchange Vertices using Independence or Rank only requires an independence oracle. Oracle In fact, the same procedure works for the rank oracle as We show that given a matroid M =(V,I), an indepen- well since it easily implements the independence oracle: dent set S ∈I, an element b ∈ S, and A ⊆ S we can efficiently find an element a ∈ A that is exchangeable with Lemma 12 (Finding Exchange Vertices). Given ma- M V,I S ∈I b (i.e., S − a + b ∈I) or conclude that there is none. The troid =( ), independent set , element b ∈ S A ⊆ S procedure FindExchange, given in Algorithm 2, finds this , and non-empty subset , the proce- M,S,b,A element by binary search using an independence oracle. We dure FindExchange( ) (Algorithm 2) outputs in O |A| ·T a ∈ A a, b ∈ repeatedly divide the remaining elements into two halves (log( ) rank) time either such that ( ) S ∅ and figure out adding which half preserves independence. exchangeM( ),or if no such element exists. Formally, we analyze the performance of this algorithm in Proof: A set J is independent iff rank(J)=|J|, Lemma 10. so each independence oracle call can be implemented by Lemma 11 (Finding Exchange Vertices). Given a ma- exactly one rank oracle call. Our result then follows directly troid M =(V,I), independent set S ∈I, element from Lemma 11.

1151 IV. EXACT AND APPROXIMATION ALGORITHMS USING non-empty subset B ⊆ S or B ⊆ S¯ of the exchange graph, RANK ORACLE the algorithm OutArc(S, a, B) (Algorithm 3) outputs in In this section we consider the matroid intersection prob- O(log(|B|) ·Trank) time either b ∈ B such that (a, b) ∈ ES, lem in the rank oracle model. We assume throughout this or ∅ if no such element exists. section that M1 =(V,I1) and M2 =(V,I2) with def n = |V | are given by rank oracles and our goal is to provide Proof: The correctness and runtime follow almost im- both faster approximate and exact algorithms for finding a mediately from Lemma 10 which provides guarantees on FindFree, and Lemma 12 which provides guarantees on maximum cardinality set in I1 ∩I2. We split the derivation of these algorithms into three parts. FindExchange. To see the correctness, simply consider In Section IV-A we provide basic primitives for exploring the definition of the exchange graph; this algorithm directly the exchange graph with a rank oracle. Then, in Section IV-B checks for the existence of each type of edge one at a time. we provide the main subroutine for our intersection algo- rithm which efficiently computes a type of blocking flow Next, leveraging OutArc (Algorithm 3) and its analysis in the exchange graph. Finally, in Section IV-C we show in Lemma 13 we show that we can efficiently compute how to use this blocking flow subroutine to obtain our all distances from s in the exchange graph. The following desired algorithms for solving matroid intersection with a algorithm GetDistancesRank (Algorithm 4) achieves rank oracle. this goal by essentially performing breadth first search (BFS) in the exchange graph. For the sake of completeness, we A. Exploring the Exchange Graph with a Rank Oracle include the details below. Here we show how to use the algorithms FindFree (Algorithm 1) and FindExchange (Algorithm 2) of Sec- S ∈I ∩I tion III to efficiently find edges and distances in the ex- Algorithm 4: GetDistancesRank( 1 2) change graph. First, we provide the algorithm OutArc 1 Input: independent set S ∈I1 ∩I2. V (Algorithm 3) which, given any vertex a and set B of the 2 Output: d ∈ R S such that for a ∈ VS we have exchange graph, quickly finds an arc from a to B (if it da = d(s, a) the distance between s and a in G(S). exists). This algorithm simply proceeds case by case finding 3 Let da = ∞ for all a ∈ VS a s the possible arcs. If = then the arcs can be found simply 4 Let Q1 := s, Q−1 := ∅, ds =0, and B a ∈ S by looking for free vertices in .If then the arcs B1 := S\s, B−1 := S¯ can be found simply by looking for vertices that are free 5 while Q1 ∪ Q2 = ∅ do S¯ a/∈ S t ∈ B with with respect to . Similarly, if and 6 Let a ∈ Q1 be the element added to Q1 ∪ Q−1 t S a then edges to can be find just by checking if + is earliest and remove a from Q1 independent. Finally, we can use FindExchange to find 7 while b = OutArc(S, a, B−1) satisfies b = ∅ do a ∈ S¯ b ∈ S arcs from to . 8 Set db = da +1, Q−1 := Q−1 + b, B−1 := B−1 − b Algorithm 3: OutArc(S ∈I1 ∩I2, a ∈ VS, B ⊆ 9 end VS − a) 10 end 11 return: d 1 Input: independent set S ∈I1 ∩I2, vertex a ∈ VS of the exchange graph, and non-empty subset B ⊆ VS − a of the exchange graph. 2 Output: b ∈ B such that (a, b) ∈ ES,or∅ if no such element exists Lemma 14 (Finding Distances). Given independent set S ∈I∩I S 3 if a = s then return 1 2 the algorithm GetDistancesRank( ) VS (Algorithm 3) outputs in O(n log n ·Trank) time d ∈ R FindFree(M1,S,B\{s, t}) ; a ∈ VS da d s, a 4 if a ∈ S then return such that for we have = ( ) is the distance between s and a in the exchange graph G(S). FindFree(M1,S− a, B ∩ S¯) ; 5 if a ∈ S¯, t ∈ B, and S + a ∈I then return t ; 2 Proof: The procedure GetDistancesRank simply 6 if a ∈ S¯ then return computes distances from s using breadth first search. Note FindExchange(M2,S,a,B∩ S) ; that each vertex is added to Q1 or Q−1 at most once and 7 return: ∅ removed from B1 or B−1 at most once. Consequently, the cost of the procedure is simply O(n) plus the cost of O(n) calls to OutArc. So the correctness and runtime of the Lemma 13 (Finding Out Arcs Vertices). Given independent procedure follow from the analysis of OutArc given by S ∈I ∩I a ∈ V set 1 2, a vertex S of the exchange graph, and Lemma 13.

1152   B. Blocking Flow with Rank Oracle in O(n log n ·Trank) time S ∈I1 ∩I2 such that |S | > |S|  d s, t ≥ d s, t S S In this section we provide our main DFS-like subroutine and G(S )( ) G(S)( )+1,or if no such exists (i.e., S is the maximum cardinality set in I1 ∩I2). for improving an independent set S ∈I1 ∩I2. This algorithm, BlockFlow (Algorithm 5), efficiently performs Proof: We first analyze the running time. By Lemma 14, an analog of blocking flow for the exchange graph. This is in O(n ·Trank log n) the algorithm GetDistancesRank essentially a fast rank-oracle implementation of each phase d d s, a a ∈ V will ensure that a = G(S)( ) for all . Once these in Cunningham’s algorithm [1]. distances are computed the algorithm spends O(n) time to S ∈I ∩I Given a set 1 2 it first computes the dis- subdivide V into the Li. s tance from to every vertex in the exchange graph using Further, by Lemma 13 each invocation of OutArc takes GetDistancesRank. Using these distances, the algo- O(T log n) time and finds an edge from a to L if one V L L rank +1 rithm subdivides into sets i such that i has all vertices exists. Now, in every iteration of the while loop is either i s S at distance from in the exchange graph of . The algo- increased or decreased. Every time it is decreased, either it s, a ,a , ..., a ,t rithm then uses OutArc to look for a 1 2 dt−1 is by a value of 1, in which case a is removed from L and path in G(S) where each ai ∈ Li. If found, the algorithm s, a , ..., a ,t there is no path of the form 1 dt−1 where each augments along such a path removing those vertices and ai ∈ Li and a is included, or a path is found and all the S updating and looking for a new path. However, whenever vertices on the path are removed. Consequently, there are L the algorithm concludes that some vertex in a i is not on only O(n) iterations of the while loop and the total cost of such a path (i.e., a dead end), it removes it from the graph. the algorithm is as desired. By carefully searching for these paths we show that ulti-  Now we show S ∈I1 ∩I2. The reasoning in the mately this algorithm is asymptotically no more expensive preceding paragraph shows that this algorithm simply finds then GetDistancesRank itself and will always find a a s to t path through the Li if there is one, removing those I ∩I s larger set in 1 2 (if it exists) where the distance from vertices, and repeating until there are no more paths. Such t to in the exchange graph has increased. augmenting paths are of length dt by design and hence they are in fact shortest augmenting paths. This implies  Algorithm 5: BlockFlow(S ∈I1 ∩I2) S ∈I1 ∩I2 as augmenting along a shortest augmenting path preserves independence (Lemma 6). Further there must 1 Input: independent set S ∈I1 ∩I2   be at least one augmentation since GetDistancesRank 2 Output: S ∈I1 ∩I2 such that |S | > |S| and  d |S| > |S| d s, t ≥ d s, t S S computed t.So . G(S )( ) G(S)( )+1,or if no such d s, t ≥ d s, t exists. It remains to show G(S )( ) G(S)( )+1.We d 3 d := GetDistancesRank(S ∈I ∩I ) argue that there is no more augmenting path of length t 1 2 s t 4 if dt = ∞ then return S ; and consequently the distance from to must increase. To L 5 For all i ∈ [dt − 1] let Li := {a ∈ V | da = i} this end, we must prove that any elements removed from i L {t} a s can no longer be on any augmenting path of length dt. 6 Let dt = , =0, and 0 = s t 7 while ≥ 0 do By Lemma 9, distance of every vertex from and to 8 if

|S| stay on a to path of distance G(S)( ) for the original G s 16 For all i ∈ [dt − 1] let Li := Li − ai their distance from cannot increase this implies that  s t d 17 := 0 and S := S every vertex removed is not on a to path of length t. 18 end 19 end 20 return S C. Matroid Intersection with a Rank Oracle In this section we show how to use BlockFlow (Algo- rithm 5) from the previous section to obtain our desired rank Lemma 15 (Blocking Flow). Given independent set S ∈ oracle based algorithms for solving matroid intersection. All I1 ∩I2 the algorithm BlockFlow (Algorithm 5) outputs our algorithms simply apply BlockFlow repeatedly to find

1153 the desired set. First, we provide our result about exactly this section that we are given matroids M1 =(V,I1) and def solving matroid intersection with a rank oracle and then we M2 =(V,I2) with n = |V | and they can only be accessed provide our approximate result. via an independence oracle. The goal is to compute the Both of our algorithms follow the structure of Cun- largest common independent set and the following is our ningham’s [1]. The key difference is our fast subroutine main result of this section. BlockFlow for handling each phase. Theorem 18. We can find the largest common independent Theorem 16 (Exact Rank Oracle Algorithm). Given ma- set of two matroids using O(nr log r ·Tind) time. troids M =(V,I ) and M =(V,I ) there is an 1 1 2 2 The run time of this algorithm can be broken into two algorithm which finds the largest common independent set √ components. First, we show in Section V-A that given of two matroids in O(n r log n ·T ) time where r is the rank any common independent set S, we can find the distance size of the largest common independent set. of every element from s in the exchange graph G(S) S ∅ Proof: Our algorithm simply starts with 0 = in O(n log r ·Tind) time plus an “amortized” cost. This S S S S and iterates i+1 := BlockFlow( i) until k+1 = k amortized cost will turn out to be O(log r ·Tind) per element for some k at which point the algorithm outputs k.By whenever its distance increases from the sources. In our Lemma 15 we have that Si ∈I1 ∩I2 for all I and that final AugmentingPaths algorithm in Section V-C we Sk is the desired largest common independent set. Further, will exploit the fact that this increase in distance can happen Lemma 15 implies that the running time of this algorithm at most O(r) times for an element, so the overall amortized O nkT n is ( rank log ). Consequently, it only remains to bound cost over all elements is O(nr log r ·Tind). k. Second, given the distances in the exchange graph G(S), Now, Lemma 15 also implies that for all iand L = D. In this section we show how to solve matroid intersection 2) d gives correct distances of elements at distance at exactly using independence oracles. We assume throughout most from the source s.

1154 , and the remaining vertices are at distance at least Algorithm 6: GetDistancesIndep(S ∈I1 ∩ +1 +3  VS so we update L accordingly. I2,d ∈ R ) +3 S ∈I ∩I To analyze the running time of the algorithm, consider 1 Input: independent set 1 2, lower bounds a L  VS any element . Suppose it was initially in i according to d ∈ R on distances from s in G(S).  V d and is finally at distance j according to d. Observe that 2 Output: d ∈ R S such that for a ∈ VS da = d(s, a) we change the layers of this element at most (j − i)/2 is the distance between s and a in G(S).   times. In each of these changes, we spend at most one call 3 For all i ∈ [dt − 1] let Li := {a ∈ V | da = i} d ∞ a ∈ V to FindExchange. By Lemma 11 each such call takes 4 Let a = for all S O T r ( ind log ) time, which means the overall time taken by 5 Let ds =0, L0 = {s}, and =0  the algorithm is O( a∈V (1 + da − da)logr ·Tind). 6 while ≥ 0 do 7 if is odd then B. Finding One Augmenting Path L ∅ 8 if +1 = then Next, given distances d from s to every vertex in the 9 if {a ∈ V with da ≤ } = V then exchange graph using GetDistancesRank,weshowhow d t = +1 ; to find a single augmenting path in O(nTind) time. Let Di = d 10 return {a ∈ V |da = i}. 11 end The idea is to start with = dt at the sink t and perform 12 Let Q := L+1 a depth-first search. To go from to −1, i.e, given a vertex L b 13 while contains some do v ∈ D, to find an adjacent vertex in D−1, we try every a S, b, Q 14 while = FindExchange( ) possible vertex in D−1 and check if it has an edge to v. a  ∅ satisfies = do Notice that we are guaranteed to find some vertex u ∈ D−1 15 Set da = +1and Q := Q − a with edge (u, v) in G(S) because v ∈ D. By continuing 16 end this procedure, we are guaranteed to find an augmenting path 17 L := L − b of length dt. Since we reach or check each vertex at most 18 end once, the overall running time of finding this augmenting 19 L+1 := L+1 − Q and L+3 := L+3 + Q path will be O(n). 20 end 21 if is even then VS Algorithm 7: OnePath(S ∈I1 ∩I2,d ∈ R ) 22 Q L Let := +1 VS 1 Input: independent set S ∈I1 ∩I2, d ∈ R such 23 while Q contains some b do that for a ∈ VS da = d(s, a) is the distance 24 if a = FindExchange(S, b, L) between s and a in G(S). satisfies a = ∅ then Set db = +1;  2 Output: S ∈I1 ∩I2 after performing one 25 else L := L − b and +1 +1 augmentation along shortest path in G(S),orS if L := L + b ; +3 +3 no such augmentation exists. 26 Q := Q − b 3 For all i ∈ [dt − 1] let Li := {a ∈ V | da = i} 27 end 4 if dt = ∞ then return S ; 28 end 5 Let = dt and ad = t 29 = +1 t 6 while ≥ 0 do 30 end 7 Let Q := L−1 8 while Q = ∅ do 9 Let b ∈ Q Clearly the invariant implies correctness of the algorithm 10 if S − a + b ∈I2 then Set a−1 = b and d s, t when we take = G(S)( ). The invariant is true for =0 break;  from the definition of d and as we set ds =0. To prove the 11 else Q := Q − b; invariant for +1, we separately consider being even or 12 end odd. 13 = − 1 When is odd the algorithm essentially performs BFS. It 14 end s, a , ..., a ,t considers vertices in L one-by-one and check which of the 15 Augment along the path 1 dt−1 to obtain S ∈I ∩I |S| > |S| vertices in L+1 are reachable. All vertices that we can reach 1 2 with S in L+1 are definitely at distance +1 and the remaining 16 return vertices are at distance at least +3. When is even the algorithm considers every vertex in S ∈ L+1 one-by-one and check if it is reachable from L. All Lemma 20 (One Augmentation). Given independent set I ∩I d ∈ RVS a ∈ V d vertices that we can reach from L are definitely at distance 1 2 and distance such that for S, a =

1155 d(s, a) is the distance between s and a in the exchange L2k+1 we check if b has an incoming edge from L2k using graph G(S), the algorithm OnePath(S, d) (Algorithm 7) FindExchange which takes O(log r·Tind) time. Instead of   outputs S ∈I1 ∩I2 with |S | > |S| in O(n ·Tind) time by explicitly finding such an edge, we can simply check if S − performing an augmentation along a shortest path in G(S), L2k + b is independent and determine if b has distance 2k + or S if there is no such S. 1. This requires only one independence call. We presented the slightly slower implementation because it is easier to Proof: Starting with the sink vertex t, the algorithm understand. iteratively finds an element a−1 at distance −1 from s such that there is an edge (a−1,a). It tries every vertex b ∈ L−1 VI. APPROXIMATION ALGORITHM USING and check if there is an edge (b, a). We are guaranteed to INDEPENDENCE ORACLE b a s find some because is at distance from . The time In this section we consider the problem of obtaining a O |L |·T |L |≤n taken by this step is ( −1 ind). Since −1 , (1 − )-approximate common independent set in two ma- the overall time taken by the algorithm is O(n ·T ). ind troids M1 =(V,I1) and M2 =(V,I2) using independence C. The Augmenting Paths Algorithm oracles. Our main result is the following theorem. 1.5√ O n log r ·T Now we use the subroutines from the last section to Theorem 21. There is an ( 1.5 ind)-time algorithm find the largest common independent set in any two given to obtain a (1−)-approximation to the matroid intersection matroids and prove Theorem 18. The AugmentingPaths problem. algorithms alternates between GetDistancesIndep and Overview.: Our algorithm uses Cunningham’s idea of OnePath algorithms to perform augmentations. performing augmentations in phases. Let S denote the solution of the algorithm at the start of a phase. Denote Algorithm 8: AugmentingPaths(M1, M2) the exchange graph of S by G(S). Let the length of the G S Dk 1 Input: Two matroids M1 =(V,I1) and shortest path in ( ) be 2( +1). Let be the sets of M =(V,I ). elements at distance k ≤ 2( +1) from the source s. Note 2 2 O n r·T 2 Output: S ∈I1 ∩I2 of maximum size by Lemma 19, we can compute these sets in ( log ind) 3 Let S ∈I1 ∩I2 be a maximal solution greedily time. The rough idea of Cunningham’s algorithm in a phase found is to perform a maximal collection of augmentations as long V 4 Let d ∈ R S be defined by ds =0, dt =1, dv =2 as the shortest path length remains the same. Once such a for v ∈ S, and dv =1for v ∈ S. maximal collection is augmented, the distance from source 5 while 1 ≥ 0 do to sink increase by at least 2 and we move on to the next − 6 d = GetDistancesIndep(S, d) phase. Note that, by Corollary 8, one obtains a (1 )- O / 7 if dt = ∞ then S = OnePath(S, d) ; approximate solution after (1 ) phases. Thus the total O / 8 else return S; running time of the algorithm is (1 ) times the time 9 end (number of independence oracles) needed to process each phase. The rest of this section therefore focuses on how to process a phase fast. Proof of Theorem 18: Starting with a feasible solu- In each phase, Cunningham’s algorithm takes one aug- tion S, since the AugmentingPaths algorithm finds all menting path at a time. This becomes necessary for any shortest augmenting paths one-by-one, it clearly returns the “augmenting paths” style algorithm because each augmenta- optimal solution. tion might add or delete several edges in the exchange graph. Next we bound the running time. The maximal common For example, taking one augmenting path may destroy 1 independent set S ∈I1 ∩I2 can be greedily computed another disjoint augmenting path . Unfortunately, this means e S S e ∈I ∩I by adding an element to if + 1 2. This we cannot beat O(nr) since we don’t know how to do an O n ·T only takes ( ind) time. To bound the overall time taken augmentation in better than O(n) time. To overcome this by all calls to GetDistancesIndep we use Lemma 19. barrier, our main idea is to simultaneously find multiple aug- Notice that an element a’s distance da only increases during menting paths. Of course this needs care as one augmenting the execution of the algorithm. Since its final distance is at path might destroy another path. Our crucial observation most r, we get the overall time is O(nr log r ·Tind). Finally, is that the union of a sequence of consecutive shortest each call to OnePath takes O(nTind) time by Lemma 20. Since the total number of augmentations performed using 1As a concrete example, consider the maximum bipartite matching O r O nr ·T problem (which is an intersection of two partition matroids) on the OnePath is ( ), these calls take ( ind) time. graph being a path {e1,e2,...,e6} of length 6. Suppose the current matching is {e2,e5}. The corresponding exchange graph has two disjoint Remark. In fact we can achieve a slightly better runtime of {e ,e ,e } {e ,e ,e } O nr r2 r ·T augmenting paths 1 2 3 and 4 5 6 . However, if we take both (( + log ) ind) time. When computing the distances the augmenting paths simultaneously then the obtained set {e1,e3,e4,e6} from an even layer L2k to an odd layer L2k+1, for each b ∈ is not a valid matching.

1156 augmenting paths can be interpreted as “augmentation sets”. B These augmentation sets satisfy many of the properties of an +1 augmenting path. Although finding a maximal collection of I1 augmenting sets still takes quadratic time, to obtain a sub- quadratic algorithm we halt this Augmenting Sets algorithm A B early in Section VI-D and combine it with our Augmenting I2 Path algorithm from Section V. Before describing our Augmenting Sets algorithm in Section VI-C, we start by proving some basic facts about matroids and then studying the properties of augmenting sets. I A 2 B A. Facts about Matroids 2 2 I1 Fact 22. Let S be a common independent set in two matroids M1 =(V,I1) and M2 =(V,I2). Let G(S) be the S A ⊆ S b/∈ S A B exchange graph w.r.t . If there exists a set and 1 I 1 such that there is no edge of the form (a, b) ∈ E(G(S)) for 2 any a ∈ A, then S − A + b/∈I. Similarly, if there is no 1 Figure VI.1. Augmenting sets where each Ak ⊆ S and Bk ⊆ S. They edge of the form (b, a) ∈ E(G(S)) for any a ∈ A, then satisfy S − Ak + Bk+1 ∈I1 and S − Ak + Bk ∈I2. S − A + b/∈I2. Proof: Direct from the defintion of matroids. (B1,A1,B2,A2,...,A,B+1) form an augmenting collec- Fact 23. Let M =(V,I) be any matroid and let S ∈I tion of sets, or simply augmenting sets, in G(S) if the be an independent set. Let X ⊆ S and Y,Z ⊆ S¯ with following conditions are satisfied: (a) Y ∩ Z ∅ satisfy the following properties:(a) = 1) For 1 ≤ k ≤ +1,wehaveAk ⊆ D2k and Bk ⊆ 1) S + Z ∈I D2k−1. 2) S − X + Y ∈I 2) |B1| = |A1| = |B2| = ···= |B+1| = w 3) Y ∈ span(S), that is, rank(S +Y )=rank(S)=|S|. 3) S + B1 ∈I1 S B ∈I Then, S + Z − X + Y ∈I. 4) + +1 2 5) For all 1 ≤ k ≤ ,wehaveS − Ak + Bk+1 ∈I1 Proof: By submodularity of rank, 6) For all 1 ≤ k ≤ ,wehaveS − Ak + Bk ∈I2 w rank(S − X + Y + Z)+rank(S + Y ) See Figure VI.1 for an illustration. We let denote the width of Π. ≥ rank(S − X + Y )+rank(S + Y + Z). There is some redundancy in the above definition. For S Y |S| S −X Y Now, rank( + )= (given as (c)), rank( + )= instance, S + B ∈I does imply B ⊆ D , the set of |S|−|X| |Y | S Y Z ≥ 1 1 1 1 + (given as (b)), and rank( + + ) free vertices for S in I1. Nevertheless, we include this in rank(S + Z)=|S| + |Z|. Thus, rank(S − X + Y + Z)= the definition for better understanding. Observe that if each |S|−|X| |Y | |Z| + + . |Ak| was of size 1, an augmenting set corresponds to an augmenting path. Thus, the concept generalizes the concept B. Augmenting Sets of augmenting paths in the exchange graph and in the next Let S be a common independent set in I1 ∩I2. Recall subsection we prove many analogous properties. the exchange graph G(S) with respect to this common set 1) Properties of augmenting sets: Our first goal is to S, whose vertex set V (G(S)) = V ∪{s, t}. Also recall that show that given an augmenting set Π, we can do the natural Di is the set of elements of V which are at distance exactly swap operation to obtain a larger common independent set. i from the source s ∈ G(S). Next, we define the notion Theorem 25. Let Π := of augmenting sets in the graph G(S). Let 2( +1) be the (B ,A ,B ,A , ··· ,B,A,B ) be the an length of the shortest path from s to t in the augmenting 1 1 2 2 +1 augmenting set in the exchange graph G(S) whose graph. We define augmenting sets with respect to this graph shortest path length is 2( +1). Then the set G(S).  S := S ⊕ Π := S + B1 − A1 + B2 −···+ B − A + B+1 Definition 24 (Augmenting Sets). Let S ∈I1 ∩I2 is a common independent set. and G(S) be the corresponding exchange graph with  Proof: Let us prove that S ∈I1, and the proof of shortest path 2( +1). A collection of sets Π :=  S ∈I2 is analogous and omitted.

1157 The first observation is that there is no edge from a vertex Lemma 27. Let S be a common subset of I and let G(S) a ∈ A b ∈ B j>i i to a vertex j with +1. The reason is that be the corresponding exchange graph. Let X1,X2,...,Xk A ⊆ D B ⊆ D j>i j− > i i 2i and j 2j−1.If +1, then 2 1 2 +1, be disjoint subsets of S, and let Y1,Y2,...,Yk be disjoint and since the Di’s are vertices at distance exactly i, there subsets of S satisfying: (a) can’t be an edge from any vertex in D i to any vertex in 2 1) |Xi| = |Yi| for all 1 ≤ i ≤ k. D j− . 2 1 2) There is no edge from a vertex in Xi to a vertex in Yj S − B First, in the following lemma, we prove 1 is with j>i. independent in M1. 3) S − X1 + Y1 − X2 + Y2 ···−Xk + Yk ∈I. S − B S − A B − A ··· Lemma 26. The set 1 := 1 + 2 2 + + Then, each set S − Xi + Yi ∈I. B+1 ∈I1. Proof: We first prove it for k =2. Proof: Let S := S−X +Y −X +Y ∈I. Let T = S−X ∈I. A 1 1 2 2 1 For brevity, let us use k to denote the union of the sets Using the exchange property, we know there exists Q ⊆ A A ··· A B B B ··· B 1 + 2 + + k and let k+1 = 2 + 3 + + k+1. Y +Y of size |Q| = |X | = |Y |, such that S−X +Q ∈I. |A | |B | 1 2 1 1 1 Since all the sets are of equal size, we have k = k+1 . Since there is no edge from any vertex in X to any vertex S −A B ∈I 1 The lemma asks us to prove + +1 1. The in Y , using Fact 22 we know that S − X + y/∈I for any k S −A B S − 2 1 proof is by induction on . Note that 1 + 2 = y ∈ Y . Thus, Q ⊆ Y . Since |Q| = |Y |, we get Q = Y . A B ∈I 2 1 1 1 1 + 2 1 by the definition of augmenting sets. That is, S − X + Y ∈I. X S −A 1 1 Suppose we have already established := k + For the second set, we need to work a bit more. We know B ∈I S −A B ∈I k+1 1 and we wish to show k+1 + k+2 1. that S − X − X + Y ∈Iand S ∈I. Thus, there exists a S − A B ∈I 1 2 2 From definition we know that k+1 + k+2 1. So, set R ⊆ X + X such that |R| = |X | and S − X − X + Y S − A B −A I 1 2 1 1 2 := k+1 + k+2 k is also in 1. Using this Y +R ∈I.IfR = X , we are done. If R = X , then since Y B ∈I 2 1 1 definition, we want to show + k+1 1. |R| = |X |, there must exist an x ∈ X ∩ R. That is, the set |X| |S| |Y | |S|−|A | 1 2 Now, = while = k . Therefore, using T := S −X −X +Y +x ∈I. Note |T | = |S|−|X |+1. X Y 1 2 2 1 the exchange principle of matroids on and , we assert Applying the exchange property with the independent set that there exists a set S − X1, we get the existence of y ∈ T \ (S − X1) such R ⊆ Ak ∪Bk , |R| |Ak| |Bk |, Z Y R ∈I +1 +1 = = +1 s.t. := + 1 that S − X1 + y ∈I. Since X2 ⊆ (S − X1), we get that y = x. In particular, y ∈ Y2. But, as established before, If R = Bk , we are done. Therefore suppose R = Bk .In +1 +1 S − X1 + y/∈Ifor all y ∈ Y2 (since there is no edge from particular, |R ∩Bk | < |Bk |. Below we show this leads +1 +1 X1 to Y2). to a contradiction, completing the proof of the lemma. Now we handle the general case k>2 by applying the Since Z ∈I1 with |Z| = |S| and S −Ak ∈I1, we know k X X ... result for =2twice. By considering 1 = 1 + + there exists a subset Q ⊆ Z \(S −Ak) such that |Q| = |Ak| X ,X X ... X Y ,Y i 2 = i+1 + + k (and set 1 2 similarly) we and S −Ak + Q ∈I1. Staring at Z \ (S −Ak), we get that S − X Y  ∈I X X − have 1 + 1 . Finally, by considering 1 = 1 Q ⊆ R ∩Bk ∪ Bk  ( +1) +2. Xi,X = Xi we have S − Xi + Yi ∈I. G S 2 Now, we use the fact that there is no edge in ( ) from Next, we define the notion of consecutive shortest aug- a ∈A B S−A b/∈I k to k+2. Using Fact 22, we get that k + 1 menting paths. Again, each phase of Cunningham’s algo- b ∈ B Q for any k+2. That is, the set defined above cannot rithm finds such an ordered collection. intersect Bk+1 and thus must be a subset of R∩Bk+1 itself. S I ∩ Since |Q| = |Ak| = |Bk+1|,weget|R ∩Bk+1|≥|Bk+1| Definition 28. Let be a common independent set in 1 which leads to the promised contradiction. I2. Let G(S) be the exchange graph with shortest path 2(+ The theorem now follows from the above lemma. Indeed, 1). Let P =(p1,p2,...,pk) be an ordered collection of p the sets B2,B3,...,B+1, and in particular, B2+···+B+1, consective shortest augmenting paths if (a) each i is of p all lie in span(S) in M1. Otherwise, they would lie in the length 2( +1), and (b) i is a valid path in the exchange G S S set D1 (by definition of the exchange graph). Thus, S+B1 ∈ graph ( i) where i is obtained after augmenting along  p ,...,p I1, and from the following lemma S − B1 = S − (A1 + the paths 1 i−1 in that order. A + ...+ A)+(B + ···+ B ) ∈I. The theorem 2 2 +1 1 Theorem 29. Let S be a common independent set in I ∩ follows from Fact 23. 1 I . Given an ordered collection P of consecutive shortest In the remainder of the section, we want to show an 2 augmenting paths in G(S), we can find an augmenting set equivalence between the family of augmentation sets in Π of width |P|. G(S), and a collection of consecutive shortest augmenting paths in G(S). At a high-level, this equivalence allows us Proof: This follows almost immediately from to run a single phase of Cunningham in “one-shot”. The Lemma 27. Let |P| = w. Let the path p s, b(i),a(i),b(i), ··· ,b(i),a(i),b(i) ,t following lemma is the main structural fact. i := ( 1 1 2 +1 ) where

1158 (i) (i)  bk ∈ D2k−1 and ak ∈ D2k. Condition (b) holds since Π and Π were valid augmenting (1) (2) (w) Define Xk := {ak ,ak , ··· ,ak } and Yk = sets. Condition (c),(d) is proved as above (the base case was {b(1) ,b(2) , ··· ,b(w) } (c)). k+1 k+1 k+1 . Since augmenting consecutive shortest paths preserve independence, and since augmen- Finally, condition (e) and (f) follow from Lemma 27. To tations don’t introduce new shortcuts by the monotonicity see this, we need the observation that there is no edge from P Q j>i Q P i>j G lemma (Lemma 9), we see that the sets satisfy the conditions i to j for +1 and from j to i for ,in . To see this, this was true in G(S) (shortest path property). of Lemma 27 with I = I1. (1) (2) (w) And since the levels do not change, and the monotonicity Similary, for I2 we consider Xk := {ak ,ak , ··· ,ak } (1) (2) (w) lemma (Lemma 9) this continues to hold. Now Lemma 27 and Yk = {bk ,bk , ··· ,bk } instead. (with Xi’s and Yi’s properly defined) implies conditions (e) Next, we show that any augmenting set of width w and (f). can be peeled out into a sequence of consecutive shortest   Thus, Π \Π is a valid augmenting set in G = G(S)|Π. augmenting paths. We start with a few definitions.

Definition 30. Let Π := (B1,A1,B2, ··· ,B,A,B+1) Now we are armed to prove the following theorem.  be an augmenting set in G(S). Let S = S ⊕ Π be as Theorem 34. Let S ∈I1 ∩I2 and G(S) be the exchange defined in Theorem 25. We denote the exchange graph of graph. Let Π be an augmenting set of width w. Then there G S G S | ( ) as ( ) Π. exists an ordered collection P of w consecutive shortest Definition 31. Let S be a common independent set and augmenting paths. G(S) be the exchange graph with shortest path 2( + Proof: We first show there is one shortest augmenting B ,A ,B , ··· ,B ,A ,B  1). Let Π =( 1 1 2 +1) and Π = path hitting every set of Π exactly once. We augment on it B , A , B , ··· , B , A , B ( 1 1 2 +1) be two augmeting sets in and apply Theorem 33. G S  B ⊆ B A ⊆ A ( ). We say Π contains Π if k k and k k, Let Π =(B1,A1,B2,...,B,A,B+1). We claim there k ⊆  for all . We use the notation Π Π to denote this. is a path p =(b1,a1,b2,...,b,a,b+1) such that bk ∈ Ak and ak ∈ Ak. Indeed, to prove this it suffice to show that Definition 32. Let S be a common independent set and (i) G(S) be the exchange graph with shortest path 2( +1).  1) for k =1,...,, for any b ∈ Bk, there is an edge Let Π ⊆ Π be two augmenting sets, the former contained  (b, a) ∈ G(S) to some a ∈ Ak in the latter. Then we use Π \ Π to denote the sequence    2) for k =1,...,, for any a ∈ Ak, there is an edge (B1 \ B1, A1 \ A1, ··· , B+1 \ B+1). (a, b) ∈ G(S) to some b ∈ Bk+1. ⊆  G S Theorem 33. Let Π Π be two augmenting sets in ( ). For (i), notice that S − Ak + Bk ∈I2 (condition (f) of  \ G S | Then, Π Π is an augmenting set in ( ) Π. augmenting set), and so S −Ak +b ∈I2. The contrapositive b P A \ A Q B \ B of Fact 22 implies there must be an edge from to some Proof: Let k := k k and let k = k k. Let A S S B − A B − A ··· B vertex in k. = + 1 1 + 2 2 + + +1. Note that this S−A B ∈I S ⊕ G G S G S | For (ii) notice that since k+ k+1 1 (condition (e) is Π. For brevity, let := ( )= ( ) Π. Let the a ∈ A S −a G D ,D ,... of augmenting set), for any k,wehaverank1( + layers of be denoted as 1 2 . Furthermore, since B ≥ S−A B |S| |A | |B |  k+1) rank1( k + k+1)= since k = k+1 . Π is an augmenting set, we get that Since rank1(S − a)=|S|−1, by exchange property of  matroids there must exist b ∈ Bk+1 such that S −a+b ∈I1. S + Q1 − P1 + Q2 + ···+ Q+1 ∈I1 ∩I2 That is, (a, b) ∈ G(S). as well. To complete the proof of the theorem, we observe that P ⊆ D augmenting paths are width-1 augmenting sets. We apply Using the above, we can show that each k 2k and Q ⊆ D S Q ∈I Theorem 33 to get w consecutive paths. k 2k−1. For instance, we can show + 1 1  For our algorithms we will not be interested in finding ar- (which would put Q1 ⊆ D k− ). To see this, let P := P1 + 2 1 bitrary augmenting sets, but in finding maximal augmenting ···+ P+1 and Q = Q2 + ···+ Q+1. Note, |P| = |Q| and S Q −P Q∈I Q∩D ∅ sets. + 1 + 1. Now observe 1 = ; this follows from Cunningham’s monotonicity lemma (Lemma 9). Thus, Definition 35 (Maximal Augmenting Sets). Let S ∈I1 ∩ Q∈ S S Q −P Q span1( ). Thus, the independence of + 1 + I2 and let G(S) be the corresponding exchange graph with 2 S Q ∈I implies + 1 1. For the general case one proceeds shortest augmenting path of length 2(+1). An augmenting inductively. This proves condition (a) of the augmenting set set Π is called maximal if there exists no other augmenting  definition. set Π containing Π. S ∈I∩I G S 2|S| + |Q1| = rank1(S + Q1 −P+ Q) ≤ rank1(S + Q1 + Q) ≤ Theorem 36. Let 1 2 and let ( ) be the rank1(S + Q1) corresponding exchange graph with shortest augmenting

1159     path of length 2( +1). Let Π be a maximal augmenting B+1, A, ··· , Bk+1. Now, since S − Ak + Bk+1 ⊆ S − set. Then there is no augmenting path of length 2( +1) in Ak + Bk+1, and since the latter lies in I1 (property (e) of G S |  ( ) Π . partial augmenting sets), we have S − Ak + Bk+1 ∈I1.We S − A B ∈I Proof: This is a corollary of Theorem 29 and The- also have k + k 1. Therefore, by the exchange A |A | |B | w orem 34. Let P be the collection of paths obtained by property, we can find a set k of size k = k+1 = A ⊆ A ⊆ A S − A B ∈I invoking Theorem 34 on Π. If there is another shortest such that k k k and k + k+1 1. The O |A | augmenting path p ∈ G(S)|Π, then (P,p) is an ordered time taken to do so is ( k ) independence-query oracles. B , A , ··· , A collection of consecutive shortest augmenting paths in G(S). Now, suppose we have constructed +1 k  A ⊆ A Thus Theorem 29 invoked on this returns Π which contains with the desired property. Then since k k and S − A B S S − A Π. rank2( k + k)=rank2( ), we get rank2( k + B ≥ S S − A B ∈I The above lemma shows that a single phase of Cunning- k) rank2( ). Also, since k + k 2, we get S − A B ∈I B ham’s algorithm corresponds to finding maximal augmenting k + k 2 as well. Thus, we can select a subset k B ⊆ B ⊆ B S − A B ∈I sets. This is what we do in Section VI-C, but we need one such that k k k and k + k 2 and has   more concept before: partial augmenting sets. size |S|. That is, |Bk| = |Ak| = w. The time taken to find 2) Partial Augmenting Sets: In order to find maximal this is O(|Bk|) independence oracle queries. augmenting sets, our algorithm will go via objects which are The total running time is k O(|Ak| + |Bk|) many not augmenting sets at all. These are what we call partial independence oracle calls which is O(n ·Tind)-time. augmenting sets, and the final algorithm will work work by Now we are ready to prove a key property which relates incrementally finding better partial augmenting sets, from the width of any two maximal augmenting sets. This will be which augmenting sets can be extracted. crucial to give the subquadratic approximation algorithm in Section VI-D. Definition 37 (Partial Augmenting Sets). Let S ∈I1 ∩ S ∈I ∩I G S I2 and G(S) be the corresponding exchange graph with Lemma 39. Let 1 2 and ( ) be the corresponding shortest path 2( +1). A collection of sets Φ := graph with shortest augmenting path of length 2( +1). Let  w (B1,A1,B2,A2,...,A,B+1) form a partial augmenting Π and Π be two maximal augmenting sets of width and set if the following conditions are satisfied. w. Then, w ≤ (2 +4)w. (a)  Proof: Let Π =(B ,A ,B ,...,A,B ). Let Π = ≤ k ≤ A ⊆ D B ⊆ 1 1 2 +1 1) For 1 +1,wehave k 2k and k (Q ,P ,Q ,...,P,Q ). Note |Ak| = |Bj| = w and D 1 1 2 +1 2k−1. |Pk| = |Qj| = w. For the sake of contradiction, assume |B |≥|A |≥|B |≥···≥|B | 2) 1 1 2 +1 . w> (2 +4)w. S B ∈I 3) + 1 1 We construct partial augmenting sets Φ = 4) S + B+1 ∈I2 B ,A , ··· ,A ,B A ⊆ A ⊆ A P ( 1 1 +1) such that (i) k k k + k, 5) For all 1 ≤ k ≤ ,wehaveS − Ak + Bk ∈I .   +1 1 (ii) Bk ⊆ Bk ⊆ Bk + Qk, (iii) |Ak| > (2 +3− 2k) ·|Ak|, 6) For all 1 ≤ k ≤ ,wehaverank (S − Ak + Bk)=   2 and (iv) |Bk| > (2+4−2k)·|Bk|, and (v) |B | > |B+1|. rank (S). +1 2 Note that the last point would imply B+1 is a strict subset B ⊆ of +1. From Lemma 38, we would get an augmenting set As in Definition 31, we say Φ Π if each “coordinate”  of Φ is a subset of the corresponding “coordinate” of Π. Π which would contain Π, contradicting the maximality The following lemma gives an efficient algorithm to convert of the latter. any partial augmenting set Φ into a true augmenting set  Now we describe the construction of Φ. Π. For now, the reader should consider Π to be a string of B B To construct 1, we start with 1 and keep adding elements empty sets; we will invoke this lemma later with non-empty Q S B ∈I  of 1 to it maintaining + 1 1. By the matroid Π. exchange property, we will add |Q1 \ B1| such elements |B | |Q | w> w Lemma 38. Given a partial augmenting set giving 1 = 1 = (2 +4) . We satisfy (i), (iv), Φ =(B1,A1,B2, ··· ,B,A,B+1) that contains and property (c) of the partial augmenting set.     B ,A ,B , ..., B an augmenting set Π =(B ,A ,...,B ),in Suppose we have constructed 1 1 2 k as de- 1 1  A S −Ak Bk ∈I O(n ·Tind)-time we can find an augmenting set sired. We need to construct k. Since + 2,we        S − P A B ∈I S −P Q ∈ B , A , B , ··· , B, A, B such that get ( k + k)+ k 2. We also have k + k Π =( 1 1 2 +1)   I2.AsBk ⊆ Bk +Qk, we get that S −Pk +(Bk\Bk) ∈I2. (a)    By the exchange property, there must exist a Z ⊆ Bk \ Bk 1) Π ⊆ Π ⊆ Φ, and  such that S − (Pk + Ak)+Bk + Z ∈I2 and 2) B+1 = B+1.    |Bk + Z| = |Bk\Bk|≥|Bk|−|Bk| Proof: We work backwards from B+1 = B+1. > − k |B |−|B | − k w Let w = |B+1|. Suppose we have constructed sets (2 +4 2 ) k k =(2 +3 2 )

1160 where the inequality follows from (iv) above (which we consideration. It is easy to verify that a total of |Bk|−|Ak| assume we have maintained so far). Now since S − Ak + elements are matched or become useless.   Bk ∈I2, there is some Ak of size |Bk +Z| s.t. Ak ⊆ Ak ⊆ A similar operation exists for extending the matching  B A Ak +Pk+1 and rank2(S −Ak +Bk +Z)=rank2(S). Thus, between k and k+1. By repeating these operations we property (d) of the partial augmenting set is satisfied, and will eventually find a maximal collection of disjoint shortest so is property (iii). augmenting paths. Our treatment of this similar scenario B ,A ,B , ..., A Now, suppose we have constructed 1 1 2 k as forms the basis of the augmenting sets algorithm given B S−P Q ∈I desired. We need to construct k+1.As k + k+1 1, below.  there must exist some Z ⊆ Qk for which S − Ak + Z ∈I1 2) The Detailed Algorithm: In this section we describe 2 and a (slow) O(n ·Tind)-time algorithm to find a maximal |Z| |A ∩ P |≥|A |−|A | augmenting set. It is an iterative algorithm which finds “bet- = k k k k ter” partial augmenting sets in each iteration. The algorithm > − k |A |−|A | − k w. (2 +3 2 ) k k =(2 +2 2 ) assumes access to the layers Dk’s of the current exchange  graph G(S) which has shortest path length 2( +1). Now consider S −Ak +Bk+1 which is independent since A ⊆ A B |Z| B ⊆ We maintain three types of elements in each layer : k k. We can then find k+1 of size s.t. k+1    selected elements denoted as Ak,Bk, removed elements B ⊆ Bk + Z and S − A + B ∈I. Note that k+1 +1 k k+1 1 R F A ⊆ property (iv) is satisfied for |B |. And the above satisfies denoted as k, and fresh k. The selected elements k k+1 D ,B ⊆ D property (e) of the partial augmenting sets. 2k k 2k−1 form a partial augmenting set, and Finally, we need to satisfy condition (c), that is, S + our algorithm incrementally finds better and better partial B B ∈I B ⊆ augmenting sets with larger +1. The removed elements +1 2. After the above procedure, we do get +1 B ⊆ B Q Rk ⊆ Dk are deemed to be useless for finding better partial +1 +1 + +1 satisfying every property except |B | > − w w augmenting sets. Finally, fresh elements Fk ⊆ Dk are those perhaps this one. Also, +1 (2 +4 2( +1)) =2 . S Q ∈I B \B ∈I that are neither selected nor removed. The type of an element Now, since + +1 2, we know that +1 +1 2. B can change from fresh to selected and from selected to Thus, we keep deleting items from +1 such that we get  removed but never the other way. S+B ∈I . We will delete at most |B | = w elements. +1 2 +1 B S The final B will satisfy condition (c) and |B | >w, Initially, 1 is a maximal subset of that can be added +1 +1 S I F that is, property (v). This completes the proof. to while being independent in 1. Subsequently, 1 = D1\B1 and R1 = ∅.For2 ≤ k ≤ 2 +1, we initialize C. The Augmenting Sets Algorithm sets Ak,Bk,Rk = ∅ and Fk = Dk. For convenience we set A R F D ∅ A R F 1) An Analogy and High level idea: Before presenting 0 = 0 = 0 = 0 = and l+1 = 2l+2 = 2l+2 = D ∅ our augmenting sets algorithm, we provide an analogy to 2l+2 = . finding a maximal collection of disjoint shortest augmenting We maintain the following invariants. It is easy to verify paths. Recall that the Hopcroft-Karp idea is inapplicable that the initial conditions satisfy them. because augmenting such a collection do not necessarily (a) preserve independence. However, let us pretend for the 1) For 1 ≤ k ≤ ,wehave S − Ak + Bk+1 ∈I1. moment that this was indeed our task. Our algorithm in the 2) rank2(S − Ak + Bk)=rank2(S). next section is in fact inspired by this. Equivalently, ∃B ⊆ Bk of size |B| = |Ak| for which Suppose that we have constructed internally disjoint par- S − Ak + B ∈I2. tial augmenting paths from the source. Our goal is to extend 3) For 1 ≤ k ≤ , for any X ⊆ Bk+1+F2k+1 = D2k+1− R S− A R X ∈I S−A X ∈ them all the way to the sink. Let Ak ⊆ D2k be the sets of 2k+1,if ( k + 2k)+ 1 then k + I vertices on the current augmenting sets in D2k. Define Bk 1. R ∈ S − D − R B similarly. We then have |B1|≥|A1|≥... ≥|B+1|. 4) 2k−1 span2( ( 2k 2k)+ k) Let us focus on Ak and Bk+1. Because they represent Invariants (a) and (b) ensure that the selected sets Φ := the vertices on partial augmenting paths, currently we have (B1,A1,B2, ··· ,A,B+1) form a partial augmenting set. a matching between a subset of Ak and Bk+1. A natural idea Invariant (c) essentially says that if R2k+1 is “useless” (note is then to match more vertices of D2k+1 with the unmatched X ∩R2k+1 is empty), so is R2k. On the other hand, Invariant vertices of Ak. Let B ⊆ D2k+1 be such a maximal subset, (d) says that if R2k is “useless”, so is R2k−1. Invariants (c) and A ⊆ Ak be the vertices that are still not matched. Such a and (d) are important for certifying that removed elements maximal set requires only O(|D2k+1|) independence oracle do not need be considered at all (see Lemma 44). calls. We are ready to present Refine, which consists of a The crucial observation is that all of A’s outgoing edges series of operations on the pairs (Ak,Bk+1) and (Bk,Ak) go to Bk +B as B is maximal. However, Bk +B is already inspired by the matching analogy given in Section VI-C1. fully matched; so A is essentially useless as its vertices For (Ak,Bk+1), we extend Bk+1 as much as possible while would never get matched and can be removed from future respecting Invariant (a) (Lines 1-2 of Refine1(k)). We

1161 A old old then identify the “matched” vertices in k and remove the Lemma 41 (Properties of Refine1). Let Ak ,Bk be k +1 ones still not matched (Lines 3-4 of Refine1( )). the sets (Ak,Bk+1) before Refine1(k) is called. After the Similarly, for (Bk,Ak), we find a maximal subset of Bk call, all four invariants are preserved. Moreover, for k ≥ 1 a |Aold|−|Bold | that can be “matched” and remove the rest (lines 1-2 of total of k k+1 elements which were formerly fresh Refine2(k)). We then find the “endpoints” in Ak that are are now selected, or formerly selected but now removed. “matched” to Bk (lines 3-4 of Refine2(k)). Proof: After running Refine1(k),wehave|Ak| = |B | |B |−|Bold | k+1 by Lemma 40. Also note that k+1 k+1 Algorithm 9: Refine1(k) old elements are selected and |Ak |−|Ak| are removed. Thus |Aold|−|Bold| 1 Find maximal B ⊆ F2k−1 s.t. a total of k k elements change status. S − Ak + Bk+1 + B ∈I1 Invariant (a) is true by design. 2 Bk+1 ←− Bk+1 + B,F2k−1 ←− F2k−1 − B Invariant (b) remains true because Bk is unchanged and 3 Find maximal A ⊆ Ak s.t. S − Ak + Bk+1 + A ∈I1 Ak only loses elements. A ←− A − A, R ←− R A 4 k k 2k 2k + Invariant (d) remains true because R2k is only increased, and thus its span can only become bigger. A R Aold Rold For Invariant (c), first notice k + 2k = k + 2k . Since the invariant held before run, we know for any X ⊆ k D − R S − Aold Rold X ∈I S − Algorithm 10: Refine2( ) 2k+1 2k+1,if ( k + 2k )+ 1, then Aold X ∈I S − A R Rold X ∈I 1 Find maximal B ⊆ Bk s.t. k + 1. That is, ( k + 2k)+ 2k + 1. S − Aold A X ∈I S − (D2k − R2k)+B ∈I2 Our goal is to show that k + + 1. S − Aold A B ∈I A¯ ⊆ A 2 R k− ←− R k− + Bk\B,Bk ←− B Since k + + k+1 1, we can find 2 1 2 1 old B¯ ⊆ Bk \X S − A A¯ X B¯ ∈I 3 Find maximal A ⊆ F2k s.t. and +1 s.t. k + + + 1 and |A¯| |B¯| |A| |Bk |−|X| A¯  A |B¯| > S − (D2k − R2k)+Bk + A ∈I2 + = + +1 .Nowif = then |Bk |−|X| X B¯ ⊆ D k − R k 4 Ak ←− Ak + F2k\A, F2k ←− A +1 and hence + 2 +1 2 +1 has size bigger than |Bk+1|. But this contradicts the fact that Bk+1 ⊆ old D2k+1 −R2k+1 is maximally independent in S −Ak . Thus old we must have A¯ = A and S − Ak + A + X ∈I1. Algorithm 11: Refine old old Lemma 42 (Properties of Refine2). Let Ak ,Bk be k , , ··· ,l 1 for =0 1 do the (Ak,Bk) before call to Refine2(k). After the call, all 2 Refine1(k) four invariants are preserved. Moreover, for k ≤ a total of k old old 3 Refine2( ) |Bk |−|Ak | elements which were formerly fresh but are 4 end now selected, or were formerly selected but now removed. 5 Refine1(0) Proof: After running Refine2(k),wehave|Ak| = old |Bk| by Lemma 40. Also note that |Bk |−|Bk| elements old old It is somewhat strange that Refine ends with removed and |Ak|−|Ak | selected for a total of |Bk |− old Refine1(0) which is indeed redundant. However it makes |Ak | elements changing status. the analysis of the combined algorithm in the next subsection Invariants (a) and (c) remain true because Ak−1 is un- less cumbersome (specifically Lemma 47). changed and Bk only loses elements. For Invariant (b), ob- The next three lemmas study properties of Refine1 serve that Refine2 simply finds a maximally independent S − D −R Bold F old S −Aold Bold and Refine2 which will be crucial for analyzing the subset of ( 2k 2k)+ k + 2k = k + k performance of our main subroutine Refine. so rank2(S − Ak + Bk) remains unchanged. Invariant (d) remains true essentially by design. Refine2 Lemma 40. After Refine1(k) is run, we have |Ak| = old finds a base of S − (D2k − R2k)+Bk and moves any of |Bk+1|. After Refine2(k) is run, we have |Bk| = |Ak|. element not in the base into R2k−1. Those elements are in Proof: We prove the first statement; the second state- the span by definition. Aold Bold k ment’s proof is analogous. Let k and k+1 be the sets Now by summing over all in the last two lemmas, we before Refine1(k) is called. In Line 2, we set Bk+1.At get the following corollary. old this point, let T := S − Ak + Bk+1; we know T ∈I2. old Corollary 43. After applying Refine, at least a total of We also know rank1(T + Ak )=rank1(S + Bk+1)= old old |B |−|B | elements are formerly fresh but now selected |S| since Bk is in the span of S. This implies, the 1 +1 +1 or formerly selected but now removed. maximal set A added in Line 4 leads to Ak such that S − A B |S| |A | |B | rank1( k + k+1)= , implying k = k+1 . Proof: This essentially follows from the last two lem- mas. Readers may notice that the sum does not exactly

1162 telescope because at the time Refine2(k) is applied, Bk by ≥ 2. In each phase, we use Refine till we find the has been modified by Refine1(k). However this is okay maximal augmenting set as given by Lemma VI-C. Since as Refine1(k) only adds elements to the old Bk. Same for each element can change its type at most twice, we know Refine2(k) which only adds elements to Ak+1 and can that we need only O(n) runs of Refine in each phase. only help Refine1(k +1). By Lemma 45, Refine makes O(n) independence oracle Using the properties established above, we show how calls. Thus, each phase takes O(n2) independence oracles. Refine can be repeatedly used to find maximal augmenting Finally, to get an (1 − )-approximation, we need only sets. O(1/) phases, and thus the total time of this algorithm is a (not too impressive) O(n2/ ·T )-time. We improve Lemma 44. Suppose we run Refine until no more ele- ind this with a hybrid approach in the next section. ment changes its type. At this point, the collection Π = (B1,A1,B2,A2, ··· ,A,B+1) is a maximal augmenting set. D. Going Subquadratic by Combining Augmenting Sets and Augmenting Paths Proof: For the sake of contradiction, assume there exists  Π containing Π. Then by Theorem 33 and Theorem 34, We obtain a faster algorithm by exploiting Lemma 39. p there is a sequence of shortest augmenting paths in G(S)|Π. The algorithm is parametrized by an which we set Taking the first path in the sequence, we have a shortest in the end. The algorithm runs in phases. At the beginning path (b ,a ,b ,a ,...,a,b ) in G(S)|Π. In particular, of a phase , the algorithm first invokes Algorithm 4 to 1 1 2 2 +1 D ,D , ..., D O n r ·T ak ∈/ Ak and bk ∈/ Bk for any k. get the layers 1 2 2+1 in ( log ind) time S We claim that all ak,bk must have been removed by (Lemma 19). Throughout a phase if is the current solu- Refine. This would be a contradiction because an element tion, then the exchange graph G(S) has shortest augmenting D S B path length 2( +1). After a phase, the shortest augmenting in 2+1 is removed only if it is in span2( + +1). But b D G G S | path length is ≥ 2( +3). We run for O(1/) phases. in that case +1 would not be in 2+1 of = ( ) Π. We prove this claim by induction. In phase , for ≤ O(1/), we run the following routine. First, notice b1 cannot be fresh. Otherwise b1 would have been selected by Refine since S + B + b ∈I.Sob 1 1 1 Algorithm 12: Hybrid(p) must have been removed by Refine. Now we have two |B |−|B |≤p cases. 1 Run Refine until 1 +1 . Initially, the LHS can be as large as n. Suppose b1,a1, ..., bk have been removed. We need to 2 Given the partial augmenting set Φ at this point, show ak is removed. Suppose not, and suppose ak ∈ F2k. Since S − (Ak + ak)+Bk + bk ∈I, S − (D k − find an augmenting set 2 2 B ,A , ··· ,B ⊆ R k Bk bk ∈I Π =( 1 1 +1) Φ satisfying 2 )+ + 2. But this is a contradiction as  B = B . This is done using the algorithm bk ∈ R2k−1 ⊆ span(S − D2k + R2k + Bk). +1 +1 described in Lemma 38. Now, suppose b1,a1, ..., ak have been removed. We need 3 Find augmenting paths in G(S)|Π as in Section V to show bk+1 is removed. Suppose not, and suppose bk+1 ∈ till the shortest path length changes. F2k+1. Then X = Bk+1 + bk+1 ⊆ Bk+1 + F2k+1. Since S−Ak −ak +X ∈I1 and ak ∈ R2k, S−Ak −R2k +X ∈I1. Invariant (c) then implies S − Ak + X ∈I1, which is a |X| |A | X ∈ S To analyze the running time of the hybrid algorithm, we contradiction since = k +1 and span1( ) k > go through the following steps. First, we show (Lemma 46) (because +1 1). Line 1 takes O(n2/p)-independence oracle calls. This is Lemma 45. Refine1(k) makes O(|D2k| + |D2k+1|) in- similar to the argument in the last paragraph of the previous dependence oracle calls. Refine2(k) makes O(|D k| + section. Second, we show (Lemma 47) that Π found in 2  |D2k−1|) independence oracle calls. Refine takes O(n · Line 2 is contained in a maximal augmenting set Π of width T )-time. ≤|B1|. Note that the width of Π is |B+1|. Thus, the width ind  of Π \ Π in G(S)|Π is ≤|B |−|B |≤p (because Proof: Adding maximal L ⊆ M to an independent 1 +1 of Line 1). Lemma 39 then implies any augmenting set in set N s.t. N + L is still independent requires only adding G(S)|Π is of size ≤ (2+4)p. Which means, in Line 3 we elements of L one at a time. This establishes the run- need to make at most these many augmentations. Since each time of Refine1 and Refine2.NowRefine takes O˜ n O |D | |D | O |D | |D | O n augmentation takes ( ) independence oracle calls,√ Line 3 k ( 2k + 2k+1 )+ ( 2k + 2k−1 )= ( ) time will run in time O˜(np ·Tind). By selecting p ≈ n, we get since n ≥ k |Dk|. 2 the desired result. At this point, we can get an O(n /·Tind)-time algorithm. The algorithm runs in phases; in each phase the shortest Lemma 46. Line 1 of the Hybrid algorithm takes O(n2/p · augmenting path length of the exchange graph goes up Tind)-time.

1163 Proof: By Corollary 43, each call to Refine before Now, from Theorem 29, we have a maximal augmenting ∗ ∗ Line 1 terminates changes the type of at least |B1|− set Π in G(S)|Π with width(Π )=|P|. From Lemma 39, ∗  |B+1| >pelements. Since there are n elements and their we know width(Π ) ≤ (2 +4)· width(Π \ Π). Thus, type can change only twice, Refine can only be run for |P| ≤ (2 +4)· (|B1|−|B+1|) ≤ (2 +4)p. This proves O(n/p) times. By Lemma 45, each run of Refine makes the theorem. O(n) independence oracle calls. The lemma follows. We now have everything we need to prove our main theorem.  Lemma 47. Let Φ =(B ,A ,B ,...,B ) be the partial 1 1 2 +1 Proof of Theorem 21: Set p = n/ log r, and augmenting sets obtained by running Refine for some run the Hybrid algorithm until the shortest augmenting path number of times. Let Π ⊆ Φ be an augmenting set. Then,  length in G(S) ≥ 1/. This requires at most O(1/) phases. there is a maximal augmenting set Π containing Π and  Moreover, when applying Lemma 19 we discard a vertex a the width of Π is at most |B |. 1 as soon as its distance (lower bound) is greater than 1/. This Proof: Given Π, we show a way of applying Refine is okay as distances are monotonic (Lemma 9) so any such to get a maximal augmenting set as in Lemma 44, such that vertex will not belong to any (future) shortest augmenting / no element in Π is removed. Since B1 was a maximal (this paths (or augmenting sets) which have length at most 1 . is why we run Refine1(0) in the end) set of elements that First we account for the total amortized cost arising from end start can be added while preserving independence, the maximal O( a∈V (da −da )logr·Tind). By the above modification dend ≤ / O 1 n r ·T augmenting set found can’t have width more than |B1|. This a 1 so they sum to at most ( log ind) which will prove the lemma. is dominated by our desired runtime. We now show how Refine1 and Refine2 can be At the beginning of each phase we take O(n log r ·Tind) implemented without removing any elements from Π. Let time to construct the layers. Each phase, from the above B ,A ,...,A ,B O n2/p np r Π =( 1 1 +1). Theorem, takes ( + log ) independence oracle Refine1(k) finds a maximal A ⊆ Ak s.t. S − Ak + calls. Thus the total time to run phase is O((n log r + B A ∈I S − A B ∈I A n2/p np r ·T O n2/p np r ·T k+1 + 1. Since k + k+1 1, can be + log ) ind)= (( + log ) ind)  chosen so that A ∩ Ak = ∅ and consequently no element of time. After all the phases are done, we are left with  S ∈I∩I Ak is removed. a set 1 2 such that the shortest augmenting Refine2(k) finds a maximally independent subset of path length in G(S) ≥ 1/. This implies that S is an − S−D k +R k +Bk +F k = S−Ak +Bk by adding elements (1 )-approximate solution by Corollary 8. The total 2 2 2 2 B S − D R ⊆ S − A ⊆ S − A 1 n 1 of k first. Since 2k + 2k k k and running time is O · p + np log r ·Tind . Since p = S − A B ∈I B B ⊆ B  k + k 2, can be chosen so that k and n/ r  log , we prove the theorem. consequently no element of Bk is removed. This finishes the proof of the lemma. VII. APPROXIMATELY OPTIMAL FRACTIONAL We now bound the running time of our algorithm. SOLUTION VIA FRANK-WOLFE P , P O n2/p np r ·T Let M1 M2 be the matroid polytopes for matroids Theorem 48. Phase runs in (( + log ) ind) end start M1 =(V,I1) and M2 =(V,I2) respectively. Let r be time plus the amortized cost O( a∈V (da − da )logr · end start the size of their largest common independent set. It is well- Tind), where da and da are the distances of a at the end and start of the phase respectively. known that the matroid intersection polytope is precisely ∩P P ∩P PM1 M2 , i.e., M1 M2 is the convex hull of Proof: From Lemma 46, we get that Line 1 of the (the indicator vectors of) the common independent sets. 2  hybrid algorithm takes O(n /p ·Tind) time. Let Π be the Matroid intersection problem can therefore be solved via maximal augmenting set containing Π as in Lemma 47. the following convex program: O n Line 2, from Lemma 38 makes ( ) independence oracle max 1 x. calls. x∈P ∩P  M1 M2 The width of Π \ Π is bounded by |B1|−|B+1|≤p. G S | P In this section, we apply (a variant of) Frank-Wolfe to Now, consider ( ) Π and let be the largest ordered − collection of consecutive shortest augmenting paths. To find solve this problem faster: Theorem50 obtain a (1 )- optimal fractional solution z (i.e., i∈V zi ≥ (1 − ) · r) an augmenting path, we invoke Lemmas 19 and 20. Recall 2 2 O d − in O(n /(r ) ·Tindep) time. To obtain an integral solution, that Lemma 19 updates distances in ( a∈V (1 + a ∗  we show in the next section that upon sampling via x the da)logr·Tind) time and, given distances, Lemma 20 finds an  size of the ground set can be reduced to O˜(r/2). With augmenting path in O(n·Tind) time. Since da−da telescopes, in Line 3 computing P takes time this sparser new ground set we can speed up many matroid intersection algorithms. For instance, combining this with  . . end start O˜ n1 5/1 5 O( (da − da )logr ·Tind)+O(n|P| log r ·Tind). our previous ( ) time algorithm would improve 2 2 a∈V the runtime in the regime r/ ≤ n ≤ r .

1164 To find an approximate fractional solution efficiently, we can find some x(k),y(k) such that relax the intersection constraint to C η f x(k),y(k) ≤ f x, y 2 f . 2 ( ) min ( )+ max 1 x − x − y , (VII.1) (x,y)∈K k x∈P ,y∈P +2 M1 M2 2 C η We bound f as follows: where is some parameter to be chosen later. This transfor-  mation is useful as it allows us to solve two disjoint greedy 2 Cf =sup f(u + γ(v − u)) problems in an iteration of Frank-Wolfe. Our algorithm u,v∈K,γ∈ , γ2 [0 1]  relies on the following theorem for constrained convex − f u −∇f u ,γ v − u  optimization. ( ) ( ) ( ) η γ v − u 2 Theorem 49 (Frank-Wolfe Algorithm [34, Theorem 1]). =sup ( ) 2 u,v∈K,γ∈ , γ2 Given a convex set K ⊂ Rn and a convex function f defined [0 1] K ≤ sup ηv − u1 on , suppose that: u,v∈K n • For any vector c ∈ R , we can find zc ∈ ≤ ηr, 8 argmaxz∈K c z in time TK .   n n • For any vector z ∈ R , we can compute ∇f(z) in time where we used K ⊂ [0, 1] and i ui + i vi ≤ 2r ≤ 4r. Tf . By considering the largest common independent set as a f x, y ≤−r • There is a constant Cf such that for any u, v ∈ K and solution, we know min(x,y)∈K ( ) . Hence, from any γ ∈ [0, 1], we have the guarantee of Frank-Wolfe, we get 2 η ηr γ Cf − x(k) x(k) − y(k)2 ≤−r 16 . f(u + γ(v − u)) ≤ f(u)+∇f(u),γ(v − u) + . 1 + 2 + 2 2 k +2 In k iterations, we can find a z ∈ K such that To get a valid fractional solution, we define the vector z z {x(k),y(k)} x(k) ∈P y(k) ∈P by i =min i i . Since M1 , M2 ,  2Cf f(z) ≤ min f(z )+ . we have that z ∈PM ∩PM . Now, we bound the size of z∈K k +2 1 2 z: Each iteration takes O(n + TK + Tf ). (k) (k) (k) 1 z ≥ 1 x −x − y 1 For problem (VII.1), we note that to optimize linear √ ≥ x(k) − n ·x(k) − y(k) x y {x ∈P ,y ∈P } 1 2 functions of and over M1 M2 we only η n ≥ x(k) − x(k) − y(k)2 − need the standard greedy method, which can be implemented 1 2 n 2 2η using independence oracle calls. We use this fact to prove ηr n the following main theorem of this section. ≥ r − 16 − . k +2 2η Theorem 50. Given two matroids M1, M2 via indepen- n n(k+2) dence oracles, we can find a z ∈PM ∩PM in O( 2 ) η  1 2 r Picking = 32r ,wehave iterations such that i∈V zi ≥ (1 − )r, where r is the size of the largest common independent set and each iteration 32nr 1 z ≥ r − . takes O(n ·Tind) time. k +2 Proof: Ideally, we want to apply Frank-Wolfe directly Therefore, to get a fractional solution with an additive error r k 32 n on the problem of , we can set = 2 r . Finally, each iteration involves optimizing a linear func- η max 1 x − x − y2 K x∈P ,y∈P 2 tion over which can be done by the greedy method using M1 M2 2 O(n) independence oracle calls. To find r, we can run the with large η. However, the runtime of Frank-Wolfe algorithm greedy algorithm to find a maximal common independent depends implicitly on the diameter of the convex set via set in the two matroids using O(n) independence oracles. the constant Cf . To obtain a better Cf , we truncate both Every maximal solution gives a 1/2-approximation to r by matroids by the size of largest common independent set r. Lemma 7 because it implies each augmenting path is of Suppose for now, we know r such that r ≤ r ≤ 2r.We length at least 3. define the truncated set by   VIII. FASTER ALGORITHM VIA SAMPLING NEAR K { x, y ∈P ×P x ≤ r, y ≤ r}. = ( ) M1 M2 : i i OPTIMAL FRACTIONAL SOLUTION i i From Section VII, we are given a point x ∈PM ∩PM in f x, y 1 2 Now, we apply Frank-Wolfe on the function ( )= the matroid intersection polytope such that x1 ≥ (1−)·r. − x η x − y2 K 1 + 2 2 over . Theorem 49 shows that we In this section, we show how x can be used to sparsify

1165 the matroids M1 and M2. In particular, we reduce the and the integrality of the matroid (base) polytope, x¯ can matroid intersection problem to solving it on a universe be written as a convex combination of size-r¯ independent O r n 3 x n t v v of size ( 2 log ). We can then use algorithms developed sets, i.e., ¯ = i=1 i i where i are indicator vectors of in the previous sections on this smaller universe to find an some size-r¯ independent sets and multipliers ti ≥ 0 satisfy approximate integral solution. We use the following lemma i ti =1. of Karger (recall, PackNum(M) is the maximum number We round t down to t so that it is a multiple of λ.Now   of disjoint bases in M). by considering t /λ copies of vi for all i, we see that V Theorem 51 ([23, Theorem 4.1]). Given a matroid M with contains at least PackNum(M)=k, suppose we sample each element of  t  r  1 i 1 1 1 M with probability p ≥ 18 ln n · 2 , yielding a submatroid ≥ − n = 1 − =(1− o()) k λ λ 4n2 λ λ M(p) of M. Then with high probability in n, we have i PackNum(M(p)) ∈ [(1 − )pk, (1 + )pk]. disjoint size-r¯ independent sets. Moreover, the size of set  x Our strategy to sparsify the matroids is to show that after is |V | = i =(1− O()) · r , which means ln |V | = x V  i λ λ appropriately sampling using , the sampled elements O(ln(n/)). So by Theorem 51, w.h.p. M(p) contains at |V |n V  will have and will form a universe which is least almost “packed” for both the matroids, i.e., V  decomposes into an “almost perfect” partition of independent sets of size |V  p | − p · − o 1 − O · ( ) (1 − O())r for both the matroids. Taking the average of (1 ) (1 ( ))λ =(1 ( )) r r these independent sets shows that the vector |V | · 1V is almost independent for both the matroids. This means our disjoint size-r¯ independent sets, as desired. r || · || −  sampling procedure is valid because |V | 1V 1 =(1 From (2) of Lemma 52, the universe V (p) almost can be O()) · r. partitioned into disjoint independent sets of size (1−O())·r. We first demonstrate how to sample using x to obtain We now show that V (p) has a common independent set of  a new universe V with the desired properties in a single size (1 − O()) · r by putting equal mass on almost every matroid M. This can be seen as a non-uniform version of element. Karger’s result. Note that any matroid M naturally induces x ∈P ∩P x ≥ a new matroid if its elements are replaced by multiple Lemma 53. For a given point M1 M2 with 1 − ·r V  p V  p identical copies (a set with multiple copies of an element (1 ) , let ( ) be sampled as in Lemma 52. Then ( ) − O · r is dependent). has a common independent set of size (1 ( )) . x ∈P V  p I(1), ..., I(1) ∈ Lemma 52. Suppose we are given a point M with Proof: Suppose ( ) contains disjoint 1 k1 r (2) (2) x ≥ (1 − ) · r. Set λ = 3 . Suppose we replace each I I , ..., I ∈I 1 4n 1 and disjoint 1 k2 2 all of which are of size x i xi − O · r k ,k − element i ∈ V with λ :=  λ  identical copies to form a (1 ( )) . By Lemma 52, we may take 1 2 =(1  new matroid M with universe V . Let submatroid M(p) on O()) ·|V (p)|/r.  universe V (p) be obtained by independently sampling each We begin with a few simplifications. Let k =min{k1,k2}  λ ln(n/) I(1) I(2) element of V with probability p = O 2 . Then with and WLOG assume that all α and β are of equal size  high probability in n, r =(1− O()) · r by dropping elements from the non- i V p  r n smallest independent sets. For i =1, 2, define y( ) ∈ R ( ) 1) V (p) has size at most (1−O())·rp/λ = O 2 ln . V  p −O ·|V  p |/r by 2) ( ) contains (1 ( )) ( ) disjoint indepen- dent sets of size (1 − O())r. /k a ∈ I(i) ∪ ... ∪ I(i) y(i) 1 if 1 k  a = Proof: Note that x ∈PM is a multiple of λ and 0 o.w.  x 1 =(1− O()) · r as the total loss of rounding is at most nλ. y(i)  Then , which is the average of the indicator vectors for For (1), the expected size of V (p) is I(i), ..., I(i) M p 1 k , belongs to the matroid polytope for i( ).     y {y(1),y(2)} xi r n Therefore =min belongs to the matroid · p =(1− O()) · rp/λ = O ln , M p , M p λ 2 intersection polytope for 1( ) 2( ). Since the matroid i intersection polytope is integral, it suffices to show that y which holds w.h.p. within a factor of 1 ± by standard has size (1 − O()) · r. Chernoff bound. x For (2), we further slightly decrease to obtain a 3 M r¯ x ∈P x x  r This can be seen as follows: truncate to size . Then any fractional vector ¯ M so that ¯ 1 = 1 := ¯. Clearly independent set of size r¯ is a convex combination of independent sets, r¯ =(1− O()) · r. Now by the Caratheodory’s theorem which are of size at most r¯ and hence exactly r¯.

1166 We bound the size of y as follows: REFERENCES (1) (2)  [1] W. H. Cunningham, “Improved bounds for matroid partition y1 ≥y 1 + y 1 −|V (p)|/k  and intersection algorithms,” SIAM Journal on Computing =2r − r/(1 − O()) (SICOMP), vol. 15, no. 4, pp. 948–957, 1986. =2(1− O())r − (1 + O())r [2] Y. T. Lee, A. Sidford, and S. C.-w. Wong, “A faster cutting =(1− O())r, plane method and its implications for combinatorial and convex optimization,” in Proceedings, IEEE Symposium on which completes the proof of this lemma. Foundations of Computer Science (FOCS). IEEE, 2015, pp. Combining the last two lemmas shows that our sampling 1049–1065. r n scheme reduces the size of the universe to O 2 ln . [3] C. Chekuri and K. Quanrud, “Fast approximations for ma- x ∈P ∩P Theorem 54. Given a point M1 M2 such that troid intersection,” in Proceedings, ACM-SIAM Symposium  on Discrete Algorithms (SODA), 2016. x1 ≥ (1 − ) · r, we can find in O(n) time a set V of r size O( 2 log n) such that the largest common independent  [4] K. Murota, Matrices and matroids for systems analysis. subset of V for M1 and M2 has at least (1 − O()) · r Springer Science & Business Media, 2009, vol. 20. elements. [5] A. Recski, Matroid theory and its applications in electric Proof: From Lemmas 52 and 53, V (p) satisfies all and in statics. Springer Science & Business the desired properties. It remains to analyze the runtime Media, 2013, vol. 6. of the sampling scheme. Recall that V (p) is obtained by  [6] R. Dougherty, C. Freiling, and K. Zeger, “Networks, matroids, sampling V which contains identical copies of the elements and non-shannon information inequalities,” IEEE Transac-  of V . Instead of creating and sampling V explicitly, we can tions on Information Theory, vol. 53, no. 6, pp. 1949–1969, equivalently sample i ∈ V as a binomial random variable 2007. with  xi  trials and probability p. λ    [7] S. El Rouayheb, A. Sprintson, and C. Georghiades, “On the O˜ n2 r1.5 ·T index coding problem and its relation to network coding and Theorem 55. There is an r2 + 4.5 ind -time matroid theory,” IEEE Transactions on Information Theory, algorithm to obtain a (1 − )-approximation to the matroid vol. 56, no. 7, pp. 3187–3195, 2010. intersection problem. [8] R. Dougherty, C. Freiling, and K. Zeger, “Network coding 2 2 Proof: Using Theorem 50, in O((n /r ) ·Tind) time and matroid theory,” Proceedings of the IEEE, vol. 99, no. 3, z ∈P ∩P ||z|| ≥ − r pp. 388–405, 2011. we can find a point M1 M2 with 1 (1 ) . Applying Theorem 54 on z,inO(n) time we can reduce    [9] J. Edmonds, “Submodular functions, matroids, and certain the ground set to V with |V | = O(r log n/2)=:n and polyhedra,” Combinatorial structures and their applications, the maximum common independent set in V  has size ≥ pp. 69–87, 1970. (1 − O())r. Note that any independence oracle query on V  [10] M. Aigner and T. A. Dowling, “Matching theory for com- the matroid restricted to doesn’t change, and in particular binatorial ,” Transactions of the American Mathe- takes Tind time. Applying Theorem 21 on this universe of matical Society, vol. 158, no. 1, pp. 231–245, 1971.  1.5 1.5 size n , we see that in O((n / ) ·Tind) time we can get a common independent set S with |S|≥(1 − )|S∗| [11] E. L. Lawler, “Matroid intersection algorithms,” Math. Pro- gramming, vol. 9, no. 1, pp. 31–56, 1975. where S∗ is the largest common independent set in V .Thus, |S|≥(1 − ) · (1 − O())r =(1− O())r. That is, S is [12] H. N. Gabow and Y. Xu, “Efficient algorithms for independent an (1 − O())-approximate solution. The assignment on graphic and linear matroids,” in Proceed- follows by setting n = O(r log n/2) in the above. ings, IEEE Symposium on Foundations of Computer Science (FOCS), 1989, pp. 106–111. ACKNOWLEDGMENT [13] M. Shigeno and S. Iwata, “A dual approximation approach to We are thankful to Kent Quanrud for pointing us to weighted matroid intersection,” Operations research letters, Karger’s paper [23]. vol. 18, no. 3, pp. 153–156, 1995. [14] P. Christiano, J. A. Kelner, A. Madry, D. A. Spielman, and S.-H. Teng, “Electrical flows, laplacian systems, and faster approximation of maximum flow in undirected graphs,” in Proceedings, ACM Symposium on Theory of Computing (STOC). ACM, 2011, pp. 273–282.

[15] Y. T. Lee, S. Rao, and N. Srivastava, “A new approach to computing maximum flows using electrical flows,” in Pro- ceedings, ACM Symposium on Theory of Computing (STOC), 2013, pp. 755–764.

1167 [16] J. Sherman, “Nearly maximum flows in nearly linear time,” in [26] H. N. Gabow and Y. Xu, “Efficient theoretic and practical Proceedings, IEEE Symposium on Foundations of Computer algorithms for linear matroid intersection problems,” J. Com- Science (FOCS), 2013, pp. 263–269. put. System Sci., vol. 53, no. 1, pp. 129–147, 1996.

[17] J. A. Kelner, Y. T. Lee, L. Orecchia, and A. Sidford, “An [27] A. Madry, “Navigating central path with electrical flows: almost-linear-time algorithm for approximate max flow in From flows to matchings, and back,” in Proceedings, IEEE undirected graphs, and its multicommodity generalizations,” Symposium on Foundations of Computer Science (FOCS), in Proceedings, ACM-SIAM Symposium on Discrete Algo- 2013, pp. 253–262. rithms (SODA), 2014, pp. 217–226. [28] M. Mucha and P. Sankowski, “Maximum matchings via [18] R. Peng, “Approximate undirected maximum flows in o (m gaussian elimination,” in Proceedings, IEEE Symposium on polylog (n)) time,” in Proceedings, ACM-SIAM Symposium Foundations of Computer Science (FOCS), 2004, pp. 248– on Discrete Algorithms (SODA), 2016, pp. 1862–1867. 255.

[19] C.-C. Huang, N. Kakimura, and N. Kamiyama, “Exact and ap- [29] N. J. Harvey, “Algebraic algorithms for matching and matroid proximation algorithms for weighted matroid intersection,” in problems,” SIAM Journal on Computing (SICOMP), vol. 39, Proceedings, ACM-SIAM Symposium on Discrete Algorithms no. 2, pp. 679–702, 2009. (SODA), 2016, pp. 430–444. [30] H. Y. Cheung, L. C. Lau, and K. M. Leung, “Algebraic [20] J. Sherman, “Area-convexity, ∞ regularization, and undi- algorithms for linear matroid parity problems,” ACM Trans. rected multicommodity flow,” in Proceedings, ACM Sympo- on Algorithms (TALG), vol. 10, no. 3, p. 10, 2014. sium on Theory of Computing (STOC), 2017, pp. 452–460. [31] G. P. Guruganesh and S. Singla, “Online matroid inter- [21] A. Sidford and K. Tian, “Coordinate methods for accelerating section: Beating half for random arrival,” in Proceedings, ∞ regression and faster approximate maximum flow,” in MPS Conference on and Combinatorial Proceedings, IEEE Symposium on Foundations of Computer Optimization (IPCO). Springer, 2017, pp. 241–253. Science (FOCS), 2018, pp. 922–933. [32] N. J. A. Harvey, “Query lower bounds for matroid intersection n5/2 [22] J. E. Hopcroft and R. M. Karp, “An algorithm for (combinatorial optimization and discrete algorithms),” RIMS maximum matchings in bipartite graphs,” SIAM Journal on Kokyuroku Bessatsu, pp. 81 – 105, 2010. Computing (SICOMP), vol. 2, no. 4, pp. 225–231, 1973. [33] ——, “Matroid intersection, pointer chasing, and young’s [23] D. R. Karger, “Random sampling and greedy sparsification for seminormal representation of Sn,” in Proceedings, ACM- matroid optimization problems,” Math. Programming, vol. 82, SIAM Symposium on Discrete Algorithms (SODA), 2008, pp. no. 1-2, pp. 41–81, 1998. 542–549. [24] A. Frank, “A weighted matroid intersection algorithm,” J. [34] M. Jaggi, “Revisiting Frank-Wolfe: Projection-free sparse Algorithms, vol. 2, no. 4, pp. 328–336, 1981. convex optimization,” in Proceedings, International Confer- [25] C. Brezovec, G. Cornuejols,´ and F. Glover, “Two algo- ence on Machine Learning (ICML), vol. 28, no. 1, 2013, pp. rithms for weighted matroid intersection,” Math. Program- 427–435. ming, vol. 36, no. 1, pp. 39–53, 1986.

1168