We revisit the classical maximum weight matching problem in general graphs with non-negative integral edge weights. We present an algorithm that operates by decomposing the problem into W unweighted versions of the problem, where W is the largest edge weight. Our algorithm has running time as good as the current fastest algorithms for the maximum weight matching problem when W is small. One of the highlights of our algorithm is that it also produces an integral optimal dual solution, thus our algorithm also returns an integral certificate corresponding to the maximum weight matching that was computed.

Our algorithm yields a new proof to the total dual integrality of Edmonds' matching polytope and it also gives rise to a decomposition theorem for the maximum weight of a matching in terms of the maximum size of a matching in certain subgraphs. We also consider the maximum weight capacitated b-matching problem in bipartite graphs with non-negative integral edge weights and show that it can also be decomposed into W unweighted versions of the problem, where W is the largest edge weight. Our second algorithm is competitive with known algorithms when W is small.

Chapter 1

Introduction

Given a graph G = (V, E), a subset of edges M ⊆ E is matching if no two edges in M share a common endpoint. Graph matching problems can be generally described as finding a matching that satisfies some condition, such as optimality with respect to some objective function, stability [START_REF] Gale | College admissions and the stability of marriage[END_REF], popularity [START_REF] Gärdenfors | Match making: assignments based on bilateral preferences[END_REF], or fairness [START_REF] Huang | Fair matchings and related problems[END_REF]. The most common goal is to ask for a maximum weight matching, where we assume that edges are assigned weights and the weight of a matching is the sum of the weights of its edges. Without a doubt, graph matching is one of the most fundamental combinatorial optimisations problems. Some remarkable applications include: shortest paths [START_REF] Lawler | Optimal matroid intersections[END_REF], the Chinese postman problem [START_REF] Kuan | Graphic programming using odd or even points[END_REF], planar max cut [START_REF] Hadlock | Finding a maximum cut of a planar graph in polynomial time[END_REF], and the travelling salesman problem [START_REF] Christofides | Worst case analysis of a new heuristic for the travelling salesman problem[END_REF]. Due to applications in online auctions, the importance of matchings has become even more prominent in recent years A matroid M is a pair (E, I), where E is the ground set and I is a family of subsets of E. Furthermore, the following conditions are satisfied. (1) ∅ ∈ I; (2) if I ⊆ J and J ∈ I, then I ∈ I;

(3) given I, J ∈ I, and |J|> |I|, then there exists an element e ∈ J\I so that I ∪ {e} ∈ I. The sets in I are called independent sets. Given two matroids, M 1 = (E, I 1 ) and M 2 = (E, I 2 ), a matroid intersection problem asks for a common independent set I ∈ I 1 ∩ I 2 that satisfies some condition. As in the case of matching, the most common objective is to ask for maximum weight common independent set, where the elements in E are assigned weights. Matroids, along with matroid intersection, find numerous applications in combinatorial optimisation, the most well-known being bipartite matching, packing of spanning trees, and finding arborescences in a directed graph [START_REF] Schrijver | Combinatorial optimization: Polyhedra and efficiency[END_REF]. Other applications exist in electric circuit theory [START_REF] Murota | Matrices and matroids for systems analysis[END_REF][START_REF] Recski | Matroid theory and its applications in electric network theory and in statics[END_REF], rigidity theory [START_REF] Recski | Matroid theory and its applications in electric network theory and in statics[END_REF], and network coding [START_REF] Dougherty | Network coding and matroid theory[END_REF].

Besides giving applications in a large number of areas, matching and matroid intersection play a central role in theory, especially in algorithmic design, polyhedral combinatorics, linear programming, and graph theory. In a certain sense, the boundary of P is to a large extent delineated by these problems: those problems that can be solved in polynomial time are often generalisations of these two, or share similar structures.

History

When talking about the matching and matroids, the name of Jack Edmonds is unavoidable. He not only solved weighted matching and weighted matroid intersection problems, but also pioneered an entire field. First consider the problem of maximum cardinality matching (i.e., when all weights are uniform). Berge [12] showed that a matching M is of maximum cardinality if and only if there is no augmenting path.1 Therefore to find a maximum cardinality matching, it suffices to repeat augmenting the matching O(|V |) times. Finding an augmenting path in a bipartite graph is easy to do in polynomial time; however, in a general graph, finding such a path is highly non-trivial. It was Edmonds in 1965 who solved this problem [START_REF] Edmonds | Paths, trees, and flowers[END_REF], by proposing his famous "blossom" algorithm. It is noteworthy that in this article, he formally introduced the notion of polynomial time algorithms and in a sense anticipated the class of NP-complete problems. In the same year [START_REF] Edmonds | Maximum matching and a polyhedron with (0, 1) vertices[END_REF], he solved the maximum weight matching problem. An important consequence of his primal-dual algorithm is a linear description of the convex hull of all matchings, namely, the matching polytope. Remarkably, the integrality of his matching polytope does not follow from standard total-unimodularity and is generally regarded as a breakthrough in polyhedral combinatorics. 2Matroids were first introduced by Whitney [? ] (and much less well-known, independently by Nakasawa [? ]). They capture many common structures across different branches of mathematics (algebra, geometry, and graph theory). Their importance in algorithm design is demonstrated by Edmonds [START_REF] Edmonds | Submodular functions, matroids, and certain polyhedra[END_REF][START_REF] Edmonds | Matroids and the greedy algorithm[END_REF][START_REF] Edmonds | Matroid intersection[END_REF]: he showed how a greedy algorithm can be used to find an optimal independent set, proved a mini-max theorem on matroid intersection, gave an efficient algorithm to compute a maximum weight common independent set, and showed that the intersection of the independent set polytopes of two matroids gives exactly the convex hull of the common independent sets. The fact that one can use two matroids to capture a large class of problems and use his algorithm to solve them is really outstanding; the frontier of P is impressively pushed back by him.

After matching and matroid intersection

We now discuss some more developments after matching and matroid intersection problems were resolved by Edmonds. These developments relate to problems that we have investigated or have the plan of studying in the future.

It is known that both graph matching (in a general graph) and matroid intersection are different generalisations of the bipartite graph matching. Since they are both solvable in polynomial time, it is natural to ask for a common generalisation of graph matching and matroid intersection. Such a generalisation is formulated by Lawler [START_REF] Lawler | Combinatorial Optimization: Networks and Matroids[END_REF], as the matroid parity problem, 3 where, given disjoint pairs of elements, one finds the largest set of pairs whose union is an independent set in the matroid. Such a problem is known to be unsolvable using a polynomial number of oracle calls (the oracle can answer the query whether a certain set is independent in the matroid or not) [101? ]. Remarkably, for the special case of a linear matroid, Lovász [? ] gave a polynomial time algorithm and also gave a mini-max formula. Several well-known applications of his algorithm include finding a maximum size forest in a 3-uniform hyper-graph [? ], finding the minimum vertex feedback set when the given graph has degree at most 3 [START_REF] Ueno | On the nonseparating independent set problem and feedback set problem for graphs with no vertex degree exceeding three[END_REF], and finding the maximum number of disjoint S-paths [? ].

For long years, the complexity of weighted linear matroid parity problem (when the paired elements are given weights) has remained unsolved. An exciting new result was achieved by Iwata and Kobayashi [? ], who gave a polynomial time algorithm for this problem.

Another subject related to matroids is that of submodular functions. Such a function captures the property of "diminishing marginal return" and can be regarded as a discrete version of a convex function. The rank function of a matroid is submodular and in fact many problems in combinatorial optimisation are just special cases of maximising/minimising a submodular function (with or without additional constraints). Some well-known examples include (directed) max-cut, k-coverage, and matroid intersection [START_REF] Schrijver | Combinatorial optimization: Polyhedra and efficiency[END_REF]. Due to its generality in theory and wide application (the maximisation problem sees many applications in machine learning in recent days, examples including document summarisation, sensor placement, and image collection summarisation [1]; the minimisation problem sees applications in discrete optimisation, game theory, queueing theory and information theory [START_REF] Mccormick | Handbook on Discrete Optimization[END_REF]), submodular function optimisation received a large amount of attention in the last two decades; notably, Iwata, Fleischer and Fujishige [? ] and Schrijver [START_REF] Schrijver | A combinatorial algorithm minimizing submodular functions in strongly polynomial time[END_REF] have received Fulkerson prize in 2003 for their strongly polynomial time algorithms for minimising a submodular function.

Contribution of the author

The author works on both exact and approximation algorithms. His main research interests include: stable matching, algorithmic game theory, machine scheduling, and more generally, combinatorial optimisation. His interest on the main topics of this proposal, namely matching, matroid, and submodular function, was developed gradually over the years after the completion of his Ph.D in 2008. In the following subsections, five papers representing his contribution on these topics are summarised.

New algorithms for maximum weight matching (SODA 2012, MOR 2017)

Designing faster algorithms to solve the maximum weight matching problem is one of the most studied subjects in the area of algorithm design. Let n = |V |, m = |E|, and assume that integral edge weight function w : E → {1, 2, • • • , W } is given. We summarise the current fastest algorithms.

1. Gabow's algorithm [START_REF] Gabow | Data structures for weighted matching and nearest common ancestors with linking[END_REF], which takes O(n(m + n log n)) time.

2. Duan, Pettie, and Su's algorithm [START_REF] Duan | Scaling algorithms for weighted matching in general graphs[END_REF], which takes O(m √ n log nW ) time.

3. Huang and Kavitha's algorithm, which takes O(W n ω ) or O(W √ nm log n n 2 m ) time, where ω ≈ 2.37 is the exponent of the matrix multiplication time.

Thus, when W is large, say in the order of Ω(n polylogn ), Gabow's strongly polynomial time algorithm is the choice; when W is not overly small, Duan, Pettie, and Su's algorithm is the best. Our pseudo-polynomial time algorithm is superior to the previous two when the graph is dense enough and W is really small (say in the order of o(log n).)

Before explaining our approach, let us summarise the previous techniques. The most common approach to solving the maximum weight matching problem is the primal-dual schema-often called the Hungarian method [START_REF] Kuhn | The hungarian method for the assignment problem[END_REF] for the special case of bipartite graphs. For general graphs, this approach was initiated by Edmonds [START_REF] Edmonds | Maximum matching and a polyhedron with (0, 1) vertices[END_REF] and various later algorithms, can be regarded as refinements of Edmonds' algorithm. The idea is to build up feasible primal and dual solutions simultaneously and show that in the end, both solutions satisfy complementary slackness conditions and hence by the linear programming duality theorem, the primal solution is a maximum weight matching. A second approach, which can be regarded as the "primal approach," is to maintain a feasible matching and augment it successively to increase its weight until no further augmentation is possible. The work of Cunningham and Marsh [START_REF] Cunningham | A primal algorithm for optimum matching. Polyhdedral Combinatorics-Dedicated to the Memory of D.R. Fulkerson[END_REF] (and also Derigs [START_REF] Derigs | A shortest augmenting path method for solving minimal perfect matching problems[END_REF]) can be regarded as representative of this approach.

A third approach, though still primal-dual in nature, can be called "weight-decomposition." It was originally proposed by Kao et al. [START_REF] Kao | A decomposition theorem for maximum weight bipartite matchings[END_REF] for the special case of bipartite graphs. Roughly speaking, they show that the problem can be reduced to solving a sequence of W maximum cardinality matchings in subgraphs of the original graph. Their algorithm can be described as follows: in the i-th iteration, only edges of weights higher than Wi are considered and, in particular, only edges whose weight minus the vertex potentials (i.e., the dual solution) equals one are retained. Then a maximum cardinality matching is computed in the subgraph and this matching is subsequently used to update the vertex potentials. The final matching and the vertex potentials can be shown to satisfy the complementary slackness conditions. It should be emphasised why this approach leads to some computational efficiency: the unweighted maximum cardinality algorithm is slightly more efficient than its weighted counter-part. Therefore, when W is small enough, this approach leads to faster algorithms. Indeed, it can be imagined that in the future, if there is further improvement on the maximum cardinality algorithm, our algorithm for the weighted problem becomes faster as well.

In [START_REF] Huang | New algorithms for maximum weight matching and a decomposition theorem[END_REF], we showed that the same approach can be generalised to the case of non-bipartite graphs. The main challenge lies in handling the blossoms and the more complicated dual program. A by-product of our algorithm is a new proof showing that the matching polytope is totally dual integral. More generally, we prove the following decomposition theorem.

In a graph G = (V, E) with edge weights in {1, . . . , W }, we show that the maximum weight of a matching is exactly W i=1 |M i |, where for each i ∈ {1, . . . , W }, M i is a maximum weight matching in the subgraph G i of G with edge set E ′ i = {e ∈ E : w(e) ≥ W -(i -1)} and the weight function w i : E ′ i → {1, . . . , i} defined as w i (e) = w(e) -(Wi). In particular, we show the following equation:

|M i |= u∈V y i u + B∈Ω z i B |B|-1 2 - u∈V y i-1 u - B∈Ω z i-1 B |B|-1 2 ,
where ⟨y i u , z i B ⟩ (u∈V, B∈Ω) is an integral optimal solution to the dual program for the maximum weight matching program in the graph G i (note that y 0 u and z 0 B are just 0 for all u ∈ V and B ∈ Ω). Since the graph G W = G, the above equation yields the decomposition theorem.

In the journal version of the paper, we also consider the maximum weight bipartite capacitated b-matching problem. Let G = (A ∪ B, E) be a bipartite graph with weight function w : E → {1, • • • , W }. Note that G need not be simple, i.e., multi-edges are allowed. Additionally, there is a quota b : A ∪ B → Z >0 on the vertices and a capacity c : E → Z >0 on the edges. A function M : E → Z ≥0 is a feasible solution if (1) M (e) ≤ c(e) for every e ∈ E and (2) e∈δ(v) M (e) ≤ b(v) for every v ∈ A∪B. The goal is to find a feasible solution M so that e∈E w(e)M (e) is maximised.

We show that this problem can also be decomposed into W unweighted (and capacitated) versions of the same problem. In particular, we can solve the problem in As there are many parameters, it is difficult to give a detailed comparison of our algorithms to all the fastest algorithms in the literature. But in general, unless the largest capacity C = max e∈E c(e) is really large, the recent algorithm of Lee and Sidford [START_REF] Lee | Path finding ii : An Õ(m (n)) algorithm for the minimum cost flow problem[END_REF] is the fastest algorithm. Our algorithms are faster than theirs when the graph is very unbalanced, i.e., when min{|A|, |B|} = o(n) and W is O(polylog(m, C)).

Exact and approximation algorithms for maximum weight matroid intersection (SODA 2016, MP accepted)

As discussed above, both weighted and unweighted matroid intersection problems were solved by Edmonds. Recall that in the weighted version, an integral weight function w : E → {1, 2, • • • W } is defined over the ground set E of the two matroids M 1 and M 2 . Since Edmonds, a sequence of papers have proposed algorithms with faster running time and/or simpler analyses. It should be mentioned that in the literature, the complexity of the algorithms is measured by the number of oracle calls. For the unweighted case, the fastest algorithm was due to Cunningham [START_REF] Cunningham | Improved bounds for matroid partition and intersection algorithms[END_REF], which takes O(nr 1.5 ) oracle calls, where n = |E| and r is the smaller rank of M 1 and M 2 . For the weighted case, various algorithms [START_REF] Brezovec | Two algorithms for weighted matroid intersection[END_REF][START_REF] Frank | A weighted matroid intersection algorithm[END_REF][START_REF] Gabow | Efficient theoretic and practical algorithms for linear matroid intersection problems[END_REF][START_REF] Shigeno | A dual approximation approach to weighted matroid intersection[END_REF] take O(nr 2 ) calls or O(n 2 √ r log rW ) calls. Note that the gap in the complexity between the unweighted and weighted version is more pronounced than in the matching case. It is thus tempting to apply the same weight-decomposition technique in the previous section.

Our paper [START_REF] Huang | Exact and approximation algorithms for weighted matroid intersection[END_REF] achieves exactly this. Here lies the challenge of this task: even though the matroid intersection problem can be written as a linear program, its dual variables are harder to reason with and to control, unlike the case of graph matching, where the dual variables can be interpreted as "potential" on the vertices and the blossoms. The way we overcome this issue is to adopt the "weight-splitting" approach of Frank [START_REF] Frank | A weighted matroid intersection algorithm[END_REF]. He showed that the dual variables can be replaced by a weight splitting w = w 1 + w 2 and the complementary slackness condition for optimality can also be replaced by weight-optimality in w 1 and w 2 .

A critical step of our algorithm is the following: on each round, after applying the unweighted matroid intersection algorithm on a subset of elements in E, we update w 1 and w 2 ; more importantly, two new matroids M ′ 1 and M ′ 2 are also defined based on the weights w 1 and w 2 . The newly defined matroids help to maintain the optimality condition in the subsequent rounds that is satisfied in this round.

In summary, our approach gives rise to the following algorithms:

1. with two general matroids, an algorithm taking O(W nr 1.5 ) oracle calls;

2. with two linear matroids (given in the form of two r-by-n matrices), an algorithm taking O(nr log r * + W nr ω-1 *

) time, where r * ≤ r is the maximum size of a common independent set; 3. with two graphic matroids, an algorithm taking O(W √ rn log r) time.

These algorithms are faster than previously known algorithms when W is relatively small. For instance, given two general matroids, our algorithm is faster when W = o(min{ √ r, n log r r }). Note that after the technical report of our paper was published, Lee-Sidford-Wong [START_REF] Lee | A faster cutting plane method and its implications for combinatorial and convex optimization[END_REF] used a novel cutting-plane method to develop a new algorithm taking only O(n 2 log nW ) calls. Our algorithm remains faster when r = o( √ n).

A recent trend in research is to design fast approximation algorithms for fundamental optimisation problems even if they are in P. Examples include maximum weight matching [START_REF] Duan | Linear-time approximation for maximum weight matching[END_REF], shortest paths [START_REF] Thorup | Approximate distance oracles[END_REF], and maximum flow [START_REF] Christiano | Electrical flows, laplacian systems, and faster approximation of maximum flow in undirected graphs[END_REF][START_REF] Kelner | An almost-linear-time algorithm for approximate max flow in undirected graphs, and its multicommodity generalizations[END_REF][START_REF] Lee | A new approach to computing maximum flows using electrical flows[END_REF][START_REF] Sherman | Nearly maximum flows in nearly linear time[END_REF]. Using the algorithms of [START_REF] Cheung | Fast matrix rank algorithms and applications[END_REF][START_REF] Cunningham | Improved bounds for matroid partition and intersection algorithms[END_REF][START_REF] Gabow | Efficient algorithms for independent assignments on graphic and linear matroids[END_REF], our decomposition technique delivers a (1ε)-approximate solution, 1. when given two general matroids, using O(ε -1 nr 1.5 log r) oracle calls; 2. when given two linear matroids, using O(nr log r * + ε -1 nr ω-1 * log r * ) time;

3. when given two graphic matroids, using O(ε -1 √ rn log 2 r) time.

Our approximation algorithms are significantly faster than most exact algorithms. Prior to our results, there is only a simple greedy 1/2-approximation algorithm [START_REF] Jenkyns | The efficacy of the "greedy" algorithm[END_REF][START_REF] Korte | An analysis of the greedy heuristic for independence systems[END_REF]. We note that for general matroids, after our paper was published, Chekuri and Quanrud [START_REF] Chekuri | Fast approximations for matroid intersection[END_REF] improved upon our results: they obtain a (1ε)-approximate solution using O(nrε -2 log 2 ε -1 ) oracle calls. For the special case of linear and graphic matroid, our approximation algorithms remain the fastest.

Fair matching (FSTTCS 2012, Algorithmica 2016)

We consider a problem in the context of matching under preferences (the well-known stable matching problem [START_REF] Gale | College admissions and the stability of marriage[END_REF] falls into this category). Let G = (A∪B, E) be a bipartite graph, where each node u ∈ A ∪ B has a list ranking its neighbors in an order of preference (ties are allowed). Depending on the applications, various optimality conditions can be imposed. We consider the problem of fair matching, defined as follows.

A matching M is fair if M has maximum cardinality, subject to this, M matches the minimum number of vertices to rank r neighbors, and subject to that, M matches the minimum number of vertices to rank (r -1) neighbors, and so on, where r is the worst rank used in the preference lists of vertices.

Fair matching can be solved in polynomial time by the following reduction: for an edge e with incident ranks i and j, let w(e) = n i-1 +n j-1 . It is easy to see that a maximum cardinality matching of minimum weight (under weight function w) is a fair matching in G. Such a matching can be computed via the maximum weight matching algorithm by resetting e's weight to 4n r -n i-1 -n j-1 , where r is the largest rank used in any preference list. However, this approach can be expensive even if we use the fastest maximum-weight bipartite matching algorithms [START_REF] Duan | A scaling algorithm for maximum weight matchings in bipartite graphs[END_REF][START_REF] Fredman | Fibonacci heaps and their uses in improved network optimization algorithms[END_REF][START_REF] Gabow | Faster scaling algorithms for network problems[END_REF][START_REF] Orlin | New scaling algorithms for the assignment and minimum mean cycle problems[END_REF]. The running time will be O(rmn) or Õ(r 2 m √ n). Note that these complexities follow from the customary assumption that an arithmetic operation takes O(r) time on weights of the order n r . We introduce a combinatorial algorithm to solve the problem of fair matching. This algorithm takes Õ(r * m √ n) or Õ(r * n ω ) time, where r * is the largest rank used in a fair matching, thus significantly faster than the aforementioned brute-force reduction to weighted matching. Our algorithm is similar in spirit to the weight-decomposition approach in the previous two papers: in each round, a subset of edges are considered and a maximum weight matching, under the additional constraint that certain vertices need to be matched, is computed. Such a matching is then used to define the dual variables, which in turn determine the set of edges used in the next round. In particular, we show how to solve the following problem, which can be of independent interest in other contexts, in polynomial time.

Generalized minimum weighted vertex cover problem. Let G i = (A ∪ B, E i ) be a bipartite graph with edge weights given by w i : E i → {0, 1, . . . , c}. Let K i-1 ⊆ A ∪ B satisfy the property that there is a matching in G that matches all v ∈ K i-1 . Find a cover {y i u } u∈A∪B so that u∈A∪B y i u is minimized subject to (1) for each e = (a, b) in E i , we have y i a + y i b ≥ w i (e), and (2)

y i u ≥ 0 if u ̸ ∈ K i-1 .

Maximising a monotone submodular function with a knapsack constraint under the streaming model (APPROX 2017)

Let f : 2 E → R + be a monotone non-negative submodular function. Recall that a function is submodular if it satisfies the diminishing marginal returns property, i.e., for all subsets S ⊆ T ⊊ E and e ∈ E \ T , we have f (S ∪ {e})f (S) ≥ f (T ∪ {e})f (T ).

A function is monotone if f (S) ≤ f (T ) for any S ⊆ T .

There can be various types of constraints which define the feasible sets of S. The simplest, and probably the most well-known constraint is that of cardinality, namely, up to K elements in E are allowed. This problem includes the k-coverage problem as a special case. By the well-known result of Feige [START_REF] Feige | A threshold of ln n for approximating set cover[END_REF], one cannot hope to get an approximation ratio better than 1 -1 e + ε, for any ε > 0, unless P=NP. A generalisation of the cardinality constraint would be the knapsack constraint. In the latter, a size function c : E → N is given, and the goal is to maximise f (S), under the restriction that e∈S c(e) ≤ K. For both cardinality and knapsack constraints, it is known that one can achieve the approximation ratio of 1 -1 e using a greedy algorithm [START_REF] Fisher | An analysis of approximations for maximizing submodular set functions ii[END_REF][START_REF] Sviridenko | A note on maximizing a submodular set function subject to a knapsack constraint[END_REF], matching the lower bound.

An interesting question is to consider the same problem in the single-pass streaming model. In this model, elements arrive one by one but our storage space is much smaller than the total input. An element, if discarded, due to the space limitation, is lost forever. A generalisation of this model is that of multiple passes. The storage space is still small compared to the total input size, but one is allowed to scan through the data a (usually very small) number of times. Observe that this setting (single pass or multiple passes) renders most of the techniques in the traditional setting useless, as they typically require random access to the input data.

The main result of this paper is:

1. a single-pass streaming algorithm with approximation ratio 4/11ε ≈ 0.363ε, using O(K • poly(ε -1 )polylog(K)) space.

2. a multiple-pass streaming algorithm with approximation ratio 2/5ε = 0.4ε, using O(K • poly(ε -1 )polylog(K)) space.

We now summarise the technique. First consider the single-pass model. A straightforward greedy algorithm, where the incoming item is taken only if marginal ratio-defined as its marginal value divided by its size-passes the threshold, if there is still space. But this gives only 1 3ε approximation. The difficulty in improving further is the following situation: A new arriving item that is relatively large in size passes the marginal-ratio threshold and is part of OPT, but its addition would cause the size of the current set to exceed the capacity K. In this case, we are forced to throw it away, but in doing so, we are unable to bound the approximation ratio of the current set against that of OPT properly.

We propose a branching procedure to overcome this issue. Roughly speaking, when the size of the current set exceeds a certain size (depending on the parameters), we create a secondary set. We add an item to the secondary set only if it passes the marginal-ratio threshold with respect to the original set, but its addition to the original set would violate the size constraint. In the end, whichever set achieves the higher value is returned. In a way, the secondary set serves as a "back-up" with enough space in case the original set does not have it, and this allows us to bound the ratio properly. Such a branching technique leads to a (4/11ε)-approximation.

The main bottleneck of the above single-pass algorithm lies in the situation where there is a large item in OPT whose size exceeds K/2. To overcome this case, we develop a (2/3ε)approximation algorithm for constraint of a partition matroid of rank 2. Indeed, our technique is more general and can be of independent interest; so let us describe it briefly.

Let E r ⊆ E be a subset of the ground set E (called "red items"). Consider the problem defined below:

maximize f (S) subject to c(S) ≤ K, |S ∩ E R |≤ 1. (1.1)
We show that, given ε ∈ (0, 1], an approximation v to f (OPT) with v ≤ f (OPT) ≤ (1 + ε)v, and an approximation θ of f (o r ) for the unique item o r in OPT ∩ E r , we can choose O(1) of the red items so that one of them e ∈ E r satisfies that f (OPTo r + e) ≥ (Γ(θ) -O(ε))v, where Γ is a piecewise linear function lower-bounded by 2/3.

Our multiple pass algorithm uses this technique by treating the large item as the red items. A pass is used to choose a good red item and in the next pass a modified version of our single-pass algorithm is used to further collect smaller items.

Mixed popular matchings (SODA 2017)

We consider a problem of matching under preferences. Let G = (A ∪ B, E) be a bipartite graph where A is called the set of men, B is called the set of women, and every vertex u ∈ A ∪ B has a preference list ranking its neighbors in a strict order of preference. Such a graph G is also referred to as an instance of the stable marriage problem [START_REF] Gale | College admissions and the stability of marriage[END_REF] with strict and possibly incomplete preference lists. Our interest here, however, is not the stability of a matching. It is rather the popularity, a notion introduced by Gärdenfors [START_REF] Gärdenfors | Match making: assignments based on bilateral preferences[END_REF]. A vertex u ∈ A ∪ B prefers matching M to matching M ′ if u is matched in M and unmatched in M ′ or it is matched in both and M (u) ranks higher than M ′ (u) in u's preference list. For any two matchings M and M ′ in G, let ϕ(M, M ′ ) be the number of vertices that prefer M to M ′ . We say M is more popular than

M ′ if ϕ(M, M ′ ) > ϕ(M ′ , M ). Definition 1.3.1. A matching M is popular if ϕ(M, M ′ ) ≥ ϕ(M ′ , M ) for every matching M ′ in G, i.e., ∆(M, M ′ ) ≥ 0 where ∆(M, M ′ ) = ϕ(M, M ′ ) -ϕ(M ′ , M ).
By this definition, a popular matching is a sort of "global stable" matching. Popular matching has a strange history, much less glamorous, compared with its counterpart, the stable matching. After Gärdenfors' paper, the notion of popular matching seemed almost forgotten by the world. Its revive was thanks to a paper in SODA 2005 [START_REF] Abraham | Popular matchings[END_REF], where a polynomial algorithm is given for deciding the existence of a popular matching when only one side has preferences and can vote (e.g., agents and houses). After this paper, a plethora of papers have been published on various aspects of popular matching, for both one-sided and two-sided preferences, in theoretical computer science. Some notable results include: a polynomial time algorithm for computing a maximum cardinality popular matching [START_REF] Kavitha | A size-popularity tradeoff in the stable marriage problem[END_REF] with the two-sided preferences (i.e., an instance of the stable marriage problem); the existence of "mixed popular matching" (definition below) for both onesided or two-sided preferences [START_REF] Kavitha | Popular mixed matchings[END_REF]. We remark that at present, it is unknown whether there is a polynomial time algorithm to compute a maximum utility (weight) popular matching (except for the case all utilities are uniform-which is just maximum cardinality popular matching).

We now explain what a mixed popular matching is. A mixed matching is a probability distribution over matchings, i.e., a mixed matching Π = {(M 0 , p 0 ), . . . , (M k , p k )}, where M 0 , . . . , M k are matchings in G and k i=0 p i = 1, p i ≥ 0 for all i, and the utility of Π is

k i=0 p i • w(M i ).
The function ϕ(M, M ′ ) defined earlier easily extends to ϕ(Π, M ′ ) as follows:

ϕ(Π, M ′ ) = k i=0 p i • ϕ(M i , M ′ ), where Π = {(M 0 , p 0 ), . . . , (M k , p k )}. The definition of ϕ(M ′ , Π)) is analo- gous. Definition 1.3.2. A mixed matching Π is popular if ϕ(Π, M ′ ) ≥ ϕ(M ′ , Π) for all matchings M ′ in G, i.e., ∆(Π, M ′ ) ≥ 0, where ∆(Π, M ′ ) = ϕ(Π, M ′ ) -ϕ(M ′ , Π). Suppose Λ = {(N 0 , q 0 ), • • • , (N h , q h )} is another mixed matching. Let ∆(Π, Λ) = k i=1 h j=1 p i q j ∆(M i , N j ).
Then it follows easily from the above definitions that if Π is popular then ∆(Π, Λ) ≥ 0 for all mixed matchings Λ in G. Thus a popular mixed matching "beats" all integral and mixed matchings. We remark that it is not true that a mixed popular matching is a convex combination of integral popular matchings.

Mixed matchings are closely related to fractional matchings. A fractional matching ⃗ x in G is a point in R m ≥0 that satisfies e∈δ(v) x e ≤ 1, for every vertex v, where δ(v) is the set of edges incident on vertex v. In a bipartite graph, a mixed matching is equivalent to a fractional matching (Birkhoffvon Neumann theorem). The polytope P G ⊆ R m of all popular mixed matchings in G = (A∪B, E) involves exponentially many constraints. However a compact extended formulation of this polytope was given in [START_REF] Kavitha | Popular mixed matchings[END_REF]. Thus a max-utility popular mixed matching can be computed in polynomial time.

However a potential drawback of generalizing from matchings to mixed matchings is that the optimal solution has become more complex to describe and more difficult to implement. A mixed matching can be interpreted as either a lottery over matchings or a time-sharing arrangement when the mixed matching is viewed as a fractional matching [START_REF] Roth | Stable matchings, optimal assignments, and linear programming[END_REF]: in the former case, we need access to several random bits to implement a lottery and the latter case involves sub-dividing jobs and assigning several fractional jobs to an applicant. Thus we may need to deal with an unstructured optimal solution. Our main result is the following.

Theorem 1.3.3. Given an instance G = (A ∪ B, E) with strict preference lists and a utility function w : E → Q, G always has a max-utility popular mixed matching Π = {(M 0 , 1 2 ), (M 1 , 1 2 )} and Π can be computed in polynomial time. Moreover, if G admits a perfect stable matching, i.e. a stable matching where no vertex is unmatched, then Π = {(M, 1)}, namely, Π is pure.

Thus our result implies that to achieve max-utility, we need just a single random bit to implement the lottery or we can find a time-sharing arrangement that is simple and organized-every vertex has at most two partners and spends the same amount of time with each. Hence we can find a max-utility popular mixed matching that is highly structured. This theorem also implies a polynomial time algorithm for computing a max-utility popular half-integral matching.

We now explain our technique. What we proved is in fact stronger than Theorem 1.3.3. We show that the polytope P G ⊆ R m of all popular mixed matchings is half-integral. We started by making an observation: the linear program describing the polytope of mixed popular matching, originally introduced in [START_REF] Kavitha | Popular mixed matchings[END_REF] for the one-sided preference, is self-dual when the input problem is of two-sided preferences. This essentially means that if we look at the dual program, after replacing all variables by their negative counter-parts (thus a minimisation problem becomes a maximisation problem), the new program will be identical to the original primal program. 4 This self-duality is useful in our proof: due to complementary slackness condition, assuming that x is mixed popular, if x ab > 0, then the inequality corresponding to man a and woman b must be tight.

Our proof borrows some ideas from Teo and Sethuraman [START_REF] Teo | The geometry of fractional stable matchings and its applications[END_REF], who introduced an interesting technique to prove the integrality of the stable matching polytope: for each man a (woman b), line up from 0 to 1 the "boxes" whose widths corresponding to the fractional values x a,b ′ by the decreasing order of women b ′ on his list (similarly for woman b, we line up boxes whose widths corresponding to x a ′ ,b by the increasing order of men a ′ on her list). It can be shown that picking any point in [0, 1], if we match the man a (woman b) to the woman b ′ (resp. man a ′ ) for which x a,b ′ (resp. x a ′ ,b ) touches this point, the outcome is a stable matching. This fact implies that a fractional stable matching x is a convex combination of integral stable matchings.

We proved that such a technique can also be generalised to the context of popular matching. A new ingredient in our proof is to use the "witness" of a popular matching (a set of |A ∪ B| variables corresponding to the vertices, which serve as a succinct certificate) to help us establish the popularity of an integral matching.

Chapter 2

New Algorithms for Maximum Weight Matching and a Decomposition Theorem

Introduction

The input here is a graph G = (V, E) with edge weights given by the function w :

E → {1, 2, • • • , W }.
A matching M is a subset of E such that no two edges in M share an endpoint. The weight of a matching M is the sum of the weights of the edges in M . Our objective is to find a maximum weight matching in G. We note that a maximum weight matching need not be a maximum cardinality matching; a maximum weight matching has many applications. For instance, suppose V is a set of players, E is the set of possible pairings of players, and the weight of each edge is the utility of pairing its endpoints together. We seek a set of disjoint pairings so that the sum of utilities is maximized, in other words, what we seek is a maximum weight matching in G.

A closely related problem is that of computing a maximum weight perfect matching, where the goal is to find a perfect matching, and subject to that, one with the largest weight. Although the maximum weight matching problem and the maximum weight perfect matching problem can be reduced to each other in polynomial time, the two problems are different and an algorithm designed for one problem may not achieve the same running time in the other problem. See [START_REF] Duan | Linear-time approximation for maximum weight matching[END_REF] for a more detailed discussion on this issue. The algorithms presented in this paper have running time guarantees only for the maximum weight matching problem.

Matching problems lie at the core of graph theory, polyhedral combinatorics, and linear optimization. Due to their fundamental nature and vast application, in the past decades, intense investigations have been made for the problem. Edmonds' pioneering work back in the 60s especially highlights the intricate correlation between algorithm design and polyhedral characterization. We refer the interested reader to [START_REF] Duan | Linear-time approximation for maximum weight matching[END_REF][START_REF] Schrijver | Combinatorial Optimization -Polyhedra and Efficiency[END_REF] for a history of the various matching algorithms and their performance. For the polyhedral characterization aspect of matchings, see [START_REF] Cook | Combinatorial Optimization[END_REF][START_REF] Schrijver | Combinatorial Optimization -Polyhedra and Efficiency[END_REF].

The most common approach to solving the maximum weight matching problem is the primaldual schema-often called the Hungarian method [START_REF] Kuhn | The hungarian method for the assignment problem[END_REF] in the special case of bipartite graphs. For general graphs, this approach was initiated by Edmonds [START_REF] Edmonds | Maximum matching and a polyhedron with (0, 1) vertices[END_REF] and various later algorithms, such as [START_REF] Gabow | An efficient implementation of edmonds' algorithm for maximum matching on graphs[END_REF], can be regarded as refinements of Edmonds' algorithm. The idea is to build up feasible primal and dual solutions simultaneously and show that in the end, both solutions satisfy complementary slackness conditions and hence by the duality theorem, the primal solution is a maximum weight matching. Another approach in dealing with the maximum weight matching problem is to maintain a feasible matching and successively augment it to increase its weight, until no more augmentation is possible. The work of Cunningham and Marsh [START_REF] Cunningham | A primal algorithm for optimum matching. Polyhdedral Combinatorics-Dedicated to the Memory of D.R. Fulkerson[END_REF] (and also Derigs [START_REF] Derigs | A shortest augmenting path method for solving minimal perfect matching problems[END_REF]) can be regarded as representative of this approach.

A different approach, though still primal-dual in nature, was proposed by Kao et al. [START_REF] Kao | A decomposition theorem for maximum weight bipartite matchings[END_REF]. In the special case of bipartite graphs, they showed that the problem can be decomposed into W maximum cardinality matchings. Using the fastest maximum cardinality matching algorithms as a subroutine, their algorithm was faster than other algorithms when W is small. Their algorithm can be roughly described as follows. In the i-th iteration, only edges of weights higher than Wi are considered and in particular, only edges whose weight minus the vertex potentials (i.e., the dual solution) equals one are retained. Then a maximum cardinality matching is computed in the subgraph and this matching is subsequently used to update the vertex potentials. The final matching and the vertex potentials can be shown to satisfy the complementary slackness conditions.

In a preliminary version of the paper [START_REF] Huang | Efficient algorithms for maximum weight matchings in general graphs with small edge weights[END_REF], we showed that the same approach can be generalized to the case of general graphs. 1 The difficulty mostly lies in how to manipulate the "blossoms" of Edmonds' algorithm and update the more complicated dual variables. Throughout the paper, let n = |V | and m = |E|. We show that by using one of the fastest maximum cardinality matchings as a subroutine [START_REF] Goldberg | Maximum skew-symmetric flows[END_REF][START_REF] Mucha | Maximum matchings via gaussian elimination[END_REF], we can solve the maximum weight matching problem in O(W √ nm log n (n 2 /m)) time or in O(W n ω ) time with high probability, where ω ≈ 2.3728 is the exponent of matrix multiplication [START_REF] Gall | Power of tensors and fast matrix multiplication[END_REF]. Table 2.1 below has the running times of the various fastest maximum weight matching algorithms in general graphs. Subsequent to the preliminary version of this paper, Pettie [START_REF] Pettie | A simple reduction from maximum weight matching to maximum cardinality matching[END_REF] pointed out that the earlier algorithm of Gabow [START_REF] Gabow | A scaling algorithm for weighted matching on general graphs[END_REF] can be shown to achieve the same running time with a much simpler proof; in fact, he showed that Gabow's algorithm also can be regarded as decomposing the problem into W maximum cardinality matching problems. Compared to the previous algorithms [START_REF] Duan | Scaling algorithms for weighted matching in general graphs[END_REF][START_REF] Gabow | Data structures for weighted matching and nearest common ancestors with linking[END_REF][START_REF] Gabow | Faster scaling algorithms for general graph-matching problems[END_REF]], Gabow's algorithm [START_REF] Gabow | A scaling algorithm for weighted matching on general graphs[END_REF] and our algorithm (without using the algebraic algorithm [START_REF] Mucha | Maximum matchings via gaussian elimination[END_REF] as a subroutine) are faster when W = o(log n), and if the graph is very dense, i.e. m = Θ(n 2 ), then the two latter algorithms are faster when W = o(log 2 n). Compared to the algebraic algorithm [START_REF] Cygan | Algorithmic applications of baur-strassen's theorem: shortest cycles, diameter and matchings[END_REF], Gabow's algorithm and ours are always faster by a poly-log factor. [START_REF] Gabow | A scaling algorithm for weighted matching on general graphs[END_REF][START_REF] Pettie | A simple reduction from maximum weight matching to maximum cardinality matching[END_REF], this paper

O(W n ω ), O(W √ nm log n n 2 /m) Gabow, Pettie
In the present work, we give a new algorithm for solving the maximum weight matching problem in general graphs. This algorithm is significantly different from our previous one and its proof and presentation are much simpler. Additionally, our algorithm produces an integral optimal dual solution. This in turn gives a new proof to the fact that the linear program proposed by Edmonds to describe the matching polytope is totally dual integral. It is well-known that if a matrix A is totally unimodular and b, c are integral vectors, then max{c T x : Ax ≤ b, x ≥ 0} and min{y T b : y T A ≥ c T , y ≥ 0} are attained by integral vectors x and y whenever the optima exist and are finite [START_REF] Schrijver | Theory of Integer and Linear Programming[END_REF]. However total unimodularity is a very strong condition and in fact, the integrality of vectors x and y holds even under the weaker condition that the system of inequalities Ax ≤ b, x ≥ 0 is totally dual integral. Since TDI is a weaker sufficient condition for the polytopes {Ax ≤ b, x ≥ 0} and {y T A ≥ c T , y ≥ 0} to be integral (where b and c are integral vectors), it is interesting to know if a given system of inequalities is TDI.

Although the total dual integrality of the constraints describing Edmonds' matching polytope is well-known and there are several proofs for it [START_REF] Cook | Combinatorial Optimization[END_REF][START_REF] Cunningham | A primal algorithm for optimum matching. Polyhdedral Combinatorics-Dedicated to the Memory of D.R. Fulkerson[END_REF][START_REF] Hoffman | Local unimodularity in the matching polytope[END_REF], to the best of our knowledge, ours is the fastest algorithm to compute an integral optimal dual solution when W is small. Note that this dual solution is a witness or certificate to the optimality of our matching.

Our algorithm also gives rise to a decomposition theorem. In a graph G = (V, E) with edge weights in {1, . . . , W }, we show that the maximum weight of a matching is exactly W i=1 |M i |, where for each i ∈ {1, . . . , W }, M i is a maximum weight matching in a subgraph G i of G with the edge set E ′ i = {e ∈ E : w(e) ≥ W -(i -1)} and the weight function w i : E ′ i → {1, . . . , i} defined as w i (e) = w(e) -(Wi). In particular, we show the following equation:

|M i |= u∈V y i u + B∈Ω z i B |B|-1 2 - u∈V y i-1 u - B∈Ω z i-1 B |B|-1 2 ,
where ⟨y i u , z i B ⟩ (u∈V, B∈Ω) is an integral optimal solution to the dual program for the maximum weight matching program in the graph G i (note that y 0 u and z 0 B are just 0 for all u ∈ V and B ∈ Ω). Since the graph G W = G, the above equation yields the decomposition theorem. We show that this problem can also be decomposed into W unweighted (and capacitated) versions of the same problem. Using Orlin's new maximum flow algorithm [START_REF] Orlin | Max flows in o(nm) time, or better[END_REF] as a subroutine, we can solve the problem in O(W nm) time; in the case of simple b-matching (where c ≡ 1), we can use Gabow's algorithm [START_REF] Gabow | Data structures for weighted matching and nearest common ancestors with linking[END_REF] to solve the problem in O(W √ βm) time, where β = v∈A∪B b(e).

Maximum

Moreover, in the case that the graph G is very "unbalanced", i.e., the number of vertices on one side is much larger than the number on the other side, then we can use the algorithms of Ahuja et al. [START_REF] Ahuja | Improved algorithms for bipartite network flow[END_REF] as a subroutine, to solve the problem, in O(W (n

1 m + n 3 1 )), O(W (n 1 m + n 2 1 √ m)), O(W (n 1 m + n 2 1 √ log C)), or O(W n 1 m log(2 + n 2 1 m
)) time, where n 1 = min{|A|, |B|} and C = max e∈E c(e). See Table 2.2 for a summary of the fastest algorithms for this problem. As there are many parameters, it is difficult to compare the running time of these algorithms without resorting to case analysis. But in general, unless the largest capacity C = max e∈E c(e) is really large, the recent algorithm of Lee and Sidford [START_REF] Lee | Path finding ii : An Õ(m (n)) algorithm for the minimum cost flow problem[END_REF] is the fastest one. Compared to theirs, our algorithms are faster only when the graph is very unbalanced, i.e., when min{|A|, |B|} = o(n) and W is O(poly-log(m, C)).

Our second algorithm differs from the first in that it does not seek to find the feasible dual solution in each iteration. A final adjustment step is performed to show that the produced dual solution and the primal matching satisfy complementary slackness conditions.

Maximum Weight Matching in General Graphs

In this section we present our algorithm for computing a maximum weight matching in G = (V, E) with edge weights in {1, . . . , W }. As mentioned in Section 2.1, our algorithm also computes an integral optimal dual solution along with the optimal matching M W . We recall the linear program describing the matching polytope and its dual program below. Let Ω be the set of all odd sized

(c ≡ 1) O(W (n 1 m + n 3 1 )) this paper O(W (n 1 m + n 2 1 √ m)) this paper O(W (n 1 m + n 2 1 √ log C)) this paper O(W n 1 m log(2 + n 2 1 m ))
this paper subsets of V of size at least 3, also referred to as odd sets of vertices. For any set B ⊆ V , let E[B] be the set of edges (x, y) both of whose endpoints x and y belong to B. For any vertex v, let E(v) be the set of edges incident on v.

We first briefly review some classical concepts on which our algorithm is built: Edmonds' blossom algorithm and Gallai-Edmonds decomposition. We highlight the main features of the blossom algorithm. More details can be found in [START_REF] Lovász | Matching theory[END_REF][START_REF] Schrijver | Combinatorial Optimization -Polyhedra and Efficiency[END_REF]. In this and the next section, M (u) refers to the vertex that is matched to u under the matching M .

Petersen [START_REF] Petersen | Die theorie der regulären graphs[END_REF] observed as early as in 1891 that a matching M is of maximum cardinality if and only if there is no augmenting path with respect to M . It is not difficult to detect an augmenting path with respect to a given matching in bipartite graphs. But finding such a path in general graphs turns out to be more challenging. To overcome this difficulty, Edmonds introduced the idea of opening/closing blossoms. Definition 2.2.1. Let G = (V, E) be the original graph. Let G(V 1 ) be a shrunken graph of G, defined as follows.

(i) V 1 ⊂ V ∪ Ω, i.e., each vertex v ∈ V is either in V 1 or it belongs to an odd set in V 1 ∩ Ω, (ii) Edges in G(V 1 ) are induced by V 1 . More precisely, (a, b) is an edge in G(V 1 ) if and only if
there exists an edge (u, v) ∈ E so that (1) u = a or u ∈ a (where

a ∈ V 1 ∩ Ω), and (2) v = b or v ∈ b (where b ∈ V 1 ∩ Ω). max e∈E w e x e e∈E(v) x e ≤ 1 ∀v ∈ V e∈E[B]
x e ≤ |B|-1 2 ∀B ∈ Ω

x e ≥ 0 ∀e ∈ E.

min v∈V y v + B∈Ω z B |B|-1 2
y u + y v + B:e∈E[B] z B ≥ w e ∀e = (u, v) ∈ E y v ≥ 0 ∀v ∈ V z B ≥ 0 ∀B ∈ Ω Suppose G(V 1
) is a shrunken graph of G and M 1 is a matching in it. A set of vertices B = (a 0 , a 1 , . . . , a 2t ) is a blossom if (1) there exists a circuit traversing the vertices in B, i.e., (a i , a (i+1) mod 2t+1 ) ∈ E 1 for 0 ≤ i ≤ 2t, and (2) M (a 2i-1 ) = a 2i , for 1 ≤ i ≤ t. The first vertex a 0 is called the base of the blossom B. (Note that a 0 can be matched to some vertex in V 1 \ B, or it can be left unmatched.) Closing a blossom. Suppose B = (a 0 , a 1 , . . . , a 2t ) is a blossom. Then closing the blossom B means we form a new shrunken graph G(V 2 ), where

V 2 = (V 1 \{a i } 2t i=0 ) ∪ {B}, and a new matching M 2 in G(V 2 ) as follows: M 2 (a) = M 1 (a) if a ̸ ∈ B ∪ {M 1 (a 0 )}; M 2 (B) = M 1 (a 0 ).
Notice that once the blossom B is closed in G 1 (V 1 ) to form a new shrunken graph G(V 2 ), there can be another blossom B ′ in G(V 2 ). It can happen that B in G(V 2 ) (now a vertex in V 2 ) forms part of B ′ . In this case, B is said to be embedded in B ′ . A blossom not embedded in any other blossom is an outermost blossom. (Note that by definition, an outermost blossom must be a vertex in the last shrunken graph).

Definition 2.2.2. Opening a blossom. Let G(V 1 ) be an shrunken graph of G derived from G by a sequence of closing blossoms. Let M 1 a matching in G(V 1 ). Let B be an outermost blossom in V 1 and assume that B = (a 0 , a 1 , • • • , a 2t ), where a i s are the nodes corresponding to B when B is closed (note that a i can be a vertex or a blossom). Then opening the blossom B means that we form a new shrunken graph G(V 2 ), where

V 2 = (V 1 \{B}) ∪ {a i } 2t
i=0 and create a new matching M 2 in G(V 2 ) as follows:

• M 2 (a) = M 1 (a) if a ̸ ∈ B ∪ {M 1 (B)}. • If B is unmatched in M 1 , then a 0 is unmatched in M 2 as well and M 2 (a 2i-1 ) = a 2i , ∀1 ≤ i ≤ t. • If M 1 (B) = a ′ ∈ V 1
, then choose a k ∈ B so that there is an edge in E connecting a vertex in a ′ and a vertex in a k ; furthermore, let

M 2 (a (k+2i-1) mod (2t+1) ) = a (k+2i) mod (2t+1) , ∀1 ≤ i ≤ t; M 2 (a k ) = a ′ .
We now describe how Edmonds' blossom algorithm works. In each round, it seeks to find an augmenting path by building a Hungarian forest. A Hungarian forest is a disjoint set of trees, whose roots are unmatched nodes; every vertex in such a tree is connected to the root by an alternating path using the edges in the tree. In the process of building the Hungarian forest, a blossom may be detected. A detected blossom is then closed and the building of the Hungarian forest restarts with respect to the updated graph. After the closing of blossoms, if an augmenting path is found, then the matching is augmented along it. Furthermore, all blossoms are reopened (thus restoring the graph completely) and this round is terminated.

In the last round of the blossom algorithm, no augmenting path will be detected even after the closing of some blossoms. Let G = ( Ṽ , Ẽ) denote the final (updated) graph, M the current matching in it, and T the final Hungarian forest that was constructed. Some of the vertices in G can indeed be outermost blossoms. To avoid confusion, we refer to the vertices Ṽ in G as nodes.

Note that M is a maximum cardinality matching in G. By Tutte-Berge formula [12,[START_REF] Tutte | The factorization of linear graphs[END_REF], it can be shown that if we reopen all blossoms, then we have a maximum cardinality matching in the original graph. At the end of the blossom algorithm, we are left with a Hungarian forest and a set of matched edges in M (and the latter cannot be reached by any alternative path starting from a unmatched node). Together they encode the Gallai-Edmonds decomposition [START_REF] Edmonds | Paths, trees, and flowers[END_REF][START_REF] Gallai | Maximale systeme unabhängiger kanten[END_REF]:

• in T , we have a set of pairwise disjoint trees, whose roots are left unmatched in M . Each tree is composed of a set of alternating paths starting from the root. A node is odd (similarly, even) if there is an alternating path of odd (resp., even) length starting from the root to this node.

• we have also the remaining matched edges in M (that are not part of T ). The endpoint nodes of these matched edges are unreachable.

Furthermore,

• All blossoms are (or are contained in) even nodes.

• There is no edge in the original graph between an even node and an even/unreachable node in Ṽ (but notice that if an even node is a blossom, then G has some edges between its members).

• No edge between an odd node and an odd/unreachable node is present in M .

For convenience of presentation, in the following, when we say the Hungarian forest and use the notation T , we mean both the disjoint trees and those remaining matched edges not included in them.

We now show a simple proof that Edmonds' algorithm produces a maximum cardinality matching. Note that this proof is different from most found in the textbooks; it highlights the new ingredient in our approach.

Proposition 2.2.3. Let T be the Hungarian forest at the end of Edmonds' blossom algorithm, with the node set Ṽ ⊂ V ∪ Ω and M the corresponding matching. Then the matching M obtained by opening all blossoms in Ṽ is a maximum cardinality matching in G.

Proof. We show the optimality of M by constructing a dual solution ⟨y u , z B ⟩ (u∈V, B∈Ω) such that this dual solution and M together satisfy complementary slackness conditions. For each vertex v, the value y v is defined as follows:

• if v is an odd node in T , then y v = 1;
• if v is an even node in T or is contained in an even node, then y v = 0;

• let U ⊆ V be the set of remaining vertices -these are the unreachable vertices in T . Choose any one of them u * ∈ U ; set y u * = 1 and y u = 0 for the remaining vertices in u ∈ U \ {u * }.

For each odd set B ∈ Ω, the value z B is defined as follows:

• if B ∈ Ω is an outermost blossom in G, then z B = 1.
• if |U \ {u * }|≥ 2, then set z U \{u * } = 1; for the remaining odd sets B ∈ Ω, let z B = 0.

We now verify that ⟨y u , z B ⟩ (u∈V, B∈Ω) is a dual feasible solution in the original graph G: the non-negativity conditions obviously hold. We need to check that all edges are properly covered.

• Edges incident on an odd vertex v are clearly covered since y v = 1.

• It follows from Gallai-Edmonds decomposition that there is no edge between an even node and an even/unreachable node. If an edge e = (u, v) has both endpoints in the same even node B in T , then z B = 1.

• If an edge e = (u, v) is incident on an unreachable node u, then the other endpoint v is either an odd or an unreachable node. In the former case, y v = 1; in the latter case, either v = u * (then y u * = 1) or e ∈ E[U \ {u * }] (then z U \{u * } = 1).

We now show that M and the above dual solution ⟨y u , z B ⟩ (u∈V, B∈Ω) satisfy complementary slackness conditions:

• all vertices v ∈ V with y v > 0 are actually matched in M .

• all odd sets B with z B > 0 have exactly (|B|-1)/2 edges of E[B] matched in M ; this also includes the odd set B = U \ {u * }.

• every edge in M is between an odd node and an even node, or between 2 unreachable nodes, or within a blossom; thus all edges e = (u, v) ∈ M are tight, i.e.,

y u + y v + B:e∈E[B] z B = 1.
Hence by complementary slackness, ⟨y u , z B ⟩ (u∈V, B∈Ω) is dual optimal and M is primal optimal, i.e., M is a maximum cardinality matching in G.

A more well-known optimal dual (e.g., see [START_REF] Cook | Combinatorial Optimization[END_REF]Exercise 5.30]) is the following: all dual variables remain the same as defined in the proof above except for the following two changes: (1) all unreachable nodes v ∈ U have y u = 1/2, and (2) the odd set U \ {u * } has z U \{u * } = 0. In fact, this dual was used by the earlier version of our algorithm and also by the algorithm of Gabow. We choose not to use it because the final dual solution will only be half-integral here.

Observe that we use the variable z U \{u * } to cover all edges in E[U \ {u * }]. Roughly speaking, in our algorithm, we will regard the odd set U \ {u * } as a "pseudo-blossom". This pseudo-blossom is shrunk or contracted into a single node and gets matched to u * in M -we will show in the next section that this contraction lasts for exactly one iteration: this pseudo-blossom will be reopened during the next iteration. The details are described in the next section.

The Algorithm

Our algorithm runs for W iterations: in the i-th iteration, the algorithm computes a maximum weight matching M i in a graph

G i = (V, E ′ i )
, where

E ′ i = E W ∪• • •∪E W +1-i and E t = {e|w(e) = t} for W + 1 -i ≤ t ≤ W .
The edge weights in G i are given by the function w i : E ′ i → {1, . . . , i} defined as w i (e) = w(e) -(Wi) for e ∈ E ′ i . For simplicity of presentation, in case e ̸ ∈ E ′ i , we write w i (e) = 0.

The optimality of the matching M i in G i will be established via the dual variables y i u , for each u ∈ V , and z i B , for each B ∈ Ω. In the i-th iteration we compute integral values for these dual variables and ensure that the dual feasibility conditions ((2.1) and (2.5)) and complementary slackness conditions ((2.2), (2.3), and (2.4)) are satisfied by these dual values and the matching M i . This will establish the optimality of M i and these dual values in G i .

We will ensure that conditions (2.1)-(2.5) hold for all i ∈ {1, . . . , W } in our algorithm. In the last iteration, i.e., when i = W , the set E ′ W of edges in G W is the same as the original edge set E and its weight function w W coincides with the original weight function w. This will guarantee that M W is a maximum weight matching in the original graph G.

y i u + y i v + B: e∈E[B] z i B ≥ w i (e) ∀edges e = (u, v) in E ′ i
(2.1)

y i u + y i v + B: e∈E[B] z i B = w i (e) ∀edges e = (u, v) ∈ M i (2.2) y i u > 0 ⇒ u is matched in M i ∀ u ∈ V (2.3) z i B > 0 ⇒ |B|-1 2 edges of E[B] are in M i ∀ B ∈ Ω (2.4) y i u ≥ 0 and z i B ≥ 0 ∀ u ∈ V and B ∈ Ω. (2.5)
The graph G i and its function w i are introduced mainly to facilitate the proof. In implementation, our algorithm does not work with G i = (V, E ′ i ). The actual working graph is an unweighted graph H i = (V i , F i ). The vertex set V i ⊂ V ∪ Ω is decided by the previous iterations; the edge set

F i consists of edges e ∈ E ′ i that satisfy w i (e) -y i-1 u -y i-1 v -B:e∈E(B) z i-1 B = 1.
We now describe the i-th iteration: the graph is H i = (V i , F i ) and the starting matching is Mi-1 (inherited from the previous iteration) and it will be the case that Mi-1 ⊆ F i . Edmonds' blossom algorithm is called to augment Mi-1 into Mi . Let Ṽi be the resulting node set after the execution of Edmonds' algorithm. 2 Recall that Ṽi can be partitioned into O i ∪ U i ∪ E i , where O i is the set of odd nodes, U i is the set of unreachable nodes, and E i is the set of even nodes.

We then create a pseudo-blossom B * i to replace a subset of unreachable nodes, as discussed in the previous section, and a unreachable node u * i not in the subset is chosen to be B * i 's partner in Mi . (Note that the pseudo-blossom B * i is also closed as a regular blossom, i.e., the set of unreachable nodes in B * i are now replaced by a single node B * i and its incident edges are induced by the nodes contained in B * i and the nodes not in B * i .) We define the next round of dual variables ⟨y i u , z i B ⟩ (u∈V, B∈Ω) based on ⟨y i-1 u , z i-1 B ⟩ (u∈V, B∈Ω) and the decomposition O i ∪ U i ∪ E i . We will guarantee that in the i-th iteration, in H i , u * i-1 has no other incident edge except (u * i-1 , B * i-1 ) (see Inequality (2.7) in Lemma 2.2.4 and the discussion immediately before that lemma). This guarantees that the edge (u * i-1 , B * i-1 ) is never part of an augmenting path and the edge is never shrunk into other blossoms in the i-th iteration. Moreover, at the end of i-th iteration, either both B * i-1 and u * i-1 belong to U i or the former is in O i while the latter is in E i . In both cases, we will reopen the pseudo-blossom B * i-1 ; thus there will be at most one pseudo-blossom at the end of the i-th iteration. Note that opening a pseudo-blossom simply means to match the node originally matched with u * i-1 and restore the other originally matched edges contained in B * i-1 . We now give the algorithm formally below. Recall that for any e ∈ E, w i (e) = w(e) -(Wi).

1. Initialization:

y 0 v = 0 ∀v ∈ V ; z 0 B = 0 ∀B ∈ Ω; M0 = ∅; V 1 = V . 2. For i = 1 to W do (a) Let H i = (V i , F i ),
where

F i = {e = (u, v) ∈ E ′ i : w i (e) -y i-1 u -y i-1 v -B:e∈E[B] z i-1 B = 1}.
(b) Let Mi-1 be the initial matching in H i .

(c) Call Edmonds' blossom algorithm to augment Mi-1 so as to find a maximum cardinality matching Mi in H i .

(d) Let Ṽi be the resultant node set and let Ṽi = O i ∪ U i ∪ E i , where O i (similarly, U i or E i ) is the set of odd (resp., unreachable or even) nodes.

(e) If i = 1 then choose an arbitrary node u

* 1 ∈ U 1 . If |U 1 \ {u * 1 }|≥ 2, then replace U 1 \ {u * 1 } by a pseudo-blossom B *
1 and let (B * 1 , u * 1 ) ∈ M1 . Else (i.e., i > 1) then choose an arbitrary node

u * i ∈ U i \ {B * i-1 , u * i-1 }. • if |U i \ {B * i-1 , u * i-1 , u * i }|≥ 2, then replace this set by a pseudo-blossom B * i ; in case |U i \ {B * i-1 , u * i-1 , u * i }|= 1 and U i \ {B * i-1 , u * i-1 , u * i } is a blossom B, then let B * i = B. • let (B * i , u * i ) ∈ Mi .
[we now update the dual values: if no explicit update happens for vertex u, then

y i u = y i-1 u ; similarly z i B = z i-1 B
for any odd set B unless otherwise stated.]

(f) For each v ∈ V : if v ∈ O i or v ∈ B where B ∈ O i , then set y i v = y i-1 v + 1. (g) For each outermost blossom or pseudo-blossom B ∈ O i : set z i B = z i-1 B -1.
in H i , as long as Mi is an augmentation of Mi-1 (that is, a node matched in Mi-1 must be matched in Mi as well).

Then by building the Hungarian forest according to Mi , we can shrink the blossoms and the resultant matching and nodes sets will be Mi and Ṽi .

(h) If u * i is a vertex v ∈ V , then y i v = y i-1 v + 1. Else (u * i is a blossom B ∈ Ω) set y i v = y i-1 v + 1 for all v ∈ B and z i B = z i-1 B -1. (i) If B * i-1 ∈ U i , then set y i v = y i-1 v + 1 for each v ∈ B * i-1 and set z i B * i-1 = z i-1 B * i-1 -1.
(j) For each outermost blossom B ∈ E i and for B = B * i : set

z i B = z i-1 B + 1. (k) If u * i-1 is a blossom and is in U i , then set z i u * i-1 = z i-1 u * i-1 + 1.
(l) Suppose that B ∈ Ω \ {u * i } is a pseudo-blossom or an outermost blossom. If z i B = 0, then open the blossom B and recursively so any other blossom B ′ in B with z i B ′ = 0. (m) Let V i+1 be the current node set and let Mi be the corresponding matching.

3. Return the matching M W by opening all blossoms in MW .

Step 2 is the heart of the above algorithm and this step essentially consists of 2 parts: steps (a)-(e) compute the matching Mi while Steps (f)-(k) set the dual values. The matching Mi gets further updated in step (l) by opening out all outermost blossoms whose z-value becomes 0 and now if there are new "outermost" blossoms (these blossoms were earlier embedded but due to the outermost blossom getting opened, these embedded ones become outermost) with z-value 0, these get opened and so on. The last step defines the node set V i+1 to be used in the next iteration.

The steps that update the dual values here are analogous to how dual values are set in Proposition 2.2.3. Here we make y i u = y i-1 u + 1 for every vertex u in O i and this includes vertices that belong to blossoms in O i . For outermost blossoms B in O i , we decrease z i B by 1. The y-value for vertices in E i is unchanged and if B is an outermost blossom in E i , then we increase z i B by 1. The node u * i is treated as an odd node while B * i is treated as an even node. Thus we make y i u = y i-1 u + 1 for every vertex u in u * i and decrease the z-value of u * i by 1 (if u * i is a blossom) while the y-value for vertices in B * i is unchanged and we increase the z-value of B * i by 1. To compensate for this, in the (i + 1)-st iteration, u * i will get treated as an even node while B * i will get treated as an odd node -this is seen here in steps (j) and (k) where the dual variable values for u * i-1 and B * i-1 are updated: u * i-1 is treated as an even node while B * i-1 is treated as an odd node. Note that after we shrink the pseudo-blossom B * i and match it to u * i , the dual variables are set in such a way that in the next iteration, u * i has only one incident edge (u * i , B * i ) in H i+1 . This can be seen by Inequality (2.7).

Lemma 2.2.4. For each 1 ≤ i ≤ W , conditions (2.1)-(2.5) stated earlier hold, where M i is the matching derived from Mi by opening all blossoms; conditions (2.6) and (2.7) stated below hold as well.

There is at most one pseudo-blossom B * i in V i+1 and if such a B * i exists, then z i

B * i = 1. (2.6
)

Given e = (u, v) ∈ E ′ i , u = u * i (if u * i ∈ V ) or u ∈ u * i (if u * i ∈ Ω), and v / ∈ B * i ∪ u * i , then y i u + y i v + B:e∈E[B] z i B > w i (e).
(2.7)

Proof. We show by induction on i that conditions (2.1)-(2.7) hold for all 1 ≤ i ≤ W . The base case is i = 1. The matching M 1 is the maximum cardinality matching obtained by running Edmonds' algorithm in the graph H 1 and the setting of dual variables in the first iteration of our algorithm corresponds exactly to the setting of dual variables in Proposition 2.2.3. Thus by the same arguments as in the proof of Proposition 2.2.3, conditions (2.1)-(2.5) hold.

It is also easy to see that condition (2.6) holds as there is at most one pseudo-blossom B * 1 ∈ U 1 at the end of the first iteration. We now show condition (2.7). Since at the end of Edmonds' algorithm, all blossoms are in even nodes, it follows that u * 1 ∈ U 1 is a vertex in V and we have y 1

u * 1 = 1. Let e = (u * 1 , v) ∈ E ′ 1 where v / ∈ B * 1 .
Then v has to be in O 1 (as there are no edges in

U 1 × E 1 in F 1 and E ′ 1 = F 1
). Thus we have y 1 v = 1 and so y 1

u * 1 + y 1 v + B:e∈E[B] z i B ≥ 2 > w 1 (e) since w 1 (e) = 1.
We now assume conditions (2.1)-(2.7) hold for i = k -1 and show that conditions (2.1)-(2.7) corresponding to i = k hold as well.

Condition (2.1). We know by conditions (2.1) and (2.5) for i = k -1 that for any edge e = (u, v)

in E ′ k , we have y k-1 u + y k-1 v + B: e∈E[B] z k-1 B ≥ w k-1 (e)
. We now need to show the following inequality:

y k u + y k v + B: e∈E[B] z k B ≥ w k-1 (e) + 1 = w k (e). (2.8)
Consider first the case when e ∈ E[B], where We now consider the case when u and v are not inside the same blossom in Ṽk .

B ∈ Ṽk ∩ Ω. If B ∈ O k , then y k u = y k-1 u + 1, y k v = y k-1 v + 1, while z k B = z k-1 B -1.
If one of u, v is in O k , then y k u + y k v ≥ y k-1 u + y k-1 v + 1.
≥ y k-1 u , y k v ≥ y k-1 v , z k B = z k-1 B
= 0 for every odd set B containing e, and w k-1 (e) + 1 = w k (e), Inequality (2.8) again holds. The only case left is when one of u, v is in U k and the other is in

E k ∪ U k . Since F k has no edges in E k × U k , this means that y k-1 u + y k-1 v + B:e∈E[B] z k-1 B > w k-1 (e)
and we again have

y k-1 u + y k-1 v + B:e∈E[B] z k-1 B ≥ w k-1 (e) + 1 = w k (e). So Inequality (2.8)
holds. Finally, if both u and v are in U k and by listing all subcases here, it is easy to see that Inequality (2.8) holds. We show one particular subcase, which is when

u = u * k-1 (or u ∈ u * k-1
). Here we use condition (2.7)

for i = k -1 which states that if v / ∈ B * k-1 , then y k-1 u + y k-1 v + B:e∈E[B] z k-1 B > w k-1 (e). Thus Inequality (2.8) holds when v / ∈ B * k-1 and when v ∈ B * k-1 , Inequality (2.8) holds since y k v = y k-1 v + 1.

Condition (2.2)

. Let e = (u, v) be an edge in M k . It follows from the definition of the edge set

F k that y k-1 u + y k-1 v + B: e∈E[B] z k-1 B = w k-1 (e)
. By going through the same case analysis as in the proof of Inequality (2.8), we can show that

y k u + y k v + B: e∈E[B] z k B = w k (e).
For instance, when u, v ∈ V k (i.e., u and v do not belong to any odd set B ∈ V k ) and say u ∈ O k , then since an odd node can only be matched to an even node, it follows that v ∈ E k and thus

y k u = y k-1 u + 1 while y k v = y k-1 v and z k B = z k-1 B
= 0 for any odd set B containing (u, v). Thus we have

y k u + y k v + B: e∈E[B] z k B = (y k-1 u + 1) + y k-1 v + B: e∈E[B] z k-1 B = w k-1 (e) + 1 = w k (e).
Condition (2.3). We are given that y k u > 0 and there are two cases here: y k-1 u > 0 or y k-1 u = 0. Consider the former case -here it follows from condition (2.3) for i = k -1 that u was matched in M k-1 and we now show that u continues to be matched in M k . We first claim that all edges of Mk-1 are present in the edge set F k , i.e., step 2(b) is correct. This follows from condition (2.2)

for i = k -1: for each edge e = (u, v) ∈ M k-1 , we have w k (e) -y k-1 u -y k-1 v - B:e∈E[B] z k-1 B = (w k-1 (e) + 1) -y k-1 u -y k-1 v - B:e∈E[B] z i-1 B = 1.
Thus edge e ∈ F k . Now condition (2.3) follows from the fact that Mk is augmented from Mk-1 and the fact that (pseudo-)blossom opening guarantees that vertices matched in M k-1 remain matched in M k . Now consider the case y k-1 u = 0. For y k u to become positive, it must be the case

that u ∈ O k ∪ B * k-1 ∪ u * k (or u = u * k ). In all three cases, u is matched in M k . Condition (2.4
). This is similar to the above proof that condition (2.3) holds. We are given that z k B > 0 and if z k-1 B is also positive, then it means that the odd set B ∈ V k and B remains a blossom throughout the k-th iteration. By the definition of opening a blossom, it follows that when M k is derived from Mk , there are (|B|-1)/2 edges of

E[B] in M k . If z k-1 B = 0, then it means that the (pseudo-)blossom B was newly formed in the k-th iteration. So B ∈ Ṽk ∩ E k or B = B * k or B = u *
k-1 and it is easy to see that in all three cases, (|B|-1)/2 edges in E[B] are present in M k . Condition (2.5). The non-negativity of y k u for all vertices u is clear because y k u ≥ y k-1 u for each u ∈ V and by condition (2.5) for i = k -1, we have y k-1 u ≥ 0 for all u ∈ V . Regarding z k B , we claim that at the end of the (k -1)-st iteration, all outermost blossoms B ∈ V k , along with

B = B * k-1 , have z k B > 0, with the possible exception of u * k-1
. This is because of Step 2(l) where we recursively opened up all outermost blossoms and pseudo-blossoms B that satisfy z k-1 B = 0. Thus at the beginning of the k-th iteration, all outermost blossoms (other than possibly u * k-1 ) and pseudo-blossoms B satisfy z k B > 0. Hence in spite of decreasing by 1 the z k -value of some outermost blossoms and pseudo-blossom B * k-1 , at the end of the k-th iteration we maintain the condition that

z k B ≥ 0 for all B ∈ Ω. Condition (2.6). By condition (2.7) for i = k -1, in the edge set E ′ k-1 , the only edge incident on the node u * k-1 is (u * k-1 , B * k-1 ) in H i . Suppose there is some other edge e = (u, v), where u = u * k-1 (or u ∈ u * k-1 ) and v / ∈ B * k-1 ∪ u * k-1 , in the edge set F k .
Then it has to be the case that

y k-1 u + y k-1 v + B: e∈E[B] z k-1 B = w k-1 (e). Since e ∈ E ′ k \ E ′ k-1 , we have w k-1 (e) = 0 while we know that y k-1 u ≥ 1 since u = u * k-1 (or u ∈ u * k-1
). This contradicts the above equation as

y k-1 v and z k-1 B are non-negative for all v ∈ V and B ∈ Ω. Thus the only edge incident on u * k-1 in the graph H k is the edge (u * k-1 , B * k-1 ) ∈ Mk-1 .
Hence in the k-th iteration of the algorithm, neither u * k-1 nor B * k-1 belongs to any augmenting path and so these nodes also cannot become a part of a newly formed blossom. Thus they remain matched to each other during the k-th iteration.

If

B * k-1 is a pseudo-blossom, then by condition (2.6) for i = k -1, we have z k-1 B * k-1 = 1. So z k B * k-1 becomes 0 because either B * k-1 ∈ O k or B * k-1 ∈ U k ; hence we open up B *
k-1 at the end of the k-th iteration. By condition (2.7) for i = k -1, we also know that there is no other pseudo-blossom at the end of the (k -1)-st iteration. Thus there is at most one pseudo-blossom

B * k at the end of the k-th iteration. Finally, if B * k is a pseudo-blossom, then z k-1 B * k = 0, so z k B * k = 1. Condition (2.7). Suppose e = (u, v) is an edge in E ′ k with one endpoint u ∈ u * k and the other endpoint v / ∈ B * k ∪ u * k (
for simplicity of exposition, we assume u * k is a blossom here; the same proof holds when u * k is a vertex also). We consider two cases here:

(i) v ∈ E k ∪u * k-1 and (ii) v ∈ O k ∪B * k-1 . We know that F k has no edges in U k × E k , also we have seen in the proof of condition (2.6) that the only edge incident on u * k-1 in the graph H k is the edge (u * k-1 , B * k-1 ). Thus in case (i), i.e. when v ∈ E k ∪u * k-1 , there is no edge (u, v) in F k ; hence we have y k-1 u +y k-1 v + B: e∈E[B] z k-1 B > w k-1 (e).
Since

y k u = y k-1 u + 1, y k v ≥ y k-1 v , B: e∈E[B] z k B = B: e∈E[B] z k-1 B = 0 (as there is no blossom B ⊇ {u, v} either in V k or in V k+1 ) and w k (e) = w k-1 (e) + 1, we have y k u + y k v + B: e∈E[B] z k B > w k (e). We now consider case (ii). In this case v ∈ O k ∪ B * k-1 , so y k v = y k-1 v + 1 ≥ 1. We know that y k u = y k-1 u +1 ≥ 1. If e / ∈ E ′ k-1 , then w k (e) = 1. Thus we have y k u +y k v + B: e∈E[B] z k B ≥ 2 > w k (e). So suppose e ∈ E ′ k-1 . We have y k u + y k v + B: e∈E[B] z k B = (y k-1 u + 1) + (y k-1 v + 1) + B: e∈E[B] z k-1 B . Since y k-1 u + y k-1 v + B: e∈E[B] z k-1 B ≥ w k-1 (e) for all edges in E ′ k-1 , we have y k u +y k v + B: e∈E[B] z k B ≥ w k-1 (e)+2 ≥ w k (e)+1
. This finishes the proof that conditions (2.1)-(2.7) hold for i = k as well.

So for each i, M i is a matching in G i and ⟨y i u , z i B ⟩ (u∈V, B∈Ω) is a setting of dual variables such that conditions (2.1)-(2.5) are satisfied. This immediately proves that M i is an optimal solution for the primal program of the i-th iteration, in other words, M i is a maximum weight matching in the graph G i . Similarly, ⟨y i u , z i B ⟩ (u∈V, B∈Ω) is an (integral) optimal solution for the dual program of the i-th iteration. Hence we can conclude Theorem 2.2.5.

Theorem 2.2.5. The matching M W returned by the algorithm is a maximum weight matching. Furthermore, the variables ⟨y W u , z W B ⟩ (u∈V, B∈Ω) is an integral optimal solution for the dual program. Thus the linear program describing the matching polytope is totally dual integral.

Since the maximum weight matching problem in a graph G = (V, E) with edge weights in {1, . . . , W } can be solved as W maximum cardinality matching problems, we can draw the following computational conclusion. Recall that m and n are the number of edges and number of vertices in G, respectively. Theorem 2.2.6. The maximum weight matching problem in G can be solved in O(W √ nm log n (n 2 /m))

time, or in O(W n ω ) time with high probability, using the algorithms of [START_REF] Goldberg | Maximum skew-symmetric flows[END_REF][START_REF] Mucha | Maximum matchings via gaussian elimination[END_REF] as a subroutine, where ω ≈ 2.3728 is the exponent of matrix multiplication.

Proof. The bottleneck in each iteration is in step 2(c), where the maximum cardinality matching in H i gets computed, and we need to spend O( √ nm log n (n 2 /m)) or O(n ω ) time, using the algorithms of [START_REF] Goldberg | Maximum skew-symmetric flows[END_REF][START_REF] Mucha | Maximum matchings via gaussian elimination[END_REF]. Each of the other parts of Step 2 can be done in O(m) time.

In case we do not use Edmonds' blossom algorithm but use Mucha and Sankowski's algebraic algorithm in step 2(c), then to ensure condition (2.3), where we claim that the new maximum cardinality matching in H i is augmented from Mi-1 , we can do the following: first find any maximum cardinality matching in H i and let its cardinality be t. Create |V i |-2t dummy vertices and connect each of them to all nodes in V i that are left unmatched by Mi-1 . It is easy to see that there is now a perfect matching and we can find it by running the maximum cardinality matching algorithm again. Moreover, the perfect matching so found must guarantee that only the nodes in V i left unmatched by Mi-1 can be matched to the dummy vertices and the rest of the matching is the desired maximum cardinality matching Mi in H i . Then in step 2(d) we can build the Hungarian forest according to Mi to define the resulting vertex set Ṽi

= O i ∪ U i ∪ E i in O(m) time.

Consequences of the above algorithm: a decomposition theorem

Our algorithm gives rise to the following decomposition theorem in a graph G = (V, E) with edge weights in {1, . . . , W }. Define graphs G 1 , . . . , G W as follows:

G i = (V, E ′ i ) where E ′ i = {e ∈ E : w(e) ≥ W -(i -1)} with edge weight function w i (e) = w(e) -(W -i) for each e ∈ E ′ i .
Theorem 2.2.7. There exist matchings M 1 , . . . , M W and dual solutions ⟨y i u , z i B ⟩ (u∈V, B∈Ω) for i = 1, . . . , W such that the following properties hold:

1. For 1 ≤ i ≤ W , M i is a maximum weight matching in G i and ⟨y i u , z i B ⟩ (u∈V, B∈Ω) is an optimal dual solution. 2. For 1 ≤ i ≤ W , ⟨y i u , z i B ⟩ (u∈V, B∈Ω
) is an integral solution; furthermore, the set of odd sets B with z i B > 0 forms a laminar family.

For

1 ≤ i ≤ W , |M i |= u∈V y i u + B∈Ω z i B |B|-1 2 -u∈V y i-1 u -B∈Ω z i-1 B |B|-1 2 , where y 0 u = 0 ∀ u ∈ V and z 0 B = 0 ∀ B ∈ Ω.
4. The maximum weight of a matching in G is equal to

W i=1 |M i |.
Proof. For 1 ≤ i ≤ W , we will show that the matching M i and the dual solution ⟨y i u , z i B ⟩ (u∈V, B∈Ω) computed in the i-th iteration of our algorithm satisfy all the 4 parts of the above theorem. Part 1 is a corollary of Lemma 2.2.4.

Part 2 follows in a straightforward manner from our algorithm -it is easy to see that y i u and z i B are integral for all vertices u and odd sets B. The fact that the sets B with z i B > 0 form a laminar family follows from how the node set Ṽi is formed and how the z-values are assigned.

We now show part 3 of the above theorem. It follows from conditions (2.1)-(2.5) that

e∈Mi w i (e) = u∈V y i u + B∈Ω z i B |B|-1 2 .

29

We know that for each edge e, w i (e) = w i-1 (e) + 1. Thus

e∈Mi w i (e) = e∈Mi w i-1 (e) + |M i |. Since every edge used in M i belongs to the edge set F i , we have w i-1 (e) = y i-1 u + y i-1 v + B:e∈E[B] z i-1 B
for edge e = (u, v) ∈ M i . Also, the vertices that are not matched in M i are unmatched in M i-1 as well. Thus y i-1 u = 0 for all vertices unmatched in M i (by condition (2.3)). Hence we have

u∈V y i u + B∈Ω z i B |B|-1 2 = |M i | + u∈V y i-1 u + e∈Mi B:e∈E[B] z i-1 B . What is left to show is that e∈Mi B:e∈E[B] z i-1 B = B∈Ω z i-1 B |B|-1 2
. By rearranging the terms in the sum, we have e∈Mi B:e∈E

[B] z i-1 B = B∈Ω z i-1 B • |E[B] ∩ M i |. Thus what is left to show is that for each B ∈ Ω with z i-1 B > 0, exactly (|B|-1)/2 edges of E[B] are present in M i .
Consider any such B. Since z i-1 B > 0, at the beginning of the i-th iteration of our algorithm, the odd set B is shrunk in the node set Ṽi . At the end of the i-th iteration, either z i B > 0 in which case (|B|-1)/2 edges of B are present in M i (by condition (2.4)) or z i B becomes 0 in which case by the process of opening a blossom, (|B|-1)/2 edges of E[B] are present in M i . This completes the proof of part 3.

Part 4 follows from adding the equations of part 3 for all i ∈ {1, . . . , W }. Since the right hand side consists of a cascading sum and y 0 u = 0 for all u and z 0 B = 0 for all B, this results in

M i=1 |M i | = u∈V y W u + B∈Ω z W B |B|-1 2 .
We also know that the above right side is the optimum value for the dual program in the W -th iteration. So this equals the value of the optimal primal solution, which is the maximum weight of a matching in G W . Since G W = G, the maximum weight of a matching in G equals

W i=1 |M i |.
It may be tempting to try to generalize the following decomposition theorem of Kao et al. [START_REF] Kao | A decomposition theorem for maximum weight bipartite matchings[END_REF] to the context of general graphs.

Theorem 2.2.8 (from [START_REF] Kao | A decomposition theorem for maximum weight bipartite matchings[END_REF]). Let G be bipartite. Let G ′ be G i with the weight function w i for some i ∈ {1, . . . , W }. Let ⟨y i u ⟩ u∈V be any minimum weight cover in G i and G ′′ be the subgraph of G with the edge set {e = (a, b) : w(e)y i ay i b > 0} with weight of edge e given by w(e) = w(e)y i ay i b . Then the maximum weight of a matching in G is equal to the sum of the maximum weights of a matching in G ′ and in G ′′ .

Unfortunately, the above theorem with w(e) updated to w(e)y i uy i u -B:e∈E[B] z i B for e = (u, v) need not hold in non-bipartite graphs. Consider the example in Figure 2.1.

The maximum weight of a matching in G is 5. Let G ′ = G 1 , so the weight function is w 1 (e) = w(e) -2; thus we have w 1 (e) = 1 for e ∈ {(a, b), (b, c), (c, a)} while w 1 (e) ≤ 0 for e ∈ {(a, x), (b, y), (c, z)}. The maximum weight of a matching in G ′ is 1 and there is a unique optimal dual solution: z 1 {a,b,c} = 1; all other z-values and y-values are 0. In G ′′ , the weight of edge e

= (u, v) is w(e) = w(e) -y 1 u -y 1 v -B:e∈E[B] z 1 B (see Figure 2.2).
The maximum weight of a matching in G ′′ is 5. However the maximum weight of a matching in G is not 1 + 5 = 6.

1 1 1 2 2 2 2 1 2 a b c a b c x y z G ′ G ′′ Figure 2.2:
In the graph G ′ , the edges with non-positive weight have not been shown above. The weight of a maximum weight matching in G ′ is 1 and that in G ′′ is 5.

Maximum Weight Bipartite Capacitated b-matching

The input here is a bipartite graph G = (A ∪ B, E) where as before, there is a weight function w : E → {1, . . . , W }. Associated with each vertex is a quota given by b : A ∪ B → Z + and the goal is to compute a b-matching of maximum weight. A b-matching is a subset M ⊆ E such that for any vertex u, at most b(u) edges incident on u are present in M . When b(u) = 1 for each vertex u, the resulting b-matching is the standard matching studied in the previous section.

In fact, here we consider an even more generalized concept called "capacitated b-matchings": several copies of an edge e can be present in M . That is, there is an edge capacity function c : E → Z + and up to c(e) copies of edge e are allowed in M . Recall that E(v) is the set of edges incident on vertex v. For any vertex v, we assume that b(v) ≤ e∈E(v) c(e).

Associated with every capacitated b-matching M is an m-tuple (M (e 1 ), . . . , M (e m )) where 0 ≤ M (e i ) ≤ c(e i ) for every edge e i . For simplicity, we refer to capacitated b-matchings as bmatchings here. When w(e) = 1 for all edges e, a maximum weight b-matching M maximizes e∈E M (e), so we will call such a matching a maximum cardinality b-matching. We will solve the maximum weight b-matching problem in bipartite graphs by reducing it to several instances of the maximum cardinality b-matching problem. We will use the following terminology here.

• An edge e is saturated in M if M (e) = c(e), otherwise, e is unsaturated. Similarly, a vertex v is saturated if e∈E(v) M (e) = b(v), otherwise v is unsaturated.
• An edge e with M (e) > 0 is a positive edge.

Definition 2.3.1. An alternating path with respect to a b-matching M is a path p = ⟨e 0 , e 1 , . . . , e k ⟩ in G such that e 0 , e 2 , . . . are unsaturated edges while e 1 , e 3 , . . . are positive edges. That is, unsaturated edges and positive edges alternate in p.

An alternating path p of odd length with respect to a b-matching M such that both the endpoints of p are unsaturated in M is also called an "augmenting path" with respect to M . It is easy to see that a maximum cardinality b-matching admits no augmenting path with respect to it. We present below a generalization of the coarse version of Dulmage-Mendelsohn decomposition of bipartite graphs [START_REF] Dulmage | Coverings of bipartite graphs[END_REF]. We first need the following definition.

Definition 2.3.2. Let M be a maximum cardinality b-matching in G = (A ∪ B, E).
• Let E A ⊆ A (similarly, O B ⊆ B) be the set of vertices reachable from an unsaturated vertex in A via an alternating path of even (resp., odd) length with respect to M .

• Let E B ⊆ B (similarly, O A ⊆ A) be the set of vertices reachable from an unsaturated vertex in B via an alternating path of even (resp., odd) length with respect to M . (2) all vertices in

• Let U A = A \ (E A ∪ O A ) and let U B = B \ (E B ∪ O B ). Proposition 2.3.3. Let M be a maximum cardinality b-matching in G = (A ∪ B, E) and E A , E B , O A , O B , U A , U B be
O A ∪ O B ∪ U A ∪ U B are saturated in M ′ . (3) there is no positive edge in (U A ∪ O A ) × O B or in O A × U B in M ′ . (4) every edge in E A × (E B ∪ U B ) is saturated in M ′ ; so is every edge in U A × E B in M ′ .
Proof. To show (1), we first show that O A , E A , and U A are disjoint from one another. It follows from the definition of

U A that U A ∩ (E A ∪ O A ) = ∅. So what is left to show is that E A ∩ O A = ∅. Suppose v ∈ E A ∩ O A -
then gluing p 1 and p 2 till their first common vertex yields an augmenting path p with respect to M , where p 1 is the even length alternating path between some unsaturated vertex a ∈ A and v (such a path p 1 exists because v ∈ E A ) and p 2 is the odd length alternating path between some unsaturated vertex b ∈ B and v (such a path p 2 exists because v ∈ O A ). The augmenting path p contradicts that M is a maximum cardinality b-matching. A similar argument shows that O B , E B , and U B are disjoint from one another. This finishes the proof of (1).

In the following, we first prove (2)-( 4) assuming that M ′ = M ; we will later remove this assumption.

It follows from the definition of U A and U B that every vertex u in U A ∪U B has to be saturated in M (otherwise there is a length zero alternating path from an unsaturated vertex to u, contradicting that u ∈ U A ∪U B ). If a vertex a ∈ O A is unsaturated, then there is an alternating path of odd length from some unsaturated vertex in B to the unsaturated vertex a, i.e., M admits an augmenting path, a contradiction. Similarly every vertex in O B is saturated. This finishes the proof of (2) when M ′ = M .

Suppose there is an edge e ∈ O A × O B such that M (e) > 0. Let e = (u, v). Then we can again show an augmenting path with respect to M between an unsaturated vertex a ∈ A and an unsaturated vertex b ∈ B using the paths p 1 , p 2 , and the edge (u, v), where p 1 is the (odd length) a-u alternating path and p 2 is the (odd length) b-v alternating path. Similarly, if e = (u, v) in U A × O B satisfies M (e) > 0, then there is an alternating path from some unsaturated vertex in A to u; this contradicts the fact that u ∈ U A . Similarly, there is no positive edge in O A × U B . This finishes the proof of (3) when M ′ = M .

Suppose there is an edge e ∈ E A × E B such that M (e) < c(e). Let e = (u, v). Then we can again show an augmenting path between some unsaturated vertex a ∈ A and some unsaturated vertex b ∈ B using p 1 , p 2 , and (u, v), where p 1 is the (even length) a-u alternating path and p 2 is the (even length) b-v alternating path. Similarly, if e = (u, v) in U A × E B satisfies M (e) < c(e), then there is an alternating path between some unsaturated b ∈ B and u; this contradicts the fact that u ∈ U A . Similarly, there is no unsaturated edge in E A × U B . This finishes the proof of ( 4) when M ′ = M .

We now remove the assumption that M ′ = M . Let M ′ be an arbitrary maximum cardinality b-matching in G. Let us define a bipartite directed flow f as follows: It is well known, e.g., [START_REF] Ahuja | Network Flows: Theory, Algorithms, and Applications[END_REF] that f can be decomposed into a set of cycle flows C i and a set of path flows P j by a greedy algorithm. By (i) and (ii), the cycle C i consists entirely of vertices in

f (e) = |M ′ (e) -M (e)|.

The direction of the edge

e = (u, v) under f is from u to v if M ′ (e) > M (e) and from v to u if M ′ (e) < M (e). It is clear that M ′ is
E A ∪ O A or E B ∪ O B .
Furthermore, by (iii), the starting and ending vertices of P j can only be in E A ∪ E B . By (i) and (ii), P j cannot start from E A and end in E B . Moreover, we cannot have P j start from E B and end in E A , as it would imply an augmenting path in M ′ from E A to E B . We can thus conclude that the cycle C i and P j consist entirely of vertices in

E A ∪ O A or in E B ∪ O B and the proof follows. Note that if a maximum cardinality b-matching M is given, the decomposition A = O A ∪E A ∪U A and B = O B ∪ E B ∪ U B with
y v ≥ 0 ∀v ∈ A ∪ B. z e ≥ 0 ∀e ∈ E.
Our algorithm is similar in spirit to the algorithm from Section 2.2.1 but it also has some subtle differences from that one. The algorithm here also runs for W iterations, where W = max e∈E w(e).

In the first iteration, we consider only edges of weight W : this is the graph H 1 . We compute a maximum cardinality b-matching M 1 here and assign vertex potentials y 1 u ; however not all edges get covered by these vertex potentials, i.e., there exist edges e = (a, b) in H 1 such that y 1 a = y 1 b = 0. More precisely, all the uncovered edges are in

E 1 A ×(E 1 B ∪U 1 B ); we also know from Proposition 2.3.3(4) that each edge in E 1 A × (E 1 B ∪ U 1 B ) is saturated in M 1 .
In fact, this will be an important invariant that we will maintain: every uncovered or "not fully paid for" edge will be saturated. In general, in iteration i we have an unsatisfied set

Ψ i ⊆ E, which consists of those edges e = (a, b) such that y i-1 a + y i-1 b < w i-1 (e)
and it will be the case that e is saturated by the previous maximum cardinality b-matching M i-1 .

In the i-th iteration, the algorithm works with the unweighted graph

H i = (A ∪ B, F i ),
where

F i = {e = (a, b) ∈ E : w i (e) -y i-1 a -y i-1 b = 1} and w i (e) = w(e) -(W -i).
Furthermore, the quotas of the vertices are updated according to the unsatisfied set

Ψ i-1 , namely, b i (v) = b(v) -e∈Ψi-1∩E(v) c(e)
, where E(v) is the set of edges incident on vertex v. Our task is to obtain a maximum cardinality b-matching in H i , where vertex quotas are described by the function b i ; we obtain such a matching M ′ i by augmenting M i-1 \ Ψ i-1 in the graph H i . The matching M i will be M ′ i along with all edges in Ψ i-1 (these edges are all saturated). We will show that the final matching M W is a maximum weight b-matching in G. We present our algorithm below.

Initialization:

Set M 0 = ∅, Ψ 0 = ∅, and y 0 v = 0 ∀v ∈ V . 2. For i = 1 to W do (a) For each e ∈ E: let w i (e) = w(e) -(W -i). (b) Construct H i = (A ∪ B, F i ),
where

F i = {e = (a, b) : w i (e) -y i-1 a -y i-1 b = 1}. (c) For each v ∈ A ∪ B do: set b i (v) = b(v) -e∈Ψi-1∩E(v) c(e).
(d) Find a maximum cardinality b-matching M ′ i in H i (where the quotas of vertices are given by b i ) by augmenting

M i-1 \ Ψ i-1 in H i . (e) Using M ′ i , partition A = O i A ∪ E i A ∪ U i A and B = O i B ∪ E i B ∪ U i B . • for each v ∈ O i A ∪ O i B ∪ U i A do: set y i v = y i-1 v + 1. • for each v ∈ E i A ∪ E i B ∪ U i B do: set y i v = y i-1 v . (f) Let M i be M ′ i ∪ Ψ i-1 , where M i (e) = c(e) for each e ∈ Ψ i-1 . (g) Let S i = {e = (a, b) ∈ F i where a ∈ E i A and b ∈ E i B ∪ U i B }; let C i = {e = (a, b) ∈ Ψ i-1 such that w i (e) -y i a -y i b = 0}. (h) Ψ i = (Ψ i-1 \ C i ) ∪ S i . 3. Return M W .
It follows from the definition of F i and from Step 2(e) (where vertex potentials are updated) that those edges of F i with at least one endpoint in

O i A ∪ O i B ∪ U i
A are covered or paid for while those with both endpoints in

E i A × (E i B ∪ U i B ) are uncovered or not fully paid for. The edges of F i in E i A × (E i B ∪ U i B )
form the set S i and these are added to the set Ψ i in Step 2(h). Regarding the edges that are already in the set Ψ i-1 , it could be the case that some of them get covered now (due to Step 2(e) where vertex potentials are updated) -for this to happen, it is necessary that both the endpoints of such an edge are in

O i A ∪ O i B ∪ U i A .
These newly covered edges form the set C i and these are no longer present in the unsatisfied set Ψ i .

Lemma 2.3.4. For each 1 ≤ i ≤ W , the above algorithm maintains conditions (2.9)-(2.13) listed below.

y i a + y i b ≥ w i (e) ∀ edges e = (a, b) ∈ E \ Ψ i (2.9
)

y i a + y i b < w i (e) and M i (e) = c(e) ∀ e ∈ Ψ i
(2.10)

y i u > 0 ⇒ u is saturated in M i ∀ u ∈ A ∪ B (2.11) y i a + y i b = w i (e) ∀edges e = (a, b) ∈ F i \ S i such that M ′ i (e) > 0
(2.12)

y i u ≥ 0 ∀ u ∈ A ∪ B.
(2.13)

Proof. We show by induction on i that conditions (2.9)-(2.13) hold for all 1 ≤ i ≤ W . The base case corresponds to i = 1. The set

Ψ 1 = E 1 A × (E 1 B ∪ U 1 B )
and it is easy to see that conditions (2.9)-(2.13) for i = 1 follow from Proposition 2.3.3 and from how y 1 u -values are set in Step 2(e). We now assume that conditions (2.9)-(2.13) hold when i = k -1 and show that the conditions corresponding to i = k hold as well. To show condition (2.9)

for i = k, assume that e ∈ E \ Ψ k . If e ∈ Ψ k-1 \ Ψ k , then e has to be in C k , in other words, w k (e) = y k a + y k b . So we can henceforth assume that e / ∈ Ψ k-1 . So y k-1 a + y k-1 b ≥ w k-1 (
e) by induction hypothesis. We consider two cases here:

(i) e ∈ F k and (ii) e / ∈ F k . Since F k consists of edges e = (a, b) such that w k (e)-y k-1 a -y k-1 b = 1 and w k (e) = w k-1 (e)+1, it is easy to see that F k is exactly the set of those edges e = (a, b) such that y k-1 a +y k-1 b = w k-1 (e). If e / ∈ F k , then we have y k-1 a + y k-1 b > w k-1 (e), that is, y k-1 a + y k-1 b ≥ w k-1 (e) + 1. So we have y k a + y k b ≥ y k-1 a + y k-1 b ≥ w k-1 (e) + 1 = w k (e).
So suppose e ∈ F k . In this case, at least one of {a, b} has to be in

O k A ∪ O k B ∪ U k A , otherwise e ∈ S k and thus e ∈ Ψ k . Since a or b (or both) is in O k A ∪ O k B ∪ U k A , we have y k a + y k b ≥ y k-1 a + y k-1 b + 1 = w k-1 (e) + 1 = w k (e).
Thus condition (2.9) holds for i = k.

We now show condition (2.10

) for i = k. The set Ψ k = (Ψ k-1 \ C k ) ∪ S k .
It is easy to see that every e = (a, b) ∈ S k satisfies y k a + y k b < w k (e) and M k (e) = c(e): this is because every such edge belongs to

F k ∩ (E k A × (E k B ∪ U k B )), thus w k (e) = w k-1 (e) + 1 = y k-1 a + y k-1 b + 1 = y k a + y k b + 1 and by Proposition 2.3.3.4, M k (e) = c(e).
We now consider the case when e ∈ Ψ k-1 \ C k . By induction hypothesis, every edge e = (a, b) in Ψ k-1 satisfies y k-1 a + y k-1 b < w k-1 (e) and M k-1 (e) = c(e). In the k-th iteration we have

y k a + y k b ≤ y k-1 a + y k-1 b + 2 ≤ w k-1 (e) + 1 = w k (e).
We are given that e / ∈ C k , so

y k a + y k b ̸ = w k (e). Thus y k a + y k b < w k (e). Since e is in Ψ k-1 , it follows that M k (e) = c(e).
We now show condition (2.11) for i = k. We are given that

y k u > 0. If y k-1 u > 0, then it follows from induction hypothesis that u is saturated in M k-1 ; since M ′ k is obtained by augmenting M k-1 \ Ψ k-1 and M k = M ′ k ∪ Ψ k-1 , it follows that e∈E(u) M k-1 (u) = e∈E(u) M k (u), thus u is saturated in M k . If y k-1 u = 0, then it must be the case that y k u ∈ O k A ∪ O k B ∪ U A and it follows from Proposition 2.3.3.2 that u is saturated in M k .
We now show condition (2.12) for i = k. Let e = (a, b) be an edge such that

M ′ k (e) > 0. We know that M ′ k is a maximum cardinality b-matching in H k : since the edge set of H k is F k , this implies that y k-1 a + y k-1 b = w k-1 (e). We also know that e / ∈ S k . It follows from Proposition 2.3.3.3 that e ∈ (O k A × E k B ) ∪ (E k A × O k B ) ∪ (U k A × E k B ). So we have y k a + y k b = y k-1 a + y k-1 b + 1. So y k a + y k b = y k-1 a + y k-1 b + 1 = w k-1 (e) + 1 = w k (e).
It is easy to see that condition (2.13) holds. Initially y 0 u = 0 for all vertices u and Step 2(e) (where certain y i u values increase) is the only step where the y i u values get updated. Thus y k u ≥ 0 for all u.

Conclusions and Open Problems

We considered the maximum weight matching problem in G = (V, E) with integral edge weights.

We solved this problem via the maximum cardinality matching algorithm -the running time of our algorithm is W times the running time of a maximum cardinality matching algorithm, where W is the largest edge weight. This running time is as good as the current fastest algorithms for the maximum weight matching problem. Our algorithm also computed an optimal dual solution that is integral, thereby showing an integral certificate to the optimality of the computed matching.

We then extended this approach to the maximum weight capacitated b-matching problem in bipartite graphs, where edge weights are in {1, 2, . . . , W }. We showed that this problem can also be decomposed into W unweighted and capacitated versions of the same problem. An open problem is to extend this approach to the maximum weight b-matching problem in general graphs.

Chapter 3

Exact and Approximation Algorithms for Weighted Matroid Intersection

This paper first appeared in SODA 2016 and its full version will appear in Mathematical Programming. It is joint-work with Naonori Kakimura and Naoyuki Kamiyama.

Abstract In this paper, we propose new exact and approximation algorithms for the weighted matroid intersection problem. Our exact algorithm is faster than previous algorithms when the largest weight is relatively small. Our approximation algorithm delivers a (1ϵ)-approximate solution with a running time significantly faster than most known exact algorithms.

The core of our algorithms is a decomposition technique: we decompose an instance of the weighted matroid intersection problem into a set of instances of the unweighted matroid intersection problem. The computational advantage of this approach is that we can make use of fast unweighted matroid intersection algorithms as a black box for designing algorithms. More precisely, we show that we can solve the weighted matroid intersection problem via solving W instances of the unweighted matroid intersection problem, where W is the largest given weight, assuming that all given weights are integral. Furthermore, we can find a (1ϵ)-approximate solution via solving O(ϵ -1 log r) instances of the unweighted matroid intersection problem, where r is the smaller rank of the two given matroids. Our algorithms make use of the weight-splitting approach of Frank [START_REF] Frank | A weighted matroid intersection algorithm[END_REF] and the geometric scaling scheme of Duan and Pettie [START_REF] Duan | Linear-time approximation for maximum weight matching[END_REF].

Our algorithms are simple and flexible: they can be adapted to special cases of the weighted matroid intersection problem, using specialized unweighted matroid intersection algorithms. In addition, we give a further application of our decomposition technique: we solve efficiently the rank-maximal matroid intersection problem, a problem motivated by matching problems under preferences.

Introduction

In the classical weighted matroid intersection problem, we are given two matroids M 1 = (S, I 1 ), M 2 = (S, I 2 ) and a weight function w: S → Z ≥0 , where Z ≥0 is the set of non-negative integers. Then, the goal is to find a maximum-weight common independent set I of M 1 and M 2 , i.e., I ∈ I 1 ∩ I 2 with e∈I w(e) being maximized. This problem was introduced by Edmonds [START_REF] Edmonds | Submodular functions, matroids, and certain polyhedra[END_REF][START_REF] Edmonds | Matroid intersection[END_REF] and solved by Edmonds [START_REF] Edmonds | Submodular functions, matroids, and certain polyhedra[END_REF][START_REF] Edmonds | Matroid intersection[END_REF] and others [START_REF] Aigner | Matching theory for combinatorial geometries[END_REF][START_REF] Iri | An algorithm for finding an optimal "independent assignment[END_REF][START_REF] Lawler | Optimal matroid intersections[END_REF][START_REF] Lawler | Matroid intersection algorithms[END_REF] in 1970s. This problem is a common generalisation of various combinatorial optimization problems such as bipartite matchings, packing spanning trees, and arborescences in a directed graph. In addition, it has many applications, e.g., in electric circuit theory [START_REF] Murota | Matrices and matroids for systems analysis[END_REF][START_REF] Recski | Matroid theory and its applications in electric network theory and in statics[END_REF], rigidity theory [START_REF] Recski | Matroid theory and its applications in electric network theory and in statics[END_REF], and network coding [START_REF] Dougherty | Network coding and matroid theory[END_REF]. The fact that two matroids capture the underlying common structures behind a large class of polynomially solvable problems has been impressive and motivated substantial follow-up research (see, e.g., [START_REF] Fujishige | Submodular functions and optimization[END_REF][START_REF] Schrijver | Combinatorial optimization: Polyhedra and efficiency[END_REF]). Techniques and theorems developed surrounding this problem have become canon in contemporary combinatorial optimization literature.

Since 1970s, quite a few algorithms have been proposed for matroid intersection problems, e.g., [START_REF] Brezovec | Two algorithms for weighted matroid intersection[END_REF][START_REF] Cunningham | Improved bounds for matroid partition and intersection algorithms[END_REF][START_REF] Frank | A weighted matroid intersection algorithm[END_REF][START_REF] Fujishige | An efficient cost scaling algorithm for the independent assignment problem[END_REF][START_REF] Shigeno | A dual approximation approach to weighted matroid intersection[END_REF], with better running time and/or simpler proofs. See Table 3.1 for a summary. Throughout the paper, n is the size of the ground set S, r is the smallest rank of the two given matroids, and W is the largest given weight. The oracle to check the independence of a given set has the running time of τ . Table 3.1: Matroid intersection algorithms for general matroids. See also [START_REF] Edmonds | Submodular functions, matroids, and certain polyhedra[END_REF][START_REF] Edmonds | Matroid intersection[END_REF][START_REF] Pap | A matroid intersection algorithm[END_REF]. The complexity is measured only by the number of independence oracle calls. In case the original algorithms (Fujishige-Zhang and Gabow-Xu) use (co-)circuit oracles, each call of such oracles is replaced by n independence calls in the table.

Algorithm

Weight Time complexity Aigner-Dowling [START_REF] Aigner | Matching theory for combinatorial geometries[END_REF] Unweighted O(τ nr 2 ) Cunningham [START_REF] Cunningham | Improved bounds for matroid partition and intersection algorithms[END_REF], Gabow-Xu [START_REF] Gabow | Efficient theoretic and practical algorithms for linear matroid intersection problems[END_REF] Unweighted O(τ nr 1.5 ) Lawler [START_REF] Lawler | Optimal matroid intersections[END_REF][START_REF] Lawler | Matroid intersection algorithms[END_REF], Iri-Tomizawa [START_REF] Iri | An algorithm for finding an optimal "independent assignment[END_REF] Weighted O(τ nr 2 ) Frank [START_REF] Frank | A weighted matroid intersection algorithm[END_REF] Weighted O(τ n 2 r) Brezovec-Cornuéjols-Glover [START_REF] Brezovec | Two algorithms for weighted matroid intersection[END_REF] Weighted O(τ nr 2 ) Fujishige-Zhang [START_REF] Fujishige | An efficient cost scaling algorithm for the independent assignment problem[END_REF],

Shigeno-Iwata [START_REF] Shigeno | A dual approximation approach to weighted matroid intersection[END_REF], Gabow-Xu [START_REF] Gabow | Efficient theoretic and practical algorithms for linear matroid intersection problems[END_REF] Weighted

O(τ n 2 √ r log rW ) Lee-Sidford-Wong [123] Weighted O(τ n 2 log nW ) Chekuri-Quanrud [19] ((1 -ϵ)- approximation) Weighted O(τ nrϵ -2 log 2 ϵ -1 ) This paper Weighted O(τ W nr 1.5 ) This paper ((1-ϵ)-approximation) Weighted
O(τ ϵ -1 nr 1.5 log r)

Our Contribution

We propose both exact and approximation algorithms for the weighted matroid intersection problem. Our exact algorithm is faster than known algorithms when the largest given weight W is relatively small. Our approximation algorithm delivers a (1ϵ)-approximate solution for every Table 3.2: Matroid intersection algorithms for graphic matroids.

Algorithm Weight Time complexity Gabow-Stallman [START_REF] Gabow | Efficient algorithms for graphic matroid intersection and parity (extended abstract)[END_REF] Unweighted O( √ rn) if n = Ω(r 3/2 log r)

Unweighted O(rn 2/3 log 1/3 r) if n = Ω(r log r) & n = O(r 3/2 log r) Unweighted O(r 4/3 n 1/3 log 2/3 r) if n = O(r log r) Gabow-Xu [68] Unweighted O( √ rn log r) Gabow-Xu [68] Weighted O( √ rn log 2 r log(rW )) This paper Weighted O(W √ rn log r) (1 -ϵ) approximation Weighted O(ϵ -1 √ rn log 2 r)
Table 3.3: Linear matroid intersection algorithms. Here the Õ notation hides a polynomial of log n in the complexity.

Algorithm

Weight Time complexity Cunningham [START_REF] Cunningham | Improved bounds for matroid partition and intersection algorithms[END_REF] Unweighted O(nr 2 log r)

Gabow-Xu [69] Unweighted O(nr 5-ω
4-ω log r) Harvey [START_REF] Harvey | Algebraic algorithms for matching and matroid problems[END_REF] Unweighted O(nr ω-1 ) Cheung, et al. [START_REF] Cheung | Fast matrix rank algorithms and applications[END_REF] Unweighted O(nr log r * + nr ω-1 * ) Gabow-Xu [START_REF] Gabow | Efficient theoretic and practical algorithms for linear matroid intersection problems[END_REF] Weighted O(nr

7-ω 5-ω log ω-1 5-ω r log nW ) Harvey [83] Weighted Õ(W 1+ϵ nr ω-1 ) This paper Weighted O(nr log r * + W nr ω-1 * ) (1 -ϵ approximation) Weighted O(nr log r * + ϵ -1 nr ω-1 * log r * )
fixed ϵ > 0 in times substantially faster than known exact algorithms in most cases. Our algorithms and their analysis are surprisingly simple. Moreover, these algorithms can be specialized for particular classes of matroids. The core of our algorithms is a decomposition technique. We show that a given instance of the weighted matroid intersection problem can be decomposed into a set of unweighted versions of the same problem. To be precise, we can solve the weighted problem exactly by solving W unweighted ones. Furthermore, we can solve the weighted problem (1-ϵ)-approximately by solving O(ϵ -1 log r) unweighted ones.

Our decomposition technique not only establishes a hitherto unclear connection between the weighted and unweighted problems, but also leads to computational advantages: the known unweighted matroid intersection algorithms are significantly faster than their weighted counterparts. Thus, we can make use of the former to design faster algorithms. It may be expected that in the future, there will be even more efficient unweighted matroid intersection algorithms, and that would imply our algorithms will become faster as well.

We summarize the complexity of our exact algorithms below. For comparison of our algorithms with previous results, see Tables 3.1-3.3.

General matroids. Given two general matroids, using the unweighted matroid intersection al-gorithm of Cunningham [START_REF] Cunningham | Improved bounds for matroid partition and intersection algorithms[END_REF], we can solve the weighted matroid intersection problem in O(τ W nr1.5 ) time. This algorithm is faster than all known algorithms when W = o(min{ √ r, n log r r }) and r = O( √ n). A slightly different analysis shows that the same algorithm has the complexity 1 of O(τ ( e∈S w(e))r 1.5 ).

Graphic matroids. Given two graphic matroids, using the unweighted graphic matroid intersection algorithm proposed by Gabow and Xu [START_REF] Gabow | Efficient algorithms for independent assignments on graphic and linear matroids[END_REF], we can solve the weighted matroid intersection problem in O(W √ rn log r) time. This is faster than the current fastest algorithm when

W = o(log 2 r).
If the graph is relatively dense, that is, n = Ω(r 1.5 log r), then we can use the algorithm of Gabow and Stallman [START_REF] Gabow | Efficient algorithms for graphic matroid intersection and parity (extended abstract)[END_REF] to solve the problem in O(W √ rn) time.

Linear matroids. Given two linear matroids (in the form of two r-by-n matrices), using the unweighted linear matroid intersection algorithm of [START_REF] Cheung | Fast matrix rank algorithms and applications[END_REF], we can solve the weighted matroid intersection problem in O(nr log r * + W nr ω-1 *

) time, where ω is the exponent of the matrix multiplication time and r * ≤ r is the maximum size of a common independent set. This is faster than all known algorithms when W = o(r [START_REF] Coppersmith | Matrix multiplication via arithmetic progressions[END_REF][START_REF] Gall | Powers of tensors and fast matrix multiplication[END_REF][START_REF] Williams | Multiplying matrices faster than Coppersmith-Winograd[END_REF], it is when W = o(r 0.41 )).

ω 2 -7ω+12 5-ω ) (if ω ≈ 2.37
In the graphic matroid intersection problem, two graphs

G 1 = (V 1 , E) and G 2 = (V 2 , E)
with the same edge set E are given. An intersection of the two matroids means a subset of edges E ′ ⊆ E so that E ′ induces a forest in both G 1 and G 2 . In the linear matroid intersection problem, two r-by-n matrices M 1 and M 2 are given. An intersection of the two matroids means a subset of columns so that they are linearly independent in both M 1 and M 2 . The graphic and linear matroid intersection problems arise in various branches in engineering. For example, the intersection of graphic matroids has applications in determining the order of complexity of an electrical network [START_REF] Iri | Applications of matroid theory[END_REF] and the unique solvability of open networks [START_REF] Recski | Terminal solvability and n-port interconnection problem[END_REF]; the intersection of linear matroids has applications in the analysis of systems of linear differential equations [START_REF] Murota | Matrices and matroids for systems analysis[END_REF][START_REF] Murota | Combinatorial canonical form of layered mixed matrices and its applications to block-triangularization of systems of linear/nonlinear equations[END_REF].

A recent trend in research is to design fast approximation algorithms for fundamental optimization problems, even if they are in P. Examples include maximum weight matching [START_REF] Duan | Linear-time approximation for maximum weight matching[END_REF], shortest paths [START_REF] Thorup | Approximate distance oracles[END_REF], and maximum flow [START_REF] Christiano | Electrical flows, laplacian systems, and faster approximation of maximum flow in undirected graphs[END_REF][START_REF] Kelner | An almost-linear-time algorithm for approximate max flow in undirected graphs, and its multicommodity generalizations[END_REF][START_REF] Lee | A new approach to computing maximum flows using electrical flows[END_REF][START_REF] Sherman | Nearly maximum flows in nearly linear time[END_REF]. Using the algorithms of [START_REF] Cheung | Fast matrix rank algorithms and applications[END_REF][START_REF] Cunningham | Improved bounds for matroid partition and intersection algorithms[END_REF][START_REF] Gabow | Efficient algorithms for independent assignments on graphic and linear matroids[END_REF], our decomposition technique delivers a (1ϵ)-approximate solution in 1. O(τ ϵ -1 nr 1.5 log r) time with two general matroids, 2. O(ϵ -1 √ rn log 2 r) time with two graphic matroids, 3. O(nr log r * + ϵ -1 nr ω-1 * log r * ) time with two linear matroids.

Our approximation algorithms are significantly faster than most exact algorithms. Prior to our results, there is only a simple greedy 1/2-approximation algorithm [START_REF] Jenkyns | The efficacy of the "greedy" algorithm[END_REF][START_REF] Korte | An analysis of the greedy heuristic for independence systems[END_REF] dated in 1970s. It should be noted that, by scaling weights to small integers, i.e., rounding W to O( r ϵ ) (cf. Lemma 3.4.1), exact algorithms deliver a (1ϵ)-approximate solution (this is used in [START_REF] Cheung | Algebraic algorithms for linear matroid parity problems[END_REF] for the linear matroid parity). Ours improve on such simple scaling significantly. We note that for general matroids, very recently, Chekuri and Quanrud [START_REF] Chekuri | Fast approximations for matroid intersection[END_REF] improved on our results: they obtain a (1ϵ)approximate solution in O(τ nrϵ -2 log 2 ϵ -1 ) time.

Our Technique

The idea of reducing a weighted optimization problem into unweighted ones has been successfully applied in the context of maximum-weight matching in bipartite graphs [START_REF] Kao | A decomposition theorem for maximum weight bipartite matchings[END_REF] and in general graphs [START_REF] Huang | New algorithms for maximum weight matching and a decomposition theorem[END_REF][START_REF] Pettie | A simple reduction from maximum weight matching to maximum cardinality matching[END_REF]. Roughly speaking, these matching algorithms proceed iteratively: in each round, in a subgraph, a maximum-cardinality matching and its optimal dual are computed; the latter is then used to update the edge weights to construct the next subgraph. The optimality of the final solution is shown via the complementary slackness condition.

The difficulty of extending such approaches for matching to the weighted matroid intersection problem lies in the fact that, in the latter problem, the dual variables are harder to reason with and to control. Instead we make use of Frank's weight-splitting approach [START_REF] Frank | A weighted matroid intersection algorithm[END_REF][START_REF] Frank | A quick proof for the matroid intersection weight-splitting theorem[END_REF]. Originally Edmonds [START_REF] Edmonds | Matroid intersection[END_REF] gave a linear system describing the common independent sets and proved such a system to be totally dual integral. This fact suggests that there exists a weight-splitting w = w 1 +w 2 so that there exists a common independent set F so that F is of maximum weight for w 1 in M 1 and for w 2 in M 2 and in fact Frank designed an algorithm [START_REF] Frank | A weighted matroid intersection algorithm[END_REF] using this fact. The technical innovation of Frank lies in avoiding the dual variables entirely when obtaining the weight splitting.

Our main insight is that the split weights w 1 and w 2 can also be used to re-define two new matroids for subsequent operations. This is analogous to using the dual optimal solution to update the edge weights in the maximum-weight matching [START_REF] Huang | New algorithms for maximum weight matching and a decomposition theorem[END_REF][START_REF] Kao | A decomposition theorem for maximum weight bipartite matchings[END_REF][START_REF] Pettie | A simple reduction from maximum weight matching to maximum cardinality matching[END_REF].

Our approximation algorithms use the above basic ideas and a scaling technique of [START_REF] Duan | Linear-time approximation for maximum weight matching[END_REF] for approximating maximum-weight matching. In particular, as in [START_REF] Duan | Linear-time approximation for maximum weight matching[END_REF], the amount of adjustments done to the weights w 1 and w 2 decreases geometrically in each phase.

Application: rank-maximal matroid intersection

We consider a variation of the weighted matroid intersection problem, called the rank-maximal matroid intersection problem. Suppose that instead of a weight function w, a rank function λ: S → {1, 2, . . . , R} is given, where R is some positive integer. The goal is to find a common independent set so that it has the maximum number of elements e with rank 1, and subject to that, it has the maximum number of elements e with rank 2 and so on. The problem is a generalization of the rank-maximal matching problem, introduced by [START_REF] Irving | Rank-maximal matchings[END_REF] in the context of matching problems with preference lists.

As done in [START_REF] Irving | Rank-maximal matchings[END_REF], we can reduce this problem to the weighted matroid intersection problem by assigning huge weights, say Ω(n R-i ), to elements of rank i. However, such an approach would be inefficient in time and space. We show how to modify our exact algorithm to decompose the problem into R unweighted matroid intersection problems. In particular, we solve the rankmaximal matroid intersection problem using O(Rnr 1.5 ) independence oracle calls. Moreover, if the given two matroids are graphic or linear, the running times are reduced to O(R √ rn log r) and O(Rnr ω-1 ), respectively.

Outline

The rest of the paper is organized as follows. In Section 3.2, we give definitions and basic properties of matroids. Our exact and approximation algorithms are presented in Sections 3.3 and 3.4, respectively. Implementation details about finding a maximum-cardinality common independent set are described in Section 3.5. The result of the rank-maximal matroid intersection problem is in Section 4.2.3. The relation of our results with previous work is discussed in Section 3.7.

Preliminaries

Matroids

A matroid is a pair M = (S, I) of a finite set S and a family I of subsets of S satisfying the following three conditions. A set in I is said to be independent, and a maximal independent set is called a base. In addition, a minimal non-independent subset C of S is called a circuit. A circuit of size one is a loop.

Throughout the article, we assume that the given matroids have no loops. Let M = (S, I) be a matroid and X a subset of S. The restriction of M to X is defined by M|X = (X, I|X) with I|X = {I ∈ I | I ⊆ X}. The contraction of M with respect to X is defined as M/X = (S \ X, I/X) with I/X = {I ⊆ S \ X | I ∪ B ∈ I for some base B of M|X}. The direct sum of matroids M 1 = (S 1 , I 1 ) and M 2 = (S 2 , I 2 ), denoted by M 1 ⊕ M 2 , is defined to be (S 1 ∪ S 2 , I ′ ), where

I ′ = {I 1 ∪ I 2 | I 1 ∈ I 1 , I 2 ∈ I 2 }.
Given a matroid M = (S, I) and a weight function w: S → Z ≥0 , a set I ∈ I is said to be wmaximum, if its weight e∈I w(e) is maximum among all independent sets in I. A base is called a w-maximum base, if its weight is maximum among all bases. Using the family of w-maximum bases of M = (S, I), one can define a new matroid M w = (S, I w ), where

I w = {I | I ⊆ B for some w-maximum base B of M}.
It is well known that M w is a matroid (see e.g., [START_REF] Edmonds | Matroids and the greedy algorithm[END_REF]).

The following lemma states some important properties of such a derived matroid M w . As these properties are well-known (e.g. see [START_REF] Cook | Combinatorial Optimization[END_REF]), we omit the proof. (ii) A set I ∈ I is w-maximum if and only if I ∩Z(t) is a base of M|Z(t) for every t = 1, 2, . . . , W .

(iii) Suppose that a set I ∈ I satisfies the condition that I ∩ Z(t) is a base in M|Z(t) for every integer t with (min e∈S w(e)) + 1 ≤ t ≤ W , and I + e 0 , where e 0 ∈ S\I, contains a circuit C ′ of M w . Then, every element in C ′ has weight equal to w(e 0 ). Furthermore, there exists a circuit C ⊇ C ′ in I + e with respect to M, and each element in C \ C ′ has weight greater than w(e 0 ).

Matroid Intersection

Suppose that we are given a pair of matroids M 1 = (S, I 1 ) and M 2 = (S, I 2 ) on the same ground set S. A subset I of S is called a common independent set if I is in I 1 ∩ I 2 . The goal of the matroid intersection problem is to find a maximum-cardinality common independent set. Given M 1 and M 2 , the auxiliary graph is a directed graph G M1,M2 (I) = (S,

E 1 ∪ E 2 )
, where

E 1 = {ef | I + e ̸ ∈ I 1 , I + e -f ∈ I 1 }, E 2 = {f e | I + e ̸ ∈ I 2 , I + e -f ∈ I 2 }.
In the auxiliary graph G M1,M2 (I), we also define

X 1 = {e ∈ S \ I | I + e ∈ I 1 }, X 2 = {e ∈ S \ I | I + e ∈ I 2 }.
In the auxiliary graph, a directed path from X 2 to X 1 is an augmenting path. Let P be a shortest augmenting path. Define I△P = (I \ P ) ∪ (P \ I). It is known (e.g. [START_REF] Cook | Combinatorial Optimization[END_REF]) that I△P is another common independent set, whose size is one larger than I. If there is no augmenting path in the auxiliary graph, then I is already a maximum-cardinality common independent set. Thus, we can find a maximum-cardinality common independent set in a polynomial number of oracle calls; starting with a common independent set I ∈ I 1 ∩ I 2 (I can be ∅), we repeatedly augment the current common independent set I to a larger one by finding a shortest augmenting path in G M1,M2 (I). The algorithm constructs an auxiliary graph in each iteration, which takes O(nr) independence oracle calls. Since the number of augmentations is at most r, it runs in O(nr 2 τ ) time.

Cunningham [START_REF] Cunningham | Improved bounds for matroid partition and intersection algorithms[END_REF] improves the running time to O(nr 1.5 τ ) by finding a maximal number of disjoint augmenting paths in each iteration. For graphic matroids, we can obtain augmentationtype algorithms running in O( √ rn log r) time [START_REF] Gabow | Efficient algorithms for independent assignments on graphic and linear matroids[END_REF], and O( √ rn) time if n = Ω(r 1.5 log r) [START_REF] Gabow | Efficient algorithms for graphic matroid intersection and parity (extended abstract)[END_REF].

Given two matroids M ℓ = (S, I ℓ ) (ℓ = 1, 2) and a weight function w: S → Z ≥0 , the weighted matroid intersection problem is to find a common independent set with maximum weight. A pair of functions w ℓ : S → Z ≥0 for ℓ = 1, 2 is a weight-splitting of w if w(e) = w 1 (e) + w 2 (e) for every e ∈ S. Frank gave two different proofs [START_REF] Frank | A weighted matroid intersection algorithm[END_REF][START_REF] Frank | A quick proof for the matroid intersection weight-splitting theorem[END_REF] to the following min-max theorem. Note that our result (Theorem 4.2.9) gives an alternative proof of Theorem 3.2.2, as our algorithm does not rely on Theorem 3.2.2. Theorem 3.2.2. Let M 1 = (S, I 1 ) and M 2 = (S, I 2 ) be two matroids and w: S → Z ≥0 a weight function. Then the maximum weight of a common independent set is equal to min w1,w2:weight-splitting b 1 (w 1 ) + b 2 (w 2 ), where b ℓ (w ℓ ) denotes the weight of the w ℓ -maximum independent set of M ℓ for ℓ = 1, 2.

Exact Algorithm

In this section, we present an exact algorithm for the weighted matroid intersection problem. Let W = max e∈S w(e).

Our algorithm runs in W rounds. For ease of presentation, our algorithm starts from Round W and down to Round 1. In Round i, the subset S ′ ⊆ S of elements e with w(e) ≥ i is the ground set of the two matroids.

We maintain a pair of weight functions w 1 and w 2 as a weight splitting of the original weight w. We define a new pair of matroids M ′ 1 and M ′ 2 as the restrictions of M w1 1 and M w2 2 to S ′ . In each round, the algorithm finds a maximum-cardinality common independent set I between M ′ 1 and M ′ 2 using I ′ , where I ′ is the common independent set found in the previous round. As we will show in Section 3.5, the augmentation-type algorithm described in Section 3.2.2 can be used to obtain I with the additional property called near-optimality (see Definition 3.3.1). At the end of the round, we update w 1 , w 2 based on the auxiliary graph G M ′ 1 ,M ′ 2 (I). Below we first present the algorithm and then elaborate on the details. Output: I ∈ I 1 ∩ I 2 where I is a maximum-weight common independent set of M 1 and M 2 .

Step 1. Set i := W , w 1 := 0, w 2 := w, and I ′ := ∅.

Step 2. While i > 0 do the following steps.

(2-1)

Set S ′ := {e ∈ S | w 2 (e) ≥ i}. (2-2) Set M ′ ℓ = (S ′ , I ′ ℓ ) to be M w ℓ ℓ |S ′ for ℓ = 1, 2. (2-3) Unweighted Matroid Intersection (I ′ ) Construct I so that (i) I is a maximum-cardinality common independent set of M ′
1 and M ′ 2 , and (ii) I is (w 1 , w 2 )-near-optimal in S ′ .

(2-4) Update Weight

(2-4-1) Let T ⊆ S ′ be the set of elements reachable from X 2 in G M ′ 1 ,M ′ 2 (I).
(2-4-2) For each e ∈ T , let w 1 (e) := w 1 (e) + 1, w 2 (e) := w 2 (e) -1.

(2-5) Set i := i -1 and I ′ := I.

Step 3. Return I.

Note that in

Step (2-3), Unweighted Matroid Intersection takes I ′ , which is the common independent set computed in the previous round, to construct I. The implementation details (depending on the type of given matroids) will be given in Section 3.5. Roughly speaking, we will show that if I ′ is already (w 1 , w 2 )-near-optimal in S ′ , then we can compute I, based on I ′ , so that I becomes the maximum cardinality common independent set of M ′ 1 and M ′ 2 while remaining (w 1 , w 2 )-near-optimal.

Analysis

The final goal of our algorithm is to find a common independent set that is w 1 -maximum in M 1 and w 2 -maximum in M 2 , which would imply that I is w-maximum if w = w 1 + w 2 . For each integer t, let

Z 1 (t) = {e ∈ S | w 1 (e) ≥ t}, Z 2 (t) = {e ∈ S | w 2 (e) ≥ t}. Lemma 3.2.1(ii) implies that I being w 1 -maximum in M 1 and w 2 -maximum in M 2 is equivalent to 1. I ∩ Z 1 (t) is a base of M 1 |Z 1 (t)
for every integer t ≥ 1, and 2. I ∩ Z 2 (t) is a base of M 2 |Z 2 (t) for every integer t ≥ 1. Such a common independent set I of M 1 , M 2 is called (w 1 , w 2 )-optimal.

We relax the above condition as follows. We here define Z ′ ℓ (t) = Z ℓ (t) ∩ S ′ for each subset S ′ ⊆ S and ℓ = 1, 2.

Definition 3.3.1. A common independent set I of M 1 and M 2 is (w 1 , w 2 )-near-optimal in a subset S ′ ⊆ S if 1. I ∩ Z ′ 1 (t) is a base of M 1 |Z ′ 1 (t)
for every integer t ≥ 1, and

2. I ∩ Z ′ 2 (t) is a base of M 2 |Z ′ 2 (t) for every integer t ≥ α + 1, where α = min e∈S ′ w 2 (e).
Note that if α = 0 and S ′ = S, then a (w 1 , w 2 )-near-optimal common independent set in

S ′ is (w 1 , w 2 )-optimal.
In what follows, we will prove that, during the execution of our algorithm, the current set I is always (w 1 , w 2 )-near-optimal in S ′ . To prove this, we analyze the two procedures Unweighted Matroid Intersection and Update Weight used in Steps (2-3) and (2-4).

In Unweighted Matroid Intersection of Step (2-3), if we only want a maximum-cardinality common independent set I of M ′ 1 and M ′ 2 , the step is trivial. The difficulty is how to guarantee that I is also (w 1 , w 2 )-near-optimal in S ′ without resorting to weighted matroid intersection. The details are deferred to Section 3.5. We use a lemma to summarize the outcome of Step (2-3). Recall that we denote

M ′ ℓ = M w ℓ ℓ |S ′ for ℓ = 1, 2.
Lemma 3.3.2. Suppose that I ′ is (w 1 , w 2 )-near-optimal in a subset S ′ . Then we can construct another common independent set I, using known unweighted matroid intersection algorithms, that is simultaneously (i) a maximum-cardinality common independent set of M ′ 1 and M ′ 2 , and (ii) (w 1 , w 2 )-near-optimal in S ′ .

We next prove that, if the maximum-cardinality common independent set I of M ′ 1 and M ′ 2 is (w 1 , w 2 )-near-optimal in S ′ , then we can modify w 1 and w 2 at Step (2-4) so that I is still (w 1 , w 2 )-near-optimal in S ′ .

Lemma 3.3.3. Suppose that all weights of w 1 and w 2 are nonnegative integers, and there are some integers p 1 and p 2 such that w 1 (e) ≤ p 1 and w 2 (e) ≥ p 2 for every e ∈ S ′ . In addition, suppose that I is (i) a maximum-cardinality common independent set of M ′ 1 and M ′ 2 , and (ii) (w 1 , w 2 )-near-optimal in S ′ . Then, after the procedure Update Weight, we have

(1) I ∩ Z ′ 1 (t) is a base of M 1 |Z ′ 1 (t)
for every integer t with 1 ≤ t ≤ p 1 + 1, and

(2)

I ∩ Z ′ 2 (t) is a base of M 2 |Z ′ 2 (t) for every integer t ≥ p 2 .
It should be noted that Lemma 3.3.3 implies that after Step (2-4), I is still (w 1 , w 2 )-near-optimal in S ′ , since then max e∈S ′ w 1 (e) ≤ p 1 + 1 and min e∈S ′ w 2 (e) ≥ p 2 -1.

Proof. We only prove (1), since (2) follows symmetrically. To avoid confusion, let Z′ 1 (t) denote the set Z ′ 1 (t) after the weights w 1 and w 2 are updated. Observe that, for every integer t with 1

≤ t ≤ p 1 + 1, Z′ 1 (t) = Z ′ 1 (t) ∪ ((Z ′ 1 (t -1) \ Z ′ 1 (t)) ∩ T ),
where we note that Z ′ 1 (p 1 + 1) = ∅ and Z ′ 1 (0) = S ′ . As I ∩Z ′ 1 (t) is a base of M 1 |Z ′ 1 (t), we argue that given an element e ∈ ((Z ′ 1 (t-1)\Z ′ 1 (t))∩T )\I:

( * ) I + e ̸ ∈ I 1 |S ′ , and

( * * ) the circuit of I + e in M 1 |S ′ is contained in Z′ 1 (t).
This will establish that I ∩ Z′ 1 (t) is a base of M 1 | Z′ 1 (t) for every t = 1, 2, . . . , p 1 + 1. To see ( * ), observe that in G M ′ 1 ,M ′ 2 (I), e is not part of X 1 . Otherwise, there would be an augmenting path, contradicting to the assumption that I is a maximum-cardinality common independent set in M ′ 1 and M ′ 2 . Thus, I + e contains a circuit C ′ in M ′ 1 . Furthermore, by Lemma 3.2.1(iii) applied to M 1 |S ′ (as the assumption is that

I ∩Z ′ 1 (t) is a base of M 1 |Z ′ 1 (t) for every t = 1, 2, . . . , p 1 ), I + e also has a circuit C ⊇ C ′ in M 1 |S ′ . Thus, ( * ) is proved. To see ( * * ), consider an element e ′ in C ′ -e. Then, e ′ is contained in Z ′ 1 (t -1) \ Z ′ 1 (t) by Lemma 3.2.1(iii). Since e ′ ∈ C ′ , in G M ′ 1 ,M ′ 2 (I)
, there is an arc from e to e ′ . Thus, e ′ is part of T . This implies that C ′ is a subset of (Z ′ 1 (t-1)\Z ′ 1 (t))∩T , which in turn, by Lemma 3.2.1(iii), implies that the circuit

C ⊇ C ′ in I +e with respect to M 1 |S ′ is a subset of Z ′ 1 (t)∪((Z ′ 1 (t-1)\Z ′ 1 (t))∩T ) = Z′ 1 (t).
The proof of ( * * ) follows.

By induction on i with Lemmas 3.3.2 and 3.3.3, we show that the current set I is always (w 1 , w 2 )-near-optimal. Lemma 3.3.4. In Round i with 1 ≤ i ≤ W , the following holds.

(1) w = w 1 + w 2 ,

(2) after Step (2-4),

I ∩ Z ′ 1 (t) is a base of M 1 |Z ′ 1 (t)
for every integer t with 1 ≤ t ≤ Wi + 1, and

(3) after Step (2-4), I ∩ Z ′ 2 (t) is a base of M 2 |Z ′ 2 (t) for every integer t with i ≤ t ≤ W .
Proof.

(1) can be easily seen. We prove (2) and ( 3) by induction on i. For the base case of i = W , since Z ′ 1 (1) = ∅ and Z ′ 2 (W + 1) = ∅ hold, I ′ = ∅ is (w 1 , w 2 )-nearoptimal in S ′ , and thus Lemma 3.3.2 implies that we can obtain a maximum-cardinality common independent set I of M ′ 1 and M ′ 2 satisfying the condition that

I ∩ Z ′ 1 (1) is a base of M 1 |Z ′ 1 (1) and I ∩ Z ′ 2 (W + 1) is a base of M 2 |Z ′ 2 (W + 1
). Now applying Lemma 3.3.3 (with p 1 = 0 and p 2 = W ), we have that

I ∩ Z ′ 1 (1) is a base of M 1 |Z ′ 1 (1) and I ∩ Z ′ 2 (W ) is a base of M 2 |Z ′ 2 (W ).
For the induction step i < W , let I ′ be the common independent set obtained in Round i + 1. By induction hypothesis,

I ′ ∩ Z ′ 1 (t) is a base of M 1 |Z ′ 1 (t) for every integer t with 1 ≤ t ≤ W -i and I ′ ∩ Z ′ 2 (t) is a base of M 2 |Z ′ 2 (t)
for every integer t with i + 1 ≤ t ≤ W . Notice that when Round i begins, only elements e with w 1 (e) = 0 and w 2 (e) = i are added to S ′ . Hence the two conditions remain true after Step (2-1).

By these facts, as w 2 (e) ≥ i for e ∈ S ′ , Step (2-3) can be correctly applied by Lemma 3.3.2, and we obtain the new independent set I satisfying the two conditions stated in Step (2-3). The proof now follows by applying Lemma 3.3.3 (with p 1 = Wi and p 2 = i).

Theorem 3.3.5. The common independent set I returned by Algorithm 1 is a maximum-weight common independent set of M 1 and M 2 .

Proof. By Lemma 3.3.4, after the last round when i = 1, as S ′ = S, I ∩ Z 1 (t) is a base of M 1 |Z 1 (t) for every t = 1, 2, . . . , W , and I ∩ Z 2 (t) is a base of M 2 |Z 2 (t) for every t = 1, 2, . . . , W . Thus, it follows from Lemma 3.2.1(ii) that I is w ℓ -maximum in M ℓ for every ℓ = 1, 2. Then, for every common independent set J, we have

w(J) = w 1 (J) + w 2 (J) ≤ w 1 (I) + w 2 (I) = w(I).
Thus, I is a maximum-weight common independent set. This completes the proof.

The algorithm clearly runs in O(W (T u + T d )) time, where T u and T d are the running times for executing Unweighted Matroid Intersection and Update Weight, respectively. Note that T u and T d depend on the representation of the given matroids. Their complexities are discussed in Section 3.5.

Approximation Algorithm

In this section, we will design a (1ϵ)-approximation algorithm for the weighted matroid intersection. Let W be the maximum weight. First of all, we show that we can round weights to small integers, and bound W from above. Lemma 3.4.1. We can reduce a given instance of the weighted matroid intersection problem to one with integral weights whose maximum weight is at most 2r * /ϵ, where r * ≤ r is the maximum size of a common independent set. Proof. Set η = ϵW/2r * , and define w ′ (e) = ⌊w(e)/η⌋ for each e ∈ S. Then, a (1-ϵ/2)-approximate solution I ′ for the weight w ′ is a (1ϵ)-approximate solution for the weight w. Indeed, since w(e)η ≤ ηw ′ (e) ≤ w(e) for every e ∈ S, we have

w(I ′ ) ≥ ηw ′ (I ′ ) ≥ η(1 -ϵ/2)w ′ (I ′ opt ) (I ′ opt is an optimal solution for w ′ ) ≥ η(1 -ϵ/2)w ′ (I opt )
(I opt is an optimal solution for w)

≥ (1 -ϵ/2)(w(I opt ) -η|I opt |) ≥ (1 -ϵ/2)(w(I opt ) -ηr * ) = (1 -ϵ/2)(w(I opt ) -ϵW/2) ≥ (1 -ϵ)w(I opt ),
where the last inequality follows because we assume that the given matroids have no loop, so the element e with w(e) = W is a common independent set, thus, w(I opt ) ≥ W .

During the algorithm, the weight w is split so that w ≈ w 1 +w 2 ; furthermore, we will guarantee that all weights of w 1 and w 2 are nonnegative multiples of some integer δ > 0, where δ may change in different phases of the algorithm. At the end, we find a common independent set that is w 1maximum in M 1 and w 2 -maximum in M 2 , which would imply that I is a (1ϵ)-approximate solution if w ≤ w 1 + w 2 ≤ (1 + ϵ)w.

For simplicity, we assume that the bound W and ϵ are both powers of 2. Then, our algorithm runs in 1 + log 2 ϵW phases. In every phase, we apply a number (roughly O(ϵ -1 )) of Unweighted Matroid Intersection and Update Weight operations. Note that log 2 ϵW = O(log r) by Lemma 3.4.1.

Let δ 0 = ϵW . For each integer i with 1 ≤ i ≤ log 2 ϵW , define δ i = δ 0 /2 i . The term δ i will be the amount of change in the weights w 1 and w 2 during Phase i every time Update Weight is invoked. For each e ∈ S and each integer i with 0 ≤ i ≤ log 2 ϵW , define w i (e) to be the truncated weight of element e in Phase i, i.e., w i (e) = ⌊w(e)/δ i ⌋δ i . Notice that w i+1 (e) = w i (e) or w i+1 (e) = w i (e) + δ i+1 . The algorithm, presented below, returns a ( 1 1+4ϵ )-approximate solution.

Algorithm 2: Approximation algorithm Input: two matroids M 1 = (S, I 1 ) and M 2 = (S, I 2 ), a weight function w: S → Z ≥0 , and W = max e∈S w(e).

Output: I ∈ I 1 ∩ I 2 where w(I) ≥ w(I opt ) 1+4ϵ .

Step 1. Set i := 0, w 1 := 0, w 2 := w 0 , I ′ := ∅, and h := W . (2)

Step (2-1) is executed at most ϵ -1 2 times in Phase i with 0 ≤ i < log 2 ϵW . In the last phase, Step (2-1) is executed ϵ -1 + 1 times.

(3) The total number of iterations in Step (2-1) is O(ϵ -1 log r).

Proof. (1) can be easily verified. For (2), observe that in Phase 0, Step (2-1) is executed

W -W/2 δ 0 = ϵ -1 2 times. For Phase i ≥ 1, in the beginning of that phase, h = W 2 i -δ i . Hence, if i < log 2 ϵW , Step (2-1) is executed (W/2 i -δ i ) -W/2 i+1 δ i ≤ ϵ -1 2 times, and if i = log 2 ϵW , Step (2-1) is executed W/2 i -δ i δ i ≤ ϵ -1
times.

(3) now immediately follows from (2).

We say an element e ∈ S joins in Phase j if in Phase j, element e becomes a part of the ground set S ′ in Step (2-1-1) the first time.

Lemma 3.4.3. Suppose that an element e ∈ S joins in Phase j for some integer j with j < log 2 ϵW . Then the following holds.

(1) w j (e) ≥ W 2 j+1 = δj 2ϵ .

(2) In every phase i ≥ j, w i (e) ≤ w 1 (e) + w 2 (e) ≤ w i (e) + 2δ j .

(3) If e ∈ S joins in the last phase j = log 2 ϵW , then w 1 (e) + w 2 (e) = w j (e).

Proof. Notice that immediately before e joins in Phase j, we have w 1 (e) + w 2 (e) = w j (e). This follows from the observation that unless e is part of I when Step (2-2-1) is executed, the weight splitting w 1 (e) and w 2 (e) is exact with respect w j ′ (e) for j ′ ≤ j.

(3) follows easily from this observation. In the case that j < log 2 ϵW , we have that w j (e) ≥ w 2 (e) ≥ W 2 j+1 . Thus (1) is proved. (2) follows from the fact that the difference between the sum of w 1 (e) and w 2 (e) and the truncated weight w j ′ (e) grows larger only when Step (2-2-1) is executed in Phase j ′ ≥ j and e is part of the common independent set I in that step. Hence it holds that w i (e) ≤ w 1 (e) + w 2 (e) ≤ w i (e) + This completes the proof. Since all weights of w 1 , w 2 are nonnegative multiples of δ i and we modify w 1 and w 2 by δ i at Update Weight, we have the following lemma, which can be obtained similarly to Lemma 3.3.3 by dividing all the values by δ i . Lemma 3.4.4. Suppose that all weights of w 1 and w 2 are nonnegative multiples of δ, and there are some integers p 1 and p 2 such that w 1 (e) ≤ p 1 and w 2 (e) ≥ p 2 for every e ∈ S ′ . In addition, suppose that I is (i) a maximum-cardinality common independent set of M ′ 1 and M ′ 2 , and (ii) (w 1 , w 2 )-near-optimal in S ′ . Then after the procedure Update Weight, we have

(1) I ∩ Z ′ 1 (t) is a base of M 1 |Z ′ 1 (t)
for every integer t with 1 ≤ t ≤ p 1 + δ, and

(2)

I ∩ Z ′ 2 (t) is a base of M 2 |Z ′ 2 (t) for every integer t ≥ p 2 .
Note that the lemma implies that the current independent set I is still (w 1 , w 2 )-near-optimal in S ′ after Step (2-1-4).

We finally see that Weight Adjustment maintains I ′ (w 1 , w 2 )-near-optimal in S ′ .

Lemma 3.4.5. In Phase i, after Step (2-1) terminates, we have the following.

(1)

I ′ ∩ Z ′ 1 (t) is a base of M 1 |Z ′ 1 (t)
for every integer t ≥ 1.

(2)

I ′ ∩ Z ′ 2 (t) is a base of M 2 |Z ′ 2 (t) for every integer t ≥ h + δ i .
Proof. We first prove the following claim.

Claim 1. In each phase, if (1) and (2) hold before the first iteration of Step (2-1) starts, we have (1) and (2) after the final iteration of Step (2-1) terminates.

Proof. We prove the claim by induction on the number of times Step (2-1) is invoked. For the base case, we have (1) and (2) in the beginning by the assumption. Suppose that we have (1) and (2) for the previous set I ′ at the beginning of the current iteration in Step (2-1). At Step (2-1-1), some elements may be added into S ′ . However, all such elements have w 1 (e) = 0 and w 2 (e) = h. Thus, I ′ still satisfies (1) and (2), and thus it is (w 1 , w 2 )-near-optimal in S ′ since w 2 (e) ≥ h for every e ∈ S ′ . By Lemma 3.3.2, Step (2-1-3) can be correctly implemented, and we obtain a maximum-cardinality common independent set I of M ′ 1 and M ′ 2 that is (w 1 , w 2 )-near-optimal in S ′ . After Step (2-1-4), by Lemma 3.4.4 (by setting δ = δ i , p 1 = max e∈S ′ w 1 (e), and p 2 = h), we have that I satisfies (1) and

I ∩ Z ′ 2 (t) is a base of M 2 |Z ′ 2 (t)
for any integer t ≥ h. Since h is decreased by δ i in Step (2-1-5), we have (1) and (2) at the end of the current iteration. This proves the claim.

We prove the lemma by induction on the number of phases. For the base case, as in the beginning of the algorithm, h = W and I ′ = ∅, the set I ′ is (w 1 , w 2 )-near-optimal in S ′ . This means that we have (1) and (2) for I ′ , and hence Claim 1 implies that we have (1) and (2) after the iterations of Step (2-1) terminates in Phase 0.

For the induction step, suppose that currently the algorithm is in Phase i, and that (1) and (2) are satisfied after Step (2-1) are done. We argue that after the weight adjustment done in Step (2-2), I ′ still satisfies (1) and (2).

To avoid confusion, let Zℓ (t) (ℓ = 1, 2) denote the sets after w 2 -weights are modified in Steps (2-2-1) and (2-2-2), and let h be the value of h after Step (2-2-3), i.e., h = h + δ i+1 .

By Lemma 3.4.2(1), all w 1 and w 2 weights are multiples of δ i in Phase i before Step (2-2). Therefore, after Step (2-1), the fact that I ′ satisfies (2) implies

(⋆) I ′ ∩ Z ′ 2 (t) is a base of M 2 |Z ′ 2 (t) for every integer t ≥ h + δ i+1 .
To see this, note that I ′ satisfying (2) only guarantees this property for t ≥ h + δ i . We can subtract δ i+1 further because there is no element with w 2 -weight of the form aδ i + δ i+1 for some integer a ≥ 0. Hence the range of t starts from h + δ iδ i+1 = h + δ i+1 .

As we increase the w 2 -weights of all elements in I ′ and a subset of elements in S ′ \ I ′ , while leaving the w 1 -weights unchanged, we have

(i) Z1 (t) = Z 1 (t) for all t ∈ Z ≥0 . (ii) I ∩ Z′ 1 (t) is a base of M 1 | Z′ 1 (t) for every integer t ≥ 1. (iii) I ∩ Z′ 2 (t) is a base of M 2 | Z′ 2 (t)
for every integer t ≥ h + δ i+1 .

(i) and (ii) are easy to see, since w 1 -weights are unchanged and (1) holds before Step (2-2). For (iii), consider any integer t ≥ h + δ i+1 = h + 2δ i+1 . We have that

I ′ ∩ Z′ 2 (t) = I ′ ∩ Z ′ 2 (t -δ i+1 ), where the latter is a base of M 2 |Z ′ 2 (t-δ i+1 ) by (⋆). As Z′ 2 (t) ⊆ Z ′ 2 (t-δ i+1 ), we infer that I ′ ∩ Z′ 2 (t) is still a base of M 2 | Z′ 2 (t)
. Therefore, at the beginning of Phase i + 1, we have (1) and (2), and hence the proof follows from Claim 1. This completes the proof. Lemma 3.4.6. The common independent set I returned by Algorithm 2 is a maximum-weight common independent set, with respect to the final weight function w 1 + w 2 . Proof. After the last time Step (2-1-5) is executed, by Lemma 3.4.5 and the fact that S ′ = S, I ∩ Z 1 (t) is a base of M 1 |Z 1 (t) for every integer t ≥ 1, and I ∩ Z 2 (t) is a base of M 2 |Z 2 (t) for every integer t ≥ δ log 2 ϵW . Since δ log 2 ϵW = 1, it follows from Lemma 3.2.1(ii) that I is w 1 -maximum in M 1 and w 2 -maximum in M 2 . Therefore, for every common independent set J, we have w 1 (J) + w 2 (J) ≤ w 1 (I) + w 2 (I).

The proof follows.

Theorem 3.4.7. Let I be the common independent set returned by Algorithm 2. Then I is a (1 -4ϵ) approximation.

Proof. For every e ∈ S, if it joins in Phase j < log 2 ϵW , then by Lemma 3.4.3(2), w log2 ϵW (e) ≤ w 1 (e) + w 2 (e) ≤ w log 2 ϵW (e) + 2δ j ≤ (1 + 4ϵ)w log 2 ϵW (e), where the last inequality holds since δ j ≤ 2ϵw j (e) ≤ 2ϵw log 2 ϵW (e) by Lemma 3.4.3(1). If j = log 2 ϵW , then w log 2 ϵW (e) = w 1 (e) + w 2 (e) by Lemma 3.4.3 [START_REF] Abraham | Popular matchings[END_REF]. Since w log 2 ϵW (e) = w(e), we conclude that, for each e ∈ S, w(e) ≤ w 1 (e) + w 2 (e) ≤ (1 + 4ϵ)w(e). Thus, letting I opt be the maximum-weight common independent set, Lemma 3.4.6 implies

w(I opt ) ≤ w 1 (I opt ) + w 2 (I opt ) ≤ w 1 (I) + w 2 (I) ≤ (1 + 4ϵ)w(I).
The proof follows.

Implementation of Unweighted Matroid Intersection

In this section, we discuss how to implement the procedure Unweighted Matroid Intersection and the actual complexities of our algorithms for various weighted matroid intersection problems.

Let M 1 and M 2 be two matroids, and w 1 and w 2 be weights. Suppose that a given common independent set I ′ of M ′ 1 and M ′ 2 is (w 1 , w 2 )-near-optimal in a subset S ′ ⊆ S (recall that M ′ ℓ = M w ℓ ℓ |S ′ for ℓ = 1, 2). We explain in the following sections how to find a maximum-cardinality common independent set I between M ′ 1 and M ′ 2 that is (w 1 , w 2 )-near-optimal in S ′ .

General Matroids

In [START_REF] Cunningham | Improved bounds for matroid partition and intersection algorithms[END_REF], Cunningham shows how to find a maximum-cardinality common independent set, using O(nr 1.5 ) independence oracle calls. This is done by repeatedly finding an augmenting path in the auxiliary graph, as described in Section 3.2.2. We argue that if we apply his algorithm to M ′ 1 and M ′ 2 with I ′ as the initial common independent set, each new independent set resulting from augmentation will satisfy the same property as I ′ . Lemma 3.5.1. Suppose that I ′ is (w 1 , w 2 )-near-optimal in S ′ , and let P be the shortest path from X 2 to X 1 in G M ′ e ∈ (Z 2 (t) \ Z 2 (t + 1)) ∩ I ′ has only outgoing arcs towards other elements in (Z 2 (t) \ Z 2 (t + 1)) \ I ′ for every integer t ≥ p + 1, where p = min e∈S ′ w 2 (e).

These two facts imply that along the augmenting path P in G M ′ 1 ,M ′ 2 (I ′ ), the number of elements in (Z 1 (t) \ Z 1 (t + 1)) \ I ′ is the same as the number of elements in (Z 1 (t) \ Z 1 (t + 1)) ∩ I ′ for every integer t ≥ 1. Similarly, the number of elements in (Z 2 (t) \ Z 2 (t + 1)) ∩ I ′ is the same as that in (Z 2 (t) \ Z 2 (t + 1)) \ I ′ for every integer t ≥ p + 1. Thus, |I ∩ Z 1 (t)|= |I ′ ∩ Z 1 (t)| for every integer t ≥ 1, and |I ∩ Z 2 (t)|= |I ′ ∩ Z 2 (t)| for every integer t ≥ p + 1. The proof follows.

Thus, the maximum-cardinality common independent set of M ′ 1 = (S ′ , I ′ 1 ) and M ′ 2 = (S ′ , I ′ 2 ) obtained by Cunningham's algorithm is (w 1 , w 2 )-near-optimal if so is the initial set. To apply Cunningham's algorithm [START_REF] Cunningham | Improved bounds for matroid partition and intersection algorithms[END_REF] to M ′ 1 and M ′ 2 , we need an independence oracle for M ′ 1 and M ′ 2 to find an augmenting path. More specifically, for ℓ = 1, 2, we need to test whether I ′ + e ∈ I ′ ℓ and whether I ′ + ef ∈ I ′ ℓ for a given independent set I ′ , and given elements e ∈ S ′ \ I ′ and f ∈ I ′ . This can be implemented by an independence oracle for M 1 and M 2 as follows. It follows from Lemma 3.2.1(iii) that if I ′ + e / ∈ I ′ ℓ , then I ′ + ef ∈ I ′ ℓ if and only if I ′ + ef ∈ I ℓ and w ℓ (e) = w ℓ (f ). In addition, I ′ + e ∈ I ′ 1 if and only if I ′ + e ∈ I 1 and w 1 (e) = 0, and I ′ + e ∈ I ′ 2 if and only if I ′ + e ∈ I 2 and w ′ 2 (e) = min e∈S ′ w 2 (e). Thus Unweighted Matroid Intersection can be implemented in O(nr 1.5 ) independence oracle calls for M 1 and M 2 .

We can perform Update Weight in O(nr) independence oracle calls. Therefore, we have the following theorem for two general matroids. Theorem 3.5.2. For two general matroids, we can solve the weighted matroid intersection problem exactly in O(τ W nr 1.5 ) time, and (1ϵ)-approximately in O(τ ϵ -1 nr 1.5 log r) time, where τ is the running time to check the independence of a set in the given matroids. ). This is superior to the previous one only when the given weights are very "unbalanced."

Graphic Matroids

Suppose that M 1 and M 2 are graphic matroids. That is, M ℓ = (S, I ℓ ) (ℓ = 1, 2) is represented by a graph G ℓ = (V ℓ , S) so that I ℓ is the family of edge subsets in S that are forests in G ℓ . Note that the number of edges in G ℓ is n = |S|, and the number of vertices is O(r), since we may assume that there is no isolated vertex. Gabow and Xu [START_REF] Gabow | Efficient algorithms for independent assignments on graphic and linear matroids[END_REF] designed an algorithm that runs in O( √ rn log r) time for the unweighted graphic matroid intersection. Their algorithm is an augmentation-type algorithm, that means it repeatedly finds an augmenting path in the auxiliary graph.

It is well known that, if M ℓ is graphic, then so is M ′ ℓ = M w ℓ ℓ |S ′ for a subset S ′ and ℓ = 1, 2. Indeed, for a subset X ⊆ S, the restriction of G ℓ to X (the subgraph induced by an edge subset X), denoted by G ℓ |X, represents M ℓ |X. Moreover, the graph obtained from G ℓ by contracting X, denoted by G ℓ /X, represents M ℓ /X. Then, by Lemma 3.2.1(i),

M ′ ℓ = M w ℓ ℓ |S ′ has a graph representation G ′ ℓ |S ′ , where G ′ ℓ is in the form of G ′ ℓ = W t=0 (G ℓ |Z ℓ (t))/Z ℓ (t + 1),
i.e., G ′ ℓ is the disjoint union of graphs (G ℓ |Z ℓ (t))/Z ℓ (t + 1) obtained by restriction and contraction. Note that the numbers of vertices and edges in G ′ are O(r) and n, respectively.

We apply Gabow and Xu's algorithm [START_REF] Gabow | Efficient algorithms for independent assignments on graphic and linear matroids[END_REF] for the unweighted problem to M ′ 1 and M ′ 2 with I ′ as the initial common independent set. Since I ′ is (w 1 , w 2 )-near-optimal, it follows from Lemma 3.5.1 that the obtained maximum-cardinality common independent set is (w 1 , w 2 )-near-optimal in S ′ . Thus the running time of Unweighted Matroid Intersection is O( √ rn log r). Since the reachable set T in the procedure Update Weight can be found in the end of Gabow and Xu's algorithm, we can perform Update Weight in linear time. Therefore, we have the following.

Theorem 3.5.3. For two graphic matroids, we can solve the weighted matroid intersection problem exactly in O(W √ rn log r) time, and (1ϵ)-approximately in O(ϵ -1 √ rn log 2 r) time.

Linear Matroids

In the case that M 1 and M 2 are linear, we can use a faster algorithm by Harvey [START_REF] Harvey | Algebraic algorithms for matching and matroid problems[END_REF] instead of the augmentation-type algorithm. His algorithm is an algebraic one for finding a common base of two linear matroids. We reduce our instance to the problem of finding a common base, that corresponds to a (w 1 , w 2 )-near-optimal maximum-cardinality common independent set. We first describe basic properties of a linear matroid M = (S, I) of rank r. We assume that M is represented by an r × n matrix A whose column set is S and row set is denoted by R. We denote by A[I, J] the submatrix consisting of row set I and column set J. For a set X, we denote the complement by X.

It is known that the restriction and contraction of the linear matroid M are both linear. Indeed, for a subset X ⊆ S, M|X has the matrix representation A|X = A[R, X]. Moreover, taking a nonsingular submatrix of maximum size in A[R, X], denoted by A[Y, Z], we have the matrix representation A/X of the contraction M/X in the form of

A/X = A[Y , X] -A[Y , Z]A[Y, Z] -1 A[Y, X].
The row set of A/X is Y = R \ Y . See e.g., [START_REF] Harvey | An algebraic algorithm for weighted linear matroid intersection[END_REF] for more details. The direct sum of linear matroids M 1 and M 2 is also linear, whose matrix representation is the block diagonal matrix arranging the two matrices for M 1 and M 2 on the diagonal.

Suppose that we are given a weight function w: S → {0, 1, . . . , W }. Then, by Lemma 3.2.1(i), M w is also linear, and its matrix representation A w is in the form of

A w = W t=0 (A|Z(t))/Z(t + 1), (3.1)
and U 2 , we take U * 1 and U * 2 with maximum size. We can find a common base

I for A ′ 1 [U * 1 , S ′ ] and A ′ 2 [U * 2 , S ′
] by Harvey's algorithm in O(nr ω-1 ) time [START_REF] Harvey | Algebraic algorithms for matching and matroid problems[END_REF]. Since I satisfies the conditions of the above claim, I is (w 1 , w 2 )-near-optimal with maximum size in S ′ . Thus I is a desired set.

It remains to show that we can find such maximum U * 1 and U * 2 in O(nr ω-1 ) time. Construct N = -A ′ 1 D -1 A ′ ⊤ 2 in O(nr ω-1 ) time, which has the row set R 1 and column set R 2 . By Proposition 3.5.4, for

U 1 ⊆ R 1 and U 2 ⊆ R 2 , both A ′ 1 [U 1 , S ′ ] and A ′ 2 [U 2 , S ′ ] have a com- mon base if and only if N [U 1 , U 2 ] is nonsingular, which follows from the fact that N [U 1 , U 2 ] = -A ′ 1 [U 1 , S ′ ]D -1 (A ′ 2 [U 2 , S ′ ]) ⊤ . Therefore, it suffices to find U * 1 ⊆ R 1 and U * 2 ⊆ R 2 with maximum size such that Y 1 (1) ⊆ U * 1 and Y 2 (p + 1) ⊆ U * 2 and N [U * 1 , U * 2 ]
is nonsingular. This can be done in O(r ω ) time, since the rank of N is at most r.

Since Update Weight can be performed in O(nr ω-1 ) time, we can solve the weighted matroid intersection exactly in O(W nr ω-1 ) time and approximately in O(ϵ -1 nr ω-1 log r) time.

Furthermore, using a preprocessing technique by Cheung, Kwok, and Lau [START_REF] Cheung | Fast matrix rank algorithms and applications[END_REF], we can improve the computational time. Given a positive integer k, their algorithm reduces an r × n matrix A to an O(k) × n matrix A ′ such that, if a column set in A ′ of size at most k is independent, then it is independent in A with high probability. This can be done in O(nr) time.

We simply use this algorithm where k is set to be the maximum size r * ≤ r of a common independent set of M 1 and M 2 . The size r * can be computed in O(nr log r * + nr ω-1 * ) time [START_REF] Cheung | Fast matrix rank algorithms and applications[END_REF]. After we obtain two O(r * ) × n matrices by their method, apply our algorithm to obtain a maximum-weight common independent set. This takes O(W nr ω-1 * ) time for an exact algorithm and O(ϵ -1 nr ω-1 * log r * ) time for an approximation algorithm. Therefore, we have the following theorem. It should be noted that our algorithm is simple in the sense that it involves only a constant matrix and does not need to manipulate a univariate-polynomial matrix [START_REF] Storjohann | High-order lifting and integrality certification[END_REF], unlike the algorithms in [START_REF] Harvey | An algebraic algorithm for weighted linear matroid intersection[END_REF][START_REF] Sankowski | Maximum weight bipartite matching in matrix multiplication time[END_REF].

Rank-Maximal Matroid Intersection

In this section, we deal with the rank-maximal matroid intersection problem. As mentioned in the introduction, this problem can be reduced to a weighted matroid intersection problem whose weight w is drawn from {1, n, n 2 , . . . , n R-1 }. More generally, we consider the case where the weight w is drawn from a geometric series {1, u, u 2 , . . . , u R-1 }, where u ≥ 2. Let d k be the difference of two consecutive weights, i.e., d k = u ku k-1 for k = R, R -1, . . . , 1. For convenience, we also define d 0 = 1.

Our algorithm for the geometric-series weight case is described as follows, where the only difference from our exact algorithm (Algorithm 1 in Section 3.3) is in the dual update Step (2-4): we update w 1 and w 2 with large weight d k .

Algorithm 3: Exact algorithm for geometric-series weights Input: two matroids M 1 = (S, I 1 ) and M 2 = (S, I 2 ), a weight function w

: S → {1, u, u 2 , • • • , u R-1 },
where u ≥ 2.

Output: I ∈ I 1 ∩ I 2 where I is a maximum-weight common independent set of M 1 and M 2 .

Step 1. Set k := R -1, w 1 := 0, w 2 := w, and I ′ := ∅.

Step 2. While k > 0 do the following steps.

(2-1)

Set S ′ := {e ∈ S | w 2 (e) ≥ u k }. (2-2) Set M ′ ℓ := M w ℓ ℓ |S ′ for each ℓ = 1, 2. (2-3) Unweighted Matroid Intersection (I ′ )
Construct I so that (i) I is a maximum-cardinality common independent set of M ′ 1 and M ′ 2 , and (ii) I is (w 1 , w 2 )-near-optimal in S ′ .

(2-4) Update Weight

(2-4-1) Let T ⊆ S ′ be the set of elements reachable from X 2 in G M ′ 1 ,M ′ 2 (I).
(2-4-2) For each e ∈ T , let w 1 (e) := w 1 (e) + d k , w 2 (e) := w 2 (e)d k .

(2-5) Set k := k -1 and I ′ := I.

Step 3. Return I.

In the following, we prove the correctness of Algorithm 3 by showing that it would have the same outcome as if we had run Algorithm 1 in Section 3.3 instead. For the purpose, we first need a technical lemma, whose proof exploits the property that each weight is at least double the previous weight in the given geometric series of weights w. Lemma 3.6.1. At Step (2-1) of Round k (k = R -1, R -2, . . . , 1), we have the following for e and f in S ′ .

(i) If w 1 (e) ̸ = w 1 (f ), then |w 1 (e) -w 1 (f )|≥ d k+1 . (ii) If w 2 (e) ̸ = w 2 (f ), then |w 2 (e) -w 2 (f )|≥ d k+1 .
Proof. We prove (i) by induction on k. When k = R -1, all elements have w 1 -weights 0. So (i) holds trivially. For the induction step with k < R -1, if w 1 (e) ̸ = w 1 (f ), then at least one of them, say e, is part of S ′ in the last round (i.e., Round k + 1). To avoid confusion, the set S ′ in the last round is denoted by S ′ . Also w 1 and w 2 at Step (2-1) of the last round are denoted by w 1 and w 2 , respectively. Consider two possibilities. Case 1. Suppose that f ∈ S ′ . By induction hypothesis, either |w 1 (e)w 1 (f )|≥ d k+2 , or w 1 (e) = w 1 (f ). In the former case, the difference between the w 1 -weights of e and f is changed by at most d k+1 in the last round. Therefore, we have

|w 1 (e) -w 1 (f )|≥ d k+2 -d k+1 ≥ d k+1 ,
where the last inequality holds because u ≥ 2. In the latter case, either w 1 (e) = w 1 (f ) (if both w 1 (e) and w 1 (f ) are updated or unchanged in the last round), or |w 1 (e)w 1 (f )|= d k+1 (if exactly one of them is updated). Case 2. Suppose that f ̸ ∈ S ′ . Then w 1 (f ) = 0. If w 1 (e) has not been updated so far, then w 1 (e) = 0. Otherwise, since w 1 (e) is increased at Round s for some s ≥ k + 1, we have w 1 (e) ≥ d s ≥ d k+1 . The induction step is completed.

(ii) can be proved symmetrically.

To avoid confusion, let i be the index of the rounds when we apply Algorithm 1 in Section 3.3, and J i be the independent set obtained in Round i. Let k be the index of the rounds when we apply Algorithm 3, and I k be the independent set obtained at Round k of Algorithm 3.

Lemma 3.6.2. Define i k = u k for k = R -1, R -2, . . . , 1. For k = R -1, R -2, .
. . , 1 and ℓ = 1, 2, the weights w ℓ at Round i k of Algorithm 1 are the same as the weights w ℓ at Round k of Algorithm 3. Thus, for k = R -1, R -2, . . . , 1, the auxiliary graph in Round k of Algorithm 3 coincides with one in Round i k of Algorithm 1.

Proof. We prove by induction in k. When k = R -1 and i k = u R-1 , the lemma holds easily. For the induction step when k < R -1, we argue that the update of the w 1 -and w 2 -weights done in Round k + 1 of Algorithm 3 are the same as the accumulated updates of the w 1 -and w 2 -weights done in Algorithm 1 from Round i k+1 down to Round i k + 1. To be more precise, in Round k + 1 in Algorithm 3, all elements in S ′ ∩ T have their w 2 -weights decrease by the amount of d k+1 and their w 1 -weights increase by the same amount. We show that from Round i k+1 down to Round i k + 1 in Algorithm 1, the same set of elements have their w 2 -and w 1 -weights updated (and each round by the amount of one). This would prove the induction step.

For simplicity, we often denote i k+1t with (t) for t = 0, 1, . . . , d k+1 -1. Let G (t) be the auxiliary graph at Round i k+1t in Algorithm 1, and T (t) be the reachable set in G (t) found in Step (2-4) of Round i k+1t. We will show the following properties for Algorithm 1.

(1) The ground set S (t) is the same as S (0) .

(2) The reachable set T (t) is the same as T (0) .

(3) The independent set J (t) is the same as J (0) .

To see (1), observe that, in Algorithm 1, all elements e not in S (0) have w

(0) 2 (e) ≤ u k+1 -1. Since w (0)
2 (e) is equal to w(e), we see w (0) 2 (e) ≤ u k for e ̸ ∈ S (0) by the definition of w. Hence e is not contained in S (t) , as w

(t) 2 (e) = w (0) 2 (e) ≤ u k < u k+1 -t for 0 ≤ t ≤ d k+1 -1. Therefore, S (0) = S (t) .
To see (2), we first show T (t) ⊇ T (0) . Note that, by Lemma 3.2.1(iii), for an arc ef in G (0) , their w 1 -weights w (0) 1 (e) and w (0) 1 (f ) must be the same if e ̸ ∈ J (0) and f ∈ J (0) , and their w 2 -weights w (0) 2 (e) and w (0) 2 (f ) must be the same if e ∈ J (0) and f ̸ ∈ J (0) . Then, if both e and f are in T (0) or neither of them is in T (0) , their w 2 -weights (respectively w 1 -weights) remain the same in the subsequent rounds, and hence the arc ef appears in G (t) . Thus T (t) ⊇ T (0) . To prove T (t) ⊆ T (0) , it suffices to show that, in the auxiliary graph G (t) , there exists no new arc from an element e in T (0) to an element f not in T (0) . Note that, by the definition of T (0) , there exists no arc from e to f in G (0) .

First suppose that e ̸ ∈ J (0) and f ∈ J (0) . Then w (0)

1 (e) < w (0) 1 (f ) holds if the arc ef appeared in G (t) . It follows from the induction hypothesis of the lemma that G (0) coincides with G M ′ 1 ,M ′ 2 (I k+1 ) at Round k +1 of Algorithm 3. This implies by Lemma 3.6.1 that w

(0) 1 (f )-w (0)
1 (e) ≥ d k+2 . Hence, for any t = 0, 1, . . . , d k+1 -1, it holds that

w (t) 1 (f ) -w (t) 1 (e) ≥ w (0) 1 (f ) -(w (0) 1 (e) + t) ≥ d k+2 -d k+1 + 1 > 0,
where the last inequality follows from u ≥ 2. Therefore, we always have w

(t) 1 (f ) > w (t)
1 (e) for 0 ≤ t ≤ d k+1 -1, and thus the arc ef never appears in G (t) . Similarly, if e ∈ J (0) and f ̸ ∈ J (0) , then w Finally, (3) follows from the fact that in each round, there is no augmentation happening, as G (0) has no augmenting path and by (1) and (2) neither does G (t) . This completes the proof.

Theorem 3.6.3. The independent set I returned by Algorithm 3 is an optimal solution.

Therefore, using Cunningham's algorithm for the unweighted matroid intersection problem as a subroutine, we have the following theorem. Theorem 3.6.4. The rank-maximal matroid intersection problem can be solved using O(Rnr 1.5 ) independence oracle calls.

We note that even though the actual weights used in Algorithm 3 can be exponentially large, there is indeed no need to store them explicitly (otherwise, we incur the extra cost in time and space). We discuss in Section 3.6.1 the implementations details.

In addition, if the given two matroids are both graphic or both linear, then we can solve the problem fast. Theorem 3.6.5. The rank-maximal graphic matroid intersection problem can be solved in O(R √ rn log r) time.

Theorem 3.6.6. The rank-maximal linear matroid intersection problem can be solved in O(Rnr ω-1 ) time.

Implementation of Rank-Maximal Matroid Intersection

We discuss how to avoid storing the actual numerical values of the weights when implementing Algorithm 3. As discussed in Section 3.3, we need to draw an arc in the auxiliary graph properly and to do this, we just need to know that given any two elements e and f in S ′ , whether w ℓ (e) is larger than, equivalent to, or smaller than w ℓ (f ) for ℓ = 1, 2. There is no need to know the actual values.

It is easy to see that, at Round k, we have w 1 (e) = 0 + R-1 t=k+1 d t • 1 e∈T t and w 2 (e) = w(e) -R-1 t=k+1 d t • 1 e∈T t , where T t is the reachable set found in Step (2-4) of Round t. Using this fact, Lemma 3.6.1, and the definition of d k , we have Lemma 3.6.7. At Step (2-1) of Round k (k = R -1, R -2, . . . , 1), we have the following for e and f in S ′ .

(i) If w 1 (e) > w 1 (f ), then, in Round h = k -1, k -2, . . . , 1, w 1 (e) > w 1 (f ). (ii) If w 2 (e) > w 2 (f ), then, in Round h = k -1, k -2, . . . , 1, w 2 (e) > w 2 (f ).
Below we only discuss how to compare the w 1 -weight of the elements, since the w 2 -weight can be handled symmetrically.

In Round k, we can divide the elements according to their weights w 1 . There can be only O(n) such groups, g k (1), g k (2), . . ., ordered by their increasing weights. Inside each group g k (i), in the next round (Round k -1), the elements can be split into two subgroups, if a strict subset of the elements in g k (i) belongs to the reachable set T k in Step (2-4). However, by Lemma 3.6.7, in the next round, we know that elements belonging to these two subgroups of g k (i) will still have weights w 1 smaller than the elements from the subgroups derived from g k (i + 1), g k (i + 2), . . ., and larger than the elements from the subgroups derived from g k (i -1), g k (i -2), . . .. Finally, for the elements e newly-added in Round k -1, we have w 1 (e) = 0. These elements can be either added into the existing group with the smallest weight, or we can create a new group for them (and such a group necessarily has the smallest weight). The maintenance of such data structure as described can be easily done in O(n) time in each round of the algorithm.

Relation to Other Algorithms

For both the weight matching and the weighted matroid intersection problem, when the largest weight is not overly large, faster algorithms have been designed to leverage this fact. The more well-known technique is that of scaling [START_REF] Duan | Scaling algorithms for weighted matching in general graphs[END_REF][START_REF] Fujishige | An efficient cost scaling algorithm for the independent assignment problem[END_REF][START_REF] Gabow | Faster scaling algorithms for network problems[END_REF][START_REF] Gabow | Faster scaling algorithms for general graph-matching problems[END_REF][START_REF] Gabow | Efficient theoretic and practical algorithms for linear matroid intersection problems[END_REF][START_REF] Shigeno | A dual approximation approach to weighted matroid intersection[END_REF]. In each phase, the weights are rounded to speed up the computation; the weight rounding becomes more fine-grained in each successive round. In contrast, in [START_REF] Huang | New algorithms for maximum weight matching and a decomposition theorem[END_REF][START_REF] Kao | A decomposition theorem for maximum weight bipartite matchings[END_REF][START_REF] Pettie | A simple reduction from maximum weight matching to maximum cardinality matching[END_REF] and our present work, there is no rounding of weights. In each phase, only a subset of the edges (the ground set) is considered. Such subsets enlarge over the phases. We mentioned in passing that the recent result of Lee-Sidford-Wong [START_REF] Lee | A faster cutting plane method and its implications for combinatorial and convex optimization[END_REF] is a far department from the previous two general techniques, where a novel cutting-plane method is employed.

Since the weighted bipartite matching problem is a special case of the weighted matroid intersection problem, we can apply our exact algorithm to the special case: in fact our algorithm would behave similarly to the one by Kao et al. [START_REF] Kao | A decomposition theorem for maximum weight bipartite matchings[END_REF] with the same running time, though the data structures used are different.

It may be worthwhile contrasting our exact algorithm with the algorithm of Frank [START_REF] Frank | A weighted matroid intersection algorithm[END_REF] for two general matroids. He uses the weights w 1 and w 2 to "suppress" some edges in the original auxiliary graph. It can be shown that the modified auxiliary graph in his algorithm would be identical to the auxiliary graph of our matroids defined in each round. He augments the current independent set I repeatedly in the modified auxiliary graph, preserving the condition that I is a maximumweight common independent set with size |I|. On the other hand, our algorithm only maintains the relaxed optimality condition, and dramatically augments I with the aid of unweighted matroid intersection algorithms.

We mentioned earlier that Chekuri and Quanrud [START_REF] Chekuri | Fast approximations for matroid intersection[END_REF] have further improved the running time of our approximation algorithm for general matroids. Their speeding-up is achieved by a more sophisticated weight adjustment. In particular, in Step 2 of Algorithm 2, instead of finding a maximum-cardinality common independent set as we have done (this takes O(nr 1.5 τ ) time), they only compute a common independent set whose size (1ϵ)-approximates the former (thus they only need Õ(nrϵ -1 τ ) time).

to this, M matches the minimum number of vertices to rank r neighbors, and subject to that, M matches the minimum number of vertices to rank (r -1) neighbors, and so on, where r is the worst rank used in the preference lists of vertices.

The fair matching problem can be solved in polynomial time as follows: for an edge e with incident ranks i and j, let w(e) = n i-1 +n j-1 . It is easy to see that a maximum cardinality matching of minimum weight (under weight function w) is a fair matching in G. Such a matching can be computed via the maximum weight matching algorithm by resetting e's weight to 4n r -n i-1 -n j-1 , where r is the largest rank used in any preference list.

However this approach can be expensive even if we use the fastest maximum-weight bipartite matching algorithms [START_REF] Duan | A scaling algorithm for maximum weight matchings in bipartite graphs[END_REF][START_REF] Fredman | Fibonacci heaps and their uses in improved network optimization algorithms[END_REF][START_REF] Gabow | Faster scaling algorithms for network problems[END_REF][START_REF] Orlin | New scaling algorithms for the assignment and minimum mean cycle problems[END_REF]. The running time will be O(rmn) or Õ(r 2 m √ n). Note that these complexities follow from the customary assumption that an arithmetic operation takes O(r) time on weights of the order n r . We present two different techniques to efficiently compute fair matchings and a generalization called fair b-matchings.

A combinatorial technique. Our first technique is an iterative combinatorial algorithm for the fair matching problem. The running time of this algorithm is Õ(r * m √ n) or Õ(r * n ω ) with high probability, where r * is the largest rank used in a fair matching and ω ≈ 2.37 is the exponent of matrix multiplication. This algorithm is based on linear programming duality and in each iteration i, we solve the following "dual problem" -dual to a variant of the maximum weight matching problem.

Generalized minimum weighted vertex cover problem. Let G i = (A ∪ B, E i ) be a bipartite graph with edge weights given by w i : E i → {0, 1, . . . , c}. Let K i-1 ⊆ A ∪ B satisfy the property that there is a matching in G that matches all v ∈ K i-1 . Find a cover {y i u } u∈A∪B so that u∈A∪B y i u is minimized subject to (1) for each e = (a, b) in E i , we have y i a + y i b ≥ w i (e), and (2)

y i u ≥ 0 if u ̸ ∈ K i-1 .
When K i-1 = ∅, the above problem reduces to the standard weighted vertex cover problem. We show that the generalized minimum weighted vertex cover problem, where y i v for v ∈ K i-1 can be negative, can be solved via a single-source shortest paths subroutine in directed graphs, by a non-trivial extension of a technique of Iri [START_REF] Iri | A new method of solving transportation-network problems[END_REF].

A scaling technique. Our second technique uses scaling in order to solve the fair matching problem, by the aforementioned reduction to computing a maximum weight matching using exponentially large edge weights. It starts by solving the problem when each edge weight is 0 and then iteratively solves the problem for better and better approximations of the edge weights. This technique is applicable in the more generalized problem of computing fair b-matchings, where each vertex has a capacity associated with it. We solve the fair b-matching problem, in time Õ(rmn) and space O(m), by solving the capacitated transshipment problem, while carefully maintaining "reduced costs" whose values are within polynomial bounds. Brute-force application of the fastest known minimum-cost flow algorithms would suffer from the additional cost of arithmetic and an O(rm) space requirement. For instance, using [START_REF] Goldberg | Solving minimum-cost flow problems by successive approximation[END_REF] would result in Õ(r 2 mn) running time and O(rm) space.

Background

Fair matchings are a special case of the profiled-based matching problem. So far they have received little attention in the literature. Except the two pre-prints [START_REF] Huang | Weight-maximal matchings[END_REF][START_REF] Mehlhorn | Network problems with non-polynomial weights and applications[END_REF] on which this work is based, the only work we are aware of is the Ph.D. thesis of Sng [START_REF] Sng | Efficient Algorithms for bipartite matching problems with preferences[END_REF], where he gives an algorithm to find a fair b-matching1 in O(rQ min{m log n, n2 )) time, where Q = v∈V q(v), the sum of the capacity q(v) of all vertices v ∈ V .

The first profiled-based matching problem was introduced by Irving [START_REF] Irving | Greedy matchings[END_REF] and is called "rankmaximal matching" problem. 2 This problem has been well-studied [START_REF] Irving | Rank-maximal matchings[END_REF][START_REF] Kavitha | Efficient algorithms for weighted rank-maximal matchings and related problems[END_REF][START_REF] Michail | Reducing rank-maximal to maximum weight matching[END_REF][START_REF] Paluch | Capacitated rank-maximal matchings[END_REF]. E) is rank-maximal if M matches the maximum number of vertices to rank 1 neighbors, subject to this constraint, M matches the maximum number of vertices to rank 2 neighbors, subject to the above two constraints, M matches the maximum number of vertices to rank 3 neighbors, and so on.

Definition 4.1.2. A matching M in G = (A ∪ B,
However the rank-maximal matching problem has been studied so far in a more restricted model called the the one-sided preference lists model. In this model, only vertices of A have preferences over neighbors while vertices in B have no preferences. Note that a problem in the one-sided preference lists model can also be modeled as a problem with two-sided preference lists by making every b ∈ B assign rank r to every edge incident on it, where r is the worst rank in the preference lists of vertices in A.

The current fastest algorithm to compute a rank-maximal matching in the one-sided preference lists model takes time O(min{r * m √ n, mn, r * n ω }) [START_REF] Irving | Rank-maximal matchings[END_REF], where r * is the largest rank used in a rank-maximal matching. In the one-sided preference lists setting, each edge has a unique rank associated with it, thus the edge set E is partitioned into

E 1 ∪ E 2 ∪ • • • ∪ E r -
this partition enables the problem of computing a rank-maximal matching to be reduced to computing r * maximum cardinality matchings in certain subgraphs of G.

We show here that our fair matching algorithm can be easily modified to compute a rankmaximal matching in the two-sided preference lists model. Thus this problem can be solved in time Õ(r * m √ n) or Õ(r * n ω ) with high probability, which almost matches its running time for the one-sided case. Another problem that our algorithm can solve is the "maximum cardinality" rankmaximal matching problem. A matching M is a maximum cardinality rank-maximal matching if M has maximum cardinality, and within the set of maximum cardinality matchings, M is rankmaximal.

Organization of the paper. Section 4.2.1 contains our algorithm for the generalized bipartite vertex cover problem, Section 4.2.2 has our algorithm for fair matchings, and Section 4.2.3 has the extension to rank-maximal matchings in two-sided preference lists. Section 4.3 has our scaling algorithm.

Our Combinatorial Technique for fair matchings

Recall that our input here is G = (A ∪ B, E) and r is the worst or largest rank used in any preference list. The notion of signature will be useful to us in designing our algorithm. We first define edge weight functions w i , for 1 ≤ i ≤ r -1. The value w i (e), where e = (a, b), is defined as follows: Thus signature(M ) is an r-tuple, where the first coordinate is the size of M , the second coordinate is the number of vertices that get matched to neighbors ranked r -1 or better, and so on. Let OPT denote a fair matching. Then signature(OPT) ⪰ signature(M ) for any matching M in G, where ⪰ is the lexicographic order on signatures.

w i (e) =        2 if
In order to capture the first coordinate of signature(M ) also via an edge weight function, let us introduce the function w 0 defined as: w 0 (e) = 1 for all e ∈ E. Thus |M |= w 0 (M ) = e∈M w 0 (e). For any matching M and 0 ≤ j ≤ r -1, let signature j (M ) denote the (j + 1)-tuple obtained by truncating signature(M ) to its first j + 1 coordinates. Definition 4.2.2. A matching M is (j + 1)-optimal if signature j (M ) = signature j (OPT).

Our algorithm runs for r * iterations, where r * ≤ r is the largest index i such that w i-1 (OPT) > 0. For any j ≥ 0, in the (j + 1)-st iteration, our algorithm solves the minimum weighted vertex cover problem in a subgraph G j . This involves computing a maximum w j -weight matching M j in the graph G j under the constraint that all vertices of a critical subset K j-1 ⊆ A ∪ B have to be matched. In the first iteration which corresponds to j = 0, we have G 0 = G and K -1 = ∅.

The problem of computing M j will be referred to as the primal program of the (j + 1)-st iteration and the minimum weighted vertex cover problem becomes its dual. We will show M j to be (j+1)-optimal. The problem of computing M j can be expressed as a linear program (rather than an integer program) as the constraint matrix is totally unimodular and hence the corresponding polytope is integral. This linear program and its dual are given below. (Let δ(v) be the set of edges incident on vertex v.) Lemma 4.2.3. M j and y j are the optimal solutions to the primal and dual programs respectively, iff the following hold:

1. if u is unmatched in M j (thus u has to be outside K j-1 ), then y j u = 0;

2. if e = (u, v) ∈ M j , then y j u + y j v = w j (e); max e∈E w j (e)x j e e∈δ(v)

x j e ≤ 1 ∀v ∈ A ∪ B e∈δ(v)

x j e = 1 ∀v ∈ K j-1

x j e ≥ 0 ∀e in G j .

min v∈V y j v y j a + y j b ≥ w j (e) ∀e = (a, b) in G j y j v ≥ 0 ∀v ∈ (A ∪ B) \ K j-1 .
Proposition 4.2.3 follows from the complementary slackness conditions in the linear programming duality theorem. This suggests the following strategy once the primal and dual optimal solutions M j and y j are found in the (j + 1)-st iteration.

• to prune "irrelevant" edges: if e = (u, v) and y j u + y j v > w j (e), then no optimal solution of the j-th iteration primal program can contain e. So we prune such edges from G j and let G j+1 denote the resulting graph. The graph G j+1 will be used in the next iteration.

• to grow the critical set K j-1 : if y j u > 0 and u ̸ ∈ K j-1 , then u has to be matched in every optimal solution of the primal program of the (j + 1)-st iteration. Hence u should be added to the critical set. Adding such vertices u to K j-1 yields the critical set K j for the next iteration.

Below we first show how to solve the dual problem and then give the main algorithm.

Solving the dual problem

For any 0 ≤ j ≤ r -1, let G j = (A ∪ B, E j ) be the subgraph that we work with in the (j + 1)-st iteration and let K j-1 ⊆ A ∪ B be the critical set of vertices in this iteration. Recall that for each e ∈ E j , we have w j (e) ∈ {0, 1, 2}. We now show how to solve the dual problem efficiently for a more general edge weight function, i.e., w j (e) ∈ {0, 1, . . . , c} for each e ∈ E j .

Let M j be the optimal solution of the primal program (we discuss how to compute it at the end of this section). We know that M j matches all vertices in K j-1 . We now describe our algorithm to solve the dual program using M j . Our idea is built upon that of Iri [START_REF] Iri | A new method of solving transportation-network problems[END_REF], who solved the special case of

K j-1 = ∅. Recall that if a vertex v is unmatched in M j , then v ̸ ∈ K j-1 .
• Add a new vertex z to A and let A ′ = A ∪ {z}. Add an edge of weight 0 from z to each vertex in B \ K j-1 . For convenience, we call the edges from z to these vertices "virtual" edges. The matching M j still remains an optimal feasible solution after this transformation.

[Note that there are only O(n) virtual edges.]

• Next direct all edges e ∈ E j \ M j from A ′ to B and set the edge weight d(e) = -w j (e); also direct all edges in M j from B to A ′ and let the edge weight d(e) = w j (e).

• Create a source vertex s and add a directed edge of weight 0 from s to each unmatched vertex in A ′ . See Let R denote the set of all vertices in A ′ ∪ B that are reachable from s. In Figure 4.

1, R = {z, a 3 , b 1 , b 2 }. Lemma 4.2.4. By the above transformation, 1. B \ K j-1 ⊆ R.
2. There is no edge between A ′ ∩ R and B \ R.

3. M j projects on to a perfect matching between A ′ \ R and B \ R.

Proof. Part (1) holds because there is a directed edge from s to z and directed edges from z to every vertex in B \ K j-1 . To show part (2), it is trivial to see that there can be no edge from A ′ ∩ R to B \ R (by the definition of B \ R). If there is an edge (b, a) from B \ R to A ′ ∩ R, then this has to be an edge in M j and hence it is a's only incoming edge. So for a to be reachable from s, it has to be the case that b is reachable from s, contradicting that b ∈ B \ R.

For part [START_REF] Abraham | Popular matchings[END_REF], observe that if b ∈ B \ R is unmatched in M j , then b ̸ ∈ K j-1 and such a vertex can be reached via z, contradicting the assumption that b ∈ B \ R. If a ∈ A ′ \ R is unmatched in M j , then such a vertex can be reached from s, contradicting the assumption that a

∈ A ′ \ R. So all vertices in (A ′ ∪ B) \ R are matched in M j . By (2), a vertex b ∈ B \ R cannot be matched to vertices in A ′ ∩ R. If a vertex a ∈ A ′ \ R is matched to a vertex B in R, then a is also in R, a contradiction.

This proves part (3).

Note that there may exist some edges in E j \ M j that are directed from A ′ \ R to B ∩ R. Furthermore, some vertices of A \ K j-1 can be contained in A \ R. Delete all edges from A ′ \ R to B ∩ R from G j ; let H j denote the resulting graph. By Lemma 4.2.4.3, no edge of M j has been deleted, thus M j belongs to H j and M j is still an optimal matching in the graph H j . Moreover, H j is split into two parts: one part is (A ′ ∪ B) ∩ R, which is isolated from the second part (A ′ ∪ B) \ R. See Figure 4.2.

Next add a directed edge from the source vertex s to each vertex in B \ R. Each of these edges e has weight d(e) = 0. By Lemma 4.2.4.3, all vertices can be reached from s now. Also note that there can be no negative-weight cycle, otherwise, we can augment M j along this cycle to get a

A B A ∩ R A \ R B ∩ R B \ R Figure 4.2: The set A ′ ∪ B in the graph Hj is split into two parts: (A ′ ∪ B) ∩ R and (A ′ ∪ B) \ R
matching of larger weight while still keeping the same set of vertices matched, which leads to a contradiction to the optimality of M j .

Apply the single-source shortest paths algorithm [START_REF] Goldberg | Scaling algorithms for the shortest paths problem[END_REF][START_REF] Sankowski | Shortest paths in matrix multiplication time[END_REF][START_REF] Sankowski | Maximum weight bipartite matching in matrix multiplication time[END_REF][START_REF] Yuster | Answering distance queries in directed graphs using fast matrix multiplication[END_REF] from the source vertex s in this graph H j where edge weights are given by d(•). (We will adjust this cover further later.) Lemma 4.2.5. The constructed initial vertex cover {ỹ v } v∈A ′ ∪B for the graph H j satisfies the following properties:

1. For each vertex v ∈ ((A ∪ B) ∩ R) \ K j-1 , ỹv ≥ 0. 2. If v ∈ (A ∪ B) \ K j-1 is unmatched in M j , then ỹv = 0.
3. For each edge e = (a, b) ∈ H j , we have ỹa + ỹb ≥ w j e .

4. For each edge e = (a, b) ∈ M j , we have ỹa + ỹb = w j e .

Proof. For part (1), suppose that a ∈ (A ∩ R) \ K j-1 and ỹa < 0. By Lemma 4.2.4.2 and the fact that all edges from A ′ \ R to B ∩ R are absent, the shortest path from s to a cannot go through (A ∪ B) \ R. So there exists an alternating path P (of even length) starting from some unmatched vertex a ′ ∈ (A ′ ∩ R) \ K j-1 and ending at a. The distance from a ′ to a along path P must be negative, since d a = ỹa < 0. Therefore,

e∈Mj ∩P w e < e∈P \Mj w e .
Note that it is possible that the first edge e = (a ′ , b) ∈ P is a virtual edge, i.e., a ′ = z and the first edge e connects z to some vertex b ∈ (B ∩ R) \ K j-1 . In this case, d e = 0 and b is not an element of the critical set K j-1 . Therefore, irrespective of whether the first edge is virtual or not, we can replace the matching M j by M j ⊕ P (ignoring the first edge in P if it is virtual), thereby creating a feasible matching with larger weight than M j , a contradiction. by induction hypothesis, M is (j -1)-optimal. For each edge e = (a, b) ∈ M to be present in G j , e must be a tight edge in the j-th iteration, i.e., y j-1 a + y j-1 b = w j-1 (e). Furthermore, as K j-1 ⊇ {u} y j-1 u >0 , we have

w j-1 (M ) = e=(a,b)∈M w j-1 (e) = e=(a,b)∈M y j-1 a + y j-1 b ≥ u∈A∪B y j-1 u ,
where the final inequality holds because all vertices v with positive y j-1 v are matched in M . By linear programming duality, M must be optimal in the primal program of the j-th iteration. So the j-th primal program has optimal solution of value w j-1 (M ).

Recall that by definition, OPT is also (j -1)-optimal. By (2) of the induction hypothesis, OPT is a matching in G j-1 and OPT matches all vertices in K j-2 . So OPT is a feasible solution of the primal program in the j-th iteration. Thus w j-1 (OPT) ≤ w j-1 (M ). However, it cannot happen that w j-1 (OPT) < w j-1 (M ), otherwise, signature(M ) ≻ signature(OPT), since both OPT and M have the same first j -1 coordinates in their signatures. So we conclude that w j-1 (OPT) = w j-1 (M ), and this implies that M is j-optimal as well. This proves (1).

In order to show (2), let M ′ be a j-optimal matching in G. Since M ′ is j-optimal, it is also (j -1)-optimal and by (2) of the induction hypothesis, it is a matching in G j-1 that matches all vertices in K j-2 . So M ′ is a feasible solution to the primal program of the j-th iteration. As signature(M ′ ) has w j-1 (OPT) in its j-th coordinate, M ′ must be an optimal solution to this primal program; otherwise there is a j-optimal matching with a value larger than w j-1 (OPT) in the j-th coordinate of its signature, contradicting the optimality of OPT. By Proposition 4.2.3.2, all edges of M ′ are present in G j and by Proposition 4.2.3.1, all vertices u ̸ ∈ K j-2 with y j-1 u > 0, in other words, all vertices in K j-1 \ K j-2 have to be matched by the optimal solution M ′ . This completes the proof of (2).

Since our algorithm returns a matching in G r that matches all vertices in K r-1 , we know from Lemma 4.2.8.1 that this matching is r-optimal, thus the matching returned is fair. As mentioned earlier, our algorithm can be modified so that it terminates in r * iterations. For that, we need to know the value of r * .

We continue to use the weight function w 0 : E → {1}, however instead of w 1 , . . . , w r , we should use the weight functions w1 , . . . , wr * -1 where for 1 ≤ i ≤ r * -1, wi is defined as: for any edge e = (a, b), wi (e) is 2 if both a and b rank each other as rank ≤ r *i + 1 neighbors, it is 1 if exactly one of {a, b} ranks the other as a rank ≤ r *i + 1 neighbor, otherwise it is 0. The value r * can be easily computed right at the start of our algorithm as follows.

• Let M * be a maximum cardinality matching in G. The value r * is the smallest index j such that the subgraph Ḡj admits a matching of size |M * |, where Ḡj is obtained by deleting all edges e = (a, b) from G where either a or b (or both) ranks the other as a rank > j neighbor.

• We compute r * by first computing M * and then computing a maximum cardinality matching in Ḡ1 , Ḡ2 , . . . and so on till we see a subgraph Ḡj that admits a matching of size |M * |. This index j = r * and it can be found in O(r * m √ n) time [? ] or in O(r * n ω ) time [START_REF] Harvey | Algebraic algorithms for matching and matroid problems[END_REF][START_REF] Mucha | Maximum matchings via gaussian elimination[END_REF].

We now bound the running time of our algorithm. We showed how to solve the dual program in O(m √ n) time once we have the solution to the primal program and we have seen that the primal program can be solved in O(m √ n log n) time. Alternatively, both the primal and dual problems can be solved in Õ(n ω ) time with high probability. Theorem 4.2.9 follows.

Theorem 4.2.9.

A fair matching M in G = (A ∪ B, E) can be computed in Õ(r * m √ n) time,
or in Õ(r * n ω ) time with high probability, where r * is the largest rank incident on an edge in M , n = |A ∪ B|, m = |E|, and ω ≈ 2.37 is the exponent of matrix multiplication.

Two-sided rank-maximality

In this section we show how our fair matching algorithm can be modified to solve the rank-maximal matching problem and the maximum cardinality rank-maximal matching problem in the domain of two-sided preference lists. For both these problems, we use the same algorithm that we designed for fair matchings -the only difference is in how the edge weight functions w 0 , . . . , w r-1 are defined. Consider the maximum cardinality rank-maximal matching problem. Here we use the same function w 0 that we used in the fair matching algorithm, i.e., w 0 (e) = 1 for all e ∈ E. For 1 ≤ i ≤ r -1 and e = (a, b), w i (e) = 2 if both a and b rank each other as rank i neighbors, it is 1 if exactly one of {a, b} ranks the other as a rank i neighbor, otherwise it is 0.

It is easy to see that the matching OPT under the above weight functions is a maximum cardinality rank-maximal matching in G. When the algorithm given in Section 4.2.2 is run using these edge weight functions, the matching returned has signature signature(OPT) (by Lemmas 4.2.7 and 4.2.8), in other words, it is a maximum cardinality rank-maximal matching. This algorithm can again be made in terminate in r * iterations (Appendix A has the details).

In the rank-maximal matching problem, we define the functions w 0 , . . . , w r-1 from E to {0, 1, 2} as follows. For 0 ≤ i ≤ r -1 and e = (a, b), w i (e) = 2 if both a and b rank each other as rank i + 1 neighbors, it is 1 if exactly one of {a, b} ranks the other as a rank i + 1 neighbor, otherwise it is 0. Using these edge weight functions and our algorithm from Section 4.2.2, we get a rank-maximal matching in the two-sided preference lists model. Again, this algorithm can be made in terminate in r * iterations (via the same details as in the case above -see Appendix A). We conclude this section with the following theorem. Theorem 4.2.10. A rank-maximal/maximum cardinality rank-maximal in G = (A ∪ B, E) with two-sided preference lists, can be computed in Õ(r * m √ n) time, or in Õ(r * n ω ) time with high probability, where r * is the largest rank used in such a matching.

The fair b-matching problem: our scaling technique

The fair matching problem can be generalized by introducing capacities on the vertices. We are given G = (A ∪ B, E) as before, along with the capacity function q : V → S >0 . What we seek is a subset E ′ of E where each vertex v ∈ A ∪ B is incident to at most q(v) edges in E ′ . Such a subset E ′ is a b-matching. Our goal here is to find a fair b-matching, i.e., a b-matching M which has the largest possible size, subject to this constraint, M matches the minimum number of vertices to their rank r neighbors, and so on.

The fair b-matching problem can be reduced to the minimum-cost circulation problem as follows. Add two additional vertices s and t. For each vertex a ∈ A, add an edge (s, a) with capacity q(a) and cost zero; for each vertex b ∈ B, add an edge (b, t) with capacity q(b) and cost zero. Every edge (a, b) where a ∈ A, b ∈ B has capacity one and is directed from A to B. If the incident ranks on edge e are i and j, then e will be assigned a cost of -(4n rn i-1n j-1 ). The resulting instance has a trivial upper bound of n 2 /4 on the maximum s-t flow. We also add an edge from t to s with zero cost and capacity larger than the n 2 /4 upper bound. It is easy to verify that a minimum-cost circulation yields a fair b-matching.

We note however, that the above reduction involves costs that are exponential in the size of the original problem. We now present a general technique in order to handle these huge costswe focus on solving the capacitated transshipment version of the minimum-cost flow problem [? ]. Let G = (V, E) be a directed network with a cost c : E → S and capacity u : E → S ≥0 associated with each edge. With each v ∈ V a real number b(v) is associated, where v∈V b(v) = 0. If b(v) > 0, then v is a supply node, and if b(v) < 0, then v is a demand node. We assume G to be symmetric, i.e., e ∈ E implies that the reverse arc e R ∈ E. The reversed edges are added in the initialization step. The cost and capacity functions satisfy c(e) = -c(e R ) for each e ∈ E, u(e) ≥ 0 for the original edges and u(e R ) = 0 for the additional edges. From now on, E denotes the set of original and artificial edges.

A pseudoflow is a function x : E → S satisfying the capacity and antisymmetry constraints: for each e ∈ E, x(e) ≤ u(e) and x(e) = -x(e R ). This implies x(e) ≥ 0 for the original edges. For a pseudoflow x and a node v, the imbalance imb x (v) is defined as

imb x (v) = (w,v)∈E x(w, v) + b(v).
A flow is a pseudoflow x such that, imb x (v) = 0 for all v ∈ V . The cost of a pseudoflow x is cost(x) = e∈E c(e)x(e). The minimum-cost flow problem asks for a flow of minimum cost.

For a given flow x, the residual capacity of e ∈ E is u x (e) = u(e)x(e). The residual graph G(x) = (V, E(x)) is the graph induced by edges with positive residual capacity. A potential function is a function π : V → S. For a potential function π, the reduced cost of an edge e = (v, w) is c π (v, w) = c(v, w) + π(v)π(w). A flow x is optimal if and only if there exists a potential function π such that c π (e) ≥ 0 for all residual graph edges e ∈ E(x). For a constant ε ≥ 0 a flow is ε-optimal if c π (e) ≥ -ε for all e ∈ E(x) for some potential function π. Consider an ε-optimal flow x and any original edge e. If c π (e) < -ε, the residual capacity of e must be zero and hence e is saturated, i.e., x(e) = u(e). If c π (e) > ε, we have c π (e R ) = -c π (e) < -ε and hence the residual capacity of e R must be zero. Thus e R is saturated, i.e., x(e R ) = u(e R ) = 0. So e is unused.

We are now ready to describe our scaling algorithm, which is presented in a concise form in Figure 4.3. The details are given in Appendix B. We conclude this section with Theorem 4.3.1, which follows from the edge cost values used in our reduction. (a) Add two additional vertices s and t. For each vertex a ∈ A, add an edge (s, a) with capacity q(a) and cost zero; for each vertex b ∈ B, add an edge (b, t) with capacity q(b) and cost zero. Add an edge from t to s with zero cost and capacity larger than n 2 /4.

(b) Direct any edge (a, b) where a ∈ A and b ∈ B from A to B, set its capacity to one and cost to -(4n rn i-1n j-1 ).

(c) Set the demand/supply values of all vertices to zero. Add, if required, additional edges to ensure that G is symmetric.

2. Initialization Phase.

(a) Multiply all edge costs by 2 1+⌈log n⌉ to make them divisible by the same amount.

(b) Let K = ⌈log C⌉ where C is the magnitude of the largest edge cost and let E i , 1 ≤ i ≤ K denote the set of all edges having a 1 in the i-th bit of their cost.

(c) Initialize x 0 to any feasible flow and reduced cost c 0 (e) = 0 for any e ∈ E.

3. Scaling Phase.

For i = 1 to K do (a) Let ci (e) = 2c i-1 (e) + (1 if e ∈ E i else 0) × sign(e)
, where sign(e) = ±1 depending on the sign of the original cost c(e). The flow x i-1 is 3-optimal with respect to the cost function ci and the zero potential function, i.e., the potential of all the vertices is 0.

(b) Use the results of [? ] with input (i) the flow x i-1 , (ii) ci as the edge cost function and (iii) the zero potential function, to compute a 1-optimal flow and a potential function π which proves the 1-optimality. Let x i be this flow. where the last inequality holds because if a vertex u is unmatched, Lemma 4.2.5.2 states that ỹu = 0 and since u must be in R, we have y u = ỹu = 0. Now by the linear programming duality theorem, we conclude that the cover {y v } v∈A∪B is optimal.

Proof of Lemma 4.2.7. By linear programming duality, if the primal program of the (j + 1)-st iteration is bounded from above and admits a feasible solution, then there is also a feasible solution for its dual. It is obvious that the primal program is bounded from above since it is upper bounded by e∈E w j (e) ≤ 2m. Therefore, to prove this lemma, we just need to show the feasibility of the primal program. The base case is j = 0. Since K -1 = ∅, any matching in G 0 = G is a feasible solution for the first primal program. For j ≥ 1, we need to show that the primal program of the (j + 1)-st iteration is feasible. By induction hypothesis, assume that the primal program of the j-th iteration is feasible. Let M j-1 denote its optimal solution. Since M j-1 is a feasible point of the primal program of the j-th iteration, M j-1 uses only edges in G j-1 and matches all vertices in K j-2 . Since M j-1 is, in fact, an optimal solution to the primal program of the j-th iteration, we will show that M j-1 has to be a feasible point of the primal program of the (j + 1)-st iteration by arguing that M j-1 does not use any of the edges pruned from G j-1 and all vertices in K j-1 are matched in M j-1 .

In step 2(c) of the j-th iteration, we remove only those edges e = (a, b) such that y j-1 a + y j-1 b > w j-1 (e) from G j-1 to form G j . By the optimality of M j-1 , we know from Proposition 4.2.3.2 that M j-1 has no slack edges, thus all edges in M j-1 are retained in G j .

We also know from Proposition 4.2.3.1 that if y j-1 u > 0, then u must be matched in M j-1 .

Therefore, all vertices in K j-1 \K j-2 are matched in M j-1 . Moreover, as M j-1 is also a feasible solution in the j-th primal program, all vertices in K j-2 are matched in M j-1 . This completes the proof of Lemma 4.2.7.

Two-sided rank-maximal matchings: terminating in r * iterations In the problems of computing rank-maximal matchings and maximum cardinality rank-maximal matchings (from Section 4.2.3), we can terminate our algorithm from Section 4.2.2 in r * iterations by inserting the following step at the end of Step 2 in every iteration. Also, this new step has the same complexity as the primal program.

Step 2(d) (in the (j + 1)-st iteration). Define the graph G ′ j+1 as follows: the edge set is exactly the same as in G j+1 ; however the edge weight function w ′ j is as follows. For each edge e in G ′ j+1 : set w ′ j (e) = 1 if r i=j w i (e) > 0, else set w ′ j (e) = 0.

-Now find a maximum w ′ j -weight matching M ′ j+1 in G ′ j+1 that matches all vertices in K j . If the weight of M ′ j+1 is 0, then return M j as the final solution, where M j is the primal optimal solution of the (j + 1)-st iteration. (1) For any j ≥ 0, if the matching M ′ j+1 has weight 0, then M j is a fair matching.

(2) If r * is the largest rank incident on an edge in OPT, then M ′ r * has weight 0.

Proof. We first show (1). Suppose w ′ j (M ′ j+1 ) = 0. Since all edge weights are non-negative, we claim that any matching M in G j+1 that matches all vertices in K j must have w j (M ) = w j+1 (M ) = • • • = w r-1 (M ) = 0, otherwise, w ′ j (M ) > 0, a contradiction to the assumption that the maximum weight matching M ′ j+1 in G ′ j+1 satisfies w ′ j (M ′ j+1 ) = 0. As a result, both M j and OPT have 0 in the last rj coordinates in their signatures, since M j (by its optimality in G j ) and OPT (by Lemma 4.2.8.2) are matchings in G j that match all vertices of K j-1 . By Lemma 4.2.8.1, M j is (j + 1)-optimal. Hence signature(M j ) = signature(OPT), thus M j is fair and (1) is proved.

We prove (2) by contradiction. Suppose r * is the largest rank on an edge incident in OPT and we have w

′ r * -1 (M ′ r * ) > 0. Since M ′ r * is a matching in G r * that matches all vertices in K r * -1 , it follows from Lemma 4.2.8.1 that M ′ r * is r * -optimal.
While OPT has only 0 in its last rr * coordinates, M ′ r * has some positive values in its last rr * coordinates; so we have M ′ r * ≻ OPT. This is a contradiction to the optimality of OPT.

Appendix B: Missing details from Section 4.3

We now give the details of our algorithm from Section 4.3, which was presented in Figure 4.3. Goldberg and Tarjan [? ] gave a scaling algorithm for the capacitated transshipment problem. It scales the costs and runs in O(log(nC)) phases where C is the magnitude of the largest edge cost. We assume that capacities, demands and supplies are polynomially bounded in n, but costs may be exponential in the input size. We modify the algorithm of Goldberg and Tarjan so that all numbers handled by the algorithm are polynomially bounded. The main ideas are to maintain node potentials implicitly by storing only reduced costs and to fix the flow across edges of large (positive or negative) reduced cost. Fixing flow or node potentials has been previously used in network problems in order to obtain strongly polynomial algorithms [? , page 397].

First we assume that all costs are divisible by 2 1+⌈log n⌉ . In case they are not, we can always multiply them by 2 1+⌈log n⌉ . This guarantees that a 1-optimal flow is optimal. We refer the reader to [? ] for more details. Let K = ⌈log C⌉ where C is the magnitude of the largest edge cost. We assume that each cost is a signed integer ±b 1 b 2 . . . b K , where b 1 is the most significant bit. For 0 ≤ i ≤ K, let c i (e) = ⌊c(e)/2 K-i ⌋ be the cost obtained by considering only the first i-bits of the binary representation of c(e) when viewed as numbers with K bits.

Our scaling algorithm works in phases; in phase i it computes a 1-optimal flow with respect to the cost function c i and some potential function π i . During the algorithm we store explicitly only the reduced costs and not the potential function. Nevertheless, we use π i to refer to the potential function in phase i. In phase zero we set the cost of every edge to zero and calculate any feasible flow x 0 . The zero potential function on the vertices, i.e., the potential of all the vertices is 0, guarantees the 1-optimality of x 0 . We therefore set the reduced cost c π0 0 (e) = 0 for any e ∈ E. Consider next any phase i with i ≥ 1. At the beginning of the phase, we have a 1-optimal flow x i-1 and a reduced cost function c πi-1 i-1 . We scale up by multiplying the potentials and the edge costs by 2 and adding ±1 (after multiplying by 2) to the edge costs of edges in E i (we either add or subtract based on the sign of c(e)). The reduced costs scale up as follows:

ci (e) = 2c πi-1 i-1 (e) + (1 if e ∈ E i else 0) × sign(e) (4.1)
where E i is the set of edges having a one in the i-th bit of their cost and sign(e) is 1 or -1 depending on the sign of the original cost c(e) of e. At the end of phase i -1, the flow x i-1 is 1-optimal and therefore c πi-1 i-1 (e) ≥ -1 for any edge e with positive residual capacity. After scaling up, Equation (4.1) gives us that any edge with positive residual capacity has ci (e) ≥ -3. This is equivalent to saying that x i-1 is 3-optimal with respect to the edge costs ci and the zero potential function on the vertices, i.e., the potential function which is zero for all vertices. We use a variant of the algorithm of Goldberg and Tarjan [? ] to transform the 3-optimal flow into a 1-optimal flow. Lemma 4.3.3 (from [? ], see also [? ]). Given the edge cost function ci and a 3-optimal flow x i-1 with respect to the zero potential function, in time O(mn log (n 2 /m)) one can compute a flow x i and a potential function π such that x i is 1-optimal with respect to the potential function π.

Potentials are only decreased, starting from zero, during the computation and π(v) ≥ -d • n for some constant d and all v.

At the end of the phase, we recompute the reduced costs as

c πi i (u, v) = ci (u, v) + π(u) -π(v)
. Recall that we do not store the potential function π i which at this point would be π i (v) = 2π i-1 (v)+ π(v). We next show that edges of large reduced cost can be discarded; more precisely, we can fix their flow to either zero or the capacity.

Handling large reduced costs. We say that the reduced cost of an edge e is large positive from phase i on, if c πj j (e) > 1 at the end of every phase j ≥ i, and is large negative from phase i on, if c πj j (e) < -1 at the end of every phase j ≥ i. If e is large positive from phase i on, we have x j (e) = 0 for all j ≥ i and if e is large negative from phase i on, we have x j (e) = u(e) for all j ≥ i. Lemma 4.3.4. Let e = (u, v) and d be the constant from Lemma 4.3.3. If ci (e) > 2dn + 1 at the beginning of phase i, e is large positive from phase i on, and if ci (e) < -2dn -1 at the beginning of phase i, e is large negative from phase i on.

Proof. Assume ci (e) > 2dn+1 at the beginning of some phase i. Then, at the end of phase i we have c πi i (e) = ci (u, v) + π(u)π(v) > dn + 1 since we know from Lemma 4.3.3 that -dn ≤ π(v) ≤ 0 for all v ∈ V . Therefore, at the beginning of the next phase ci+1 (e) = 2c πi i (e) + (1 if e ∈ E i+1 else 0) × sign(e) > 2dn + 2 -1 = 2dn + 1. Thus, e is large positive from phase i onwards.

Assume next that ci (e) < -dn -1 at the beginning of some phase i. Then, at the end of phase i we have c πi i (e) = ci (u, v) + π(u)π(v) < -dn -1 since we know from Lemma 4.3.3 that -dn ≤ π(v) ≤ 0 for all v ∈ V . At the beginning of the next phase ci+1 (e) = 2c πi i (e) + (1 if e ∈ E i+1 else 0) × sign(e) < -2dn -2 + 1 = -2dn -1. Thus, e is large negative from phase i onwards.

Lemmas 4.3.3 and 4.3.4 allow us to fix the flow across an edge e once |c i (e)|> dn+1. We remove the edge e (and its reversal e R ) from the graph and modify the imbalances of both endpoints accordingly, by adjusting supply and demand values. Thus, all reduced costs can be bounded by O(n) and all arithmetic operations involve polynomially bounded numbers. Theorem 4.3.5 now follows.

Theorem 4.3.5. The minimum cost flow problem with polynomially bounded demands can be solved in O(T + mn log (n 2 /m) log nC) time and O(S + m) space using arithmetic only on numbers of size polynomial in n, where C is the magnitude of the largest edge cost and T and S are the time and space bounds of an algorithm to sequentially enumerate the sets E i , 1 ≤ i ≤ ⌈log C⌉, of all edges having a 1 in the i-th bit of their weight.

functions have attracted much attention from the machine learning community because they can model various practical problems such as online advertising [START_REF] Alon | Optimizing budget allocation among channels and influencers[END_REF][START_REF] Kempe | Maximizing the spread of influence through a social network[END_REF][START_REF] Soma | Optimal budget allocation: Theoretical guarantee and efficient algorithm[END_REF], sensor location [START_REF] Krause | Near-optimal sensor placements in gaussian processes: Theory, efficient algorithms and empirical studies[END_REF], text summarization [START_REF] Lin | Multi-document summarization via budgeted maximization of submodular functions[END_REF][START_REF] Lin | A class of submodular functions for document summarization[END_REF], and maximum entropy sampling [START_REF] Lee | of Encyclopedia of Environmetrics[END_REF].

Many of the aforementioned applications can be formulated as the maximization of a monotone submodular function under a knapsack constraint. In this problem, we are given a monotone submodular function f : 2 E → R + , a size function c : E → N, and an integer K ∈ N, where N denotes the set of positive integers. The problem is defined as maximize f (S) subject to c(S) ≤ K, (

where we denote c(S) = e∈S c(e) for a subset S ⊆ E. Throughout this paper, we assume that every item e ∈ E satisfies c(e) ≤ K as otherwise we can simply discard it. Note that, when c(e) = 1 for every item e ∈ E, the constraint coincides with a cardinality constraint.

The problem of maximizing a monotone submodular function under a knapsack constraint is classical and well-studied. First introduced by Wolsey [START_REF] Wolsey | Maximising real-valued submodular functions: primal and dual heuristics for location problems[END_REF], the problem is known to be NP-hard but can be approximated within the factor of (close to) 1 -1/e; see e.g., [START_REF] Badanidiyuru | Fast algorithms for maximizing submodular functions[END_REF][START_REF] Chekuri | Submodular function maximization via the multilinear relaxation and contention resolution schemes[END_REF][START_REF] Fisher | An analysis of approximations for maximizing submodular set functions ii[END_REF][START_REF] Kulik | Maximizing submodular set functions subject to multiple linear constraints[END_REF][START_REF] Sviridenko | A note on maximizing a submodular set function subject to a knapsack constraint[END_REF].

In some applications, the amount of input data is much larger than the main memory capacity of individual computers. In such a case, we need to process data in a streaming fashion. That is, we consider the situation where each item in the ground set E arrives sequentially, and we are allowed to keep only a small number of the items in memory at any point. This setting effectively rules out most of the techniques in the literature, as they typically require random access to the data. In this work, we also assume that the function oracle of f is available at any point of the process. Such an assumption is standard in the submodular function literature and in the context of streaming setting [START_REF] Badanidiyuru | Streaming submodular maximization: massive data summarization on the fly[END_REF][START_REF] Chekuri | Streaming algorithms for submodular function maximization[END_REF][START_REF] Yu | Streaming algorithms for news and scientific literature recommendation: Submodular maximization with a d-knapsack constraint[END_REF]. Badanidiyuru et al. [START_REF] Badanidiyuru | Streaming submodular maximization: massive data summarization on the fly[END_REF] discuss several interesting and useful functions where the oracle can be implemented using a small subset of the entire ground set E.

We note that the problem, under the streaming model, has so far not received its deserved attention in the community. Prior to the present work, we are aware of only two: for the special case of cardinality constraint, Badanidiyuru et al. [START_REF] Badanidiyuru | Streaming submodular maximization: massive data summarization on the fly[END_REF] gave a single-pass (1/2ε)-approximation algorithm; for the general case of a knapsack constraint, Yu et al. [START_REF] Yu | Streaming algorithms for news and scientific literature recommendation: Submodular maximization with a d-knapsack constraint[END_REF] gave a single-pass (1/3ε)approximation algorithm, both using O(K log(K)/ε) space.

We now state our contribution.

Theorem 5.1.1. For the problem (5.1),

1. there is a single-pass streaming algorithm with approximation ratio 4/11ε ≈ 0.363ε.

2. there is a multiple-pass streaming algorithm with approximation ratio 2/5ε = 0.4ε.

Both algorithms use O(K • poly(ε -1 )polylog(K)) space.

Our Technique

We begin by a straightforward generalization of the algorithm of [START_REF] Badanidiyuru | Streaming submodular maximization: massive data summarization on the fly[END_REF] for the special case of cardinality constraint (Section 5.2). This algorithm proceeds by adding a new item into the current set only if its marginal-ratio (its marginal return with respect to the current set divided by its size) exceeds a certain threshold. This algorithm performs well when all items in OPT are relatively small in size, where OPT is an optimal solution. However, in general, it only gives (1/3ε)approximation. Note that this technique can be regarded as a variation of the one in [START_REF] Yu | Streaming algorithms for news and scientific literature recommendation: Submodular maximization with a d-knapsack constraint[END_REF]. To obtain better approximation ratio, we need new ideas.

The difficulty in improving this algorithm lies in the following case: A new arriving item that is relatively large in size, passes the marginal-ratio threshold, and is part of OPT, but its addition would cause the current set to exceed the capacity K. In this case, we are forced to throw it away, but in doing so, we are unable to bound the ratio of the function value of the current set against that of OPT properly.

We propose a branching procedure to overcome this issue. Roughly speaking, when the function value of the current set is large enough (depending on the parameters), we create a secondary set. We add an item to the secondary set only if it passes the marginal-ratio threshold (with respect to the original set) but its addition to the original set would violate the size constraint. In the end, whichever set achieves the higher value is returned. In a way, the secondary set serves as a "back-up" with enough space in case the original set does not have it, and this allows us to bound the ratio properly. Sections 5.3 and 5.4 are devoted to explaining this branching algorithm, which gives (4/11ε)-approximation with a single pass.

We note that the main bottleneck of the above single-pass algorithm lies in the situation where there is a large item in OPT whose size exceeds K/2. In Section 5.5, we show that we can first focus on only the large items (more specifically, those items whose size differ from the largest item in OPT by (1 + ε) factor) and choose O(1) of them so that at least one of them, along with the rest of OPT (excluding the largest item in it), gives a good approximation to f (OPT). Then in the next pass, we can apply a modified version of the original single-pass algorithm to collect small items. This multiple-pass algorithm gives a (2/5ε)-approximation.

Related Work

Maximizing a monotone submodular function subject to various constraints is a subject that has been extensively studied in the literature. We are unable to give a complete survey here and only highlight the most representative and relevant results. Besides a knapsack constraint or a cardinality constraint mentioned above, the problem has also been studied under (multiple) matroid constraint(s), p-system constraint, multiple knapsack constraints. See [START_REF] Calinescu | Maximizing a monotone submodular function subject to a matroid constraint[END_REF][START_REF] Chan | Online submodular maximization with free disposal: Randomization beats for partition matroids online[END_REF][START_REF] Chekuri | Submodular function maximization via the multilinear relaxation and contention resolution schemes[END_REF][START_REF] Filmus | A tight combinatorial algorithm for submodular maximization subject to a matroid constraint[END_REF][START_REF] Kulik | Maximizing submodular set functions subject to multiple linear constraints[END_REF][START_REF] Lee | Submodular maximization over multiple matroids via generalized exchange properties[END_REF] and the references therein. In the streaming setting, other than the knapsack constraint that we have discussed before, there are also works considering a matroid constraint. Chakrabarti and Kale [START_REF] Chakrabarti | Submodular maximization meets streaming: matchings, matroids, and more[END_REF] gave 1/4-approximation; Chekuri et al. [START_REF] Chekuri | Streaming algorithms for submodular function maximization[END_REF] gave the same ratio.

Notation

For a subset S ⊆ E and an element e ∈ E, we use the shorthand S + e and Se to stand for S ∪ {e} and S \ {e}, respectively. For a function f : 2 E → R, we also use the shorthand f (e) to stand for f ({e}). The marginal return of adding e ∈ E with respect to S ⊆ E is defined as f (e | S) = f (S + e)f (S). We frequently use the following, which is immediate from the diminishing marginal return property:

1: procedure MarginalRatioThresholding(α, v) ▷ α ∈ (0, 1], v ∈ R + 2:
S := ∅.

3:

while item e is arriving do 4:

if f (e|S) c(e) ≥ αv-f (S) K-c(S) and c(S + e) ≤ K then S := S + e. 5.2 Single-Pass (1/3ε)-Approximation Algorithm

In this section, we present a simple (1/3-ε)-approximation algorithm that generalizes the algorithm for a cardinality constraint in [START_REF] Badanidiyuru | Streaming submodular maximization: massive data summarization on the fly[END_REF]. This algorithm will be incorporated into several other algorithms introduced later.

Thresholding Algorithm with Approximate Optimal Value

In this subsection, we present an algorithm MarginalRatioThresholding, which achieves (almost) 1/3-approximation given a (good) approximation v to f (OPT) for an optimal solution OPT. This assumption is removed in Section 5.2.2. Given a parameter α ∈ (0, 1] and v ∈ R + , MarginalRatioThresholding attempts to add a new item e ∈ E to the current set S ⊆ E if its addition does not violate the knapsack constraint and e passes the marginal-ratio threshold condition, i.e.,

f (e | S)
c(e) ≥ αvf (S) Kc(S) .

(5.

2)

The detailed description of MarginalRatioThresholding is given in Algorithm 1. Throughout this subsection, we fix S = MarginalRatioThresholding(α, v) as the output of the algorithm. Then, we have the following lemma. Lemma 5.2.1. The following hold:

(1) During the execution of the algorithm, the current set S ⊆ E always satisfies f (S) ≥ αvc(S)/K. Moreover, if an item e ∈ E passes the condition (5.2) with the current set S, then f (S + e) ≥ αvc(S + e)/K.

(2) If an item e ∈ E fails the condition (5.2), i.e., f (e|S) c(e) < αv-f (S) K-c(S) , then we have f (e | S) < αvc(e)/K.

Proof. We prove (1) by induction on the size of S. The base case S = ∅ is trivial. For induction step, suppose that e ∈ E is the new item to be added into the current set S ⊆ E. Then

f (S + e) = f (S) + f (e | S) ≥ f (S) + c(e) αv -f (S) K -c(S) ≥ αvc(e) K -c(S) + f (S) K -c(S) -c(e) K -c(S) ≥ αvc(S + e) K ,
where the last inequality follows from the induction hypothesis on the lower bound of f (S). Thus (1) holds. For (2), as the current set satisfies S ⊆ S, by the submodularity of f ,

f (e | S) ≤ f (e | S) < c(e)(αv -f (S)) K -c(S) ≤ αvc(e) K ,
where the last inequality follows from the first part of the lemma.

An item e ∈ OPT is not added to S if either e does not pass the condition (5.2), or its addition would cause the size of S to exceed the capacity K. We name the latter condition as follows: Definition 5.2.2. An item e ∈ OPT is called bad if e passes the condition (5.2) but the total size exceeds K when added, i.e., f (e | S) ≥ αv-f (S) K-c(S) , c(S + e) > K and c(S) ≤ K, where S is the set we have just before e arrives.

The following lemma says that, if there is no bad item, then we obtain a good approximation. Therefore, if we have v ∈ R + with v ≤ f (OPT) ≤ (1 + ε)v, the algorithm that runs MarginalRa-tioThresholding(2/3, v) and Singleton() in parallel and chooses the better output has the approximation ratio of 1 3(1+ε) ≥ 1 3ε. The space complexity of the algorithm is clearly O(K).

85

Algorithm 2

1: procedure Singleton()

2:

S := ∅.

3:

while item e is arriving do if f (e) > f (S) then S := {e}.

5:

return S.

Algorithm 3

1: procedure DynamicMRT(ε, α) ▷ ε, α ∈ (0, 1] 2: V := {(1 + ε) i | i ∈ Z + }. 3:
For each v ∈ V, set S v := ∅.

4:

while item e is arriving do 5:

m := max{m, f (e)}.

6:

I := {v ∈ V | m ≤ v ≤ Km/α}. 7:
Delete S v for each v ̸ ∈ I.

8:

for each v ∈ I do 9:

if f (e|Sv) c(e) ≥ αv-f (Sv) K-c(Sv) and c(S v + e) ≤ K then S v := S v + e.

10:

return S v for v ∈ I that maximizes f (S v ).

Dynamic Updates

MarginalRatioThresholding requires a good approximation v to f (OPT). This requirement can be removed with dynamic updates in a similar way to [START_REF] Badanidiyuru | Streaming submodular maximization: massive data summarization on the fly[END_REF]. We first observe that max e∈S f (e) ≤ f (OPT) ≤ K max e∈S f (e). So if we are given m = max e∈S f (e) in advance, a value v ∈ R + with v ≤ f (OPT) ≤ (1 + ε)v for ε ∈ (0, 1] exists in the guess set

I = {(1 + ε) i | m ≤ (1 + ε) i ≤ Km, i ∈ Z + }.
Then, we can run MarginalRatioThresholding for each v ∈ I in parallel and choose the best output. As the size of I is O(log(K)/ε), the total space complexity is O(K log(K)/ε).

To get rid of the assumption that we are given m in advance, we consider an algorithm, called DynamicMRT, which dynamically updates m to determine the range of guessed optimal values. More specifically, it keeps the (tentative) maximum value max f (e), where the maximum is taken over the items e arrived so far, and keeps the approximations v in the interval between m and Km/α. The details are provided in Algorithm 3. We have the following guarantee.

Theorem 5.2.5. For ε ∈ (0, 1], the algorithm that runs DynamicMRT(ε, 2/3) and Singleton() in parallel and outputs the better output is a (1/3-ε)-approximation streaming algorithm with a single pass for the problem (5.1). The space complexity of the algorithm is O(K log(K)/ε).

Proof. Let e ∈ E be an item arriving. We will show that, if v > Km/α (for α = 2/3), then e always fails the condition (5.2) in DynamicMRT. Indeed, if v > Km/α and e passes the condition (5.2) with the current set S, then Lemma 5.2.1 (1) implies that

f (S + e) ≥ αvc(S + e) K > c(S + e)m ≥ |S + e| max e ′ ∈S+e f (e ′ ),
where the last inequality follows from the fact that c(e) ≥ 1 and m ≥ max e ′ ∈S+e f (e ′ ). On the other hand, f (S + e) ≤ |S + e|max e ′ ∈S+e f (e ′ ) as f is submodular, which is a contradiction.

Therefore, when an item e ∈ E arrives, e may be added to the current set only if v ≤ Km/α. Moreover, since Singleton returns an item e with f (e) ≥ m, we can discard the case when v < m during the process of DynamicMRT. Thus DynamicMRT simulates all the values in V, only keeping the values in the interval [m, Km/α]. Since one of v ∈ V satisfies v ≤ f (OPT) ≤ (1 + ε)v, the output gives (1/3ε)-approximation from Theorem 5.2.4.

There are O(log K/ε) streams, and each stream may have a solution with size O(K). Thus, the total space is as desired.

Improved Single-Pass Algorithm for Small-Size Items

Let OPT = {o 1 , o 2 , . . . , o ℓ } be an optimal solution with c(o 1 ) ≥ c(o 2 ) ≥ . . . ≥ c(o ℓ ). The main goal of this section is achieving (2/5ε)-approximation, assuming that c(o 1 ) ≤ K/2. The case with c(o 1 ) > K/2 will be discussed in Section 5.4.

Branching Framework with Approximate Optimal Value

We here provide a framework of a branching algorithm BranchingMRT as Algorithm 4. This will be used with different parameters in Section 5.3.2.

Let v and c 1 be (good) approximations to f (OPT) and c(o 1 )/K, respectively, and let b ≤ 1/2 be a parameter. The value c 1 is supposed to satisfy c 1 ≤ c(o 1 )/K ≤ (1 + ε)c 1 . This means that we can ignore items e ∈ E with c(e) > min{(1 + ε)c 1 , 1/2}K.

The basic idea of BranchingMRT is to take only items with large marginal ratios, similarly to MarginalRatioThresholding. The difference is that, once f (S) exceeds a threshold λ, where λ = 1 2 α (1b) v, we store either the current set S or the latest added item as S ′ . This guarantees that f (S ′ ) ≥ λ and c(S ′ ) ≤ (1b)K, which means that S ′ has a large function value and sufficient room to add more elements. We call the process of constructing S ′ branching. We continue to add items with large marginal ratios to the current set S, and if we cannot add an item to S because it exceeds the capacity, we try to add the item to S ′ . Note that the set S ′ , after branching, can have at most one extra item; but this extra item can be replaced if a better candidate comes along (See line [START_REF] Brezovec | Two algorithms for weighted matroid intersection[END_REF][START_REF] Calinescu | Maximizing a monotone submodular function subject to a matroid constraint[END_REF].

Remark that the sequence of sets S in BranchingMRT is identical to that in MarginalRatio-Thresholding in Section [? ]. We say that an item e ∈ OPT is bad if it is bad in the sense of MarginalRatioThresholding, i.e., it satisfies the condition in Definition 5.2.2. We have the following two lemmas.

) ≥ λ, f (OPT) ≤ f (o b | S ′ 0 ) + f (S ′ 0 ∪ O s ) < (βv -λ) + f (S ′ 0 ∪ O s ). (5.3)
Since S ′ 0 ⊆ S, submodularity implies that

f (S ′ 0 ∪ O s ) ≤ f ( S ∪ O s ) ≤ f ( S) + e∈Os\ S f (e | S).
(5.4)

Since f ( S) < βv and no item in O s is bad, (5.3) and (5.4) imply by Lemma 5.2.1 (2) that

v ≤ f (OPT) < (βv -λ) + f (S ′ 0 ∪ O s ) < (βv -λ) + βv + αc(O s ) K v ≤ 2βv - 1 2 α(1 -b)v + α 1 - c(o b ) K v.
Therefore, we have

β > 1 2 1 + α 2c(o b )/K -b -1 2 . Since b ≤ (1 + ε)c(o b )/K, we obtain β > 1 2 1 -α (K -c(o b )) 2K - αc(o b ) 4K ε,
which is a contradiction. This completes the proof.

For the case when we have exactly two bad items, we obtain the following guarantee.

max{f ( S), f ( S′ )} ≥ 1 3 1 + α c(o m ) K v - αc(o b ) 3K εv = 1 3 1 + α c(o m ) K -O(ε) v.
Proof. Suppose not, that is, suppose that both of f ( S) and f ( S′ ) are smaller than βv, where

β = (1 + α c(om) K )/3 -αc(o b ) 3K ε. We denote O s = OPT \
f (OPT) ≤ f (o b | S ′ 0 ) + f (o m | S ′ 0 ) + f (S ′ 0 ∪ O s ) < (βv -λ) + (βv -λ) + f (S ′ 0 ∪ O s ), (5.5)
since f (S ′ 0 ) ≥ λ. Since S ′ 0 ⊆ S, we have

f (S ′ 0 ∪ O s ) ≤ f ( S ∪ O s ) ≤ f ( S) + e∈Os\ S f (e | S).
Since f ( S) < βv and no items in O s are bad, this implies by Lemma 5.2.1 (2) that

f (S ′ 0 ∪ O s ) ≤ βv + α c(O s ) K v.
Hence (5.5) can be transformed to

v ≤ f (OPT) < (βv -λ) + (βv -λ) + βv + α c(O s ) K v ≤ 3βv -2λ + α 1 - c(o b ) K - c(o m ) K v = 3βv -α(1 -b)v + α 1 - c(o b ) K - c(o m ) K v.
Therefore, since b ≤ (1 + ε)c(o b )/K, we have

β > 1 3 1 + α c(o m ) K - αc(o b ) 3K ε,
which is a contradiction.

Algorithms with Guessing Large Items

We now use BranchingMRT to obtain a better approximation ratio. In the new algorithm, we guess the sizes of a few large items in an optimal solution OPT, and then use them to determine the parameter α.

We first remark that, when |OPT|≤ 2, we can easily obtain a 1/2-approximate solution with a single pass. In fact, since f (OPT) ≤ ℓ i=1 f (o i ) where ℓ = |OPT|, at least one of o i 's satisfies f (o i ) ≥ f (OPT)/ℓ, and hence Singleton returns a 1/2-approximate solution when ℓ ≤ 2. Thus, in what follows, we may assume that |OPT|≥ 3.

We start with the case that we have guessed the largest two sizes c(o 1 ) and c(o 2 ) in OPT.

Lemma 5.3.5. Let ε ∈ (0, 1], and suppose that v ≤ f (OPT) and

c i ≤ c(o i )/K ≤ (1 + ε)c i for i ∈ {1, 2}. Then, S′ = BranchingMRT(ε, α, v, c 1 , b) with α = 1/(2 -c 2 ) or 2/(5 -4c 2 -c 1 ) and b = min{(1 + ε)c 1 , 1/2} satisfies f ( S′ ) ≥ min 1 -c 2 2 -c 2 , 2(1 -c 2 ) 5 -4c 2 -c 1 -O(ε) v. ( 5
f ( S′ ) ≥ 1 2 1 -α 1 -c 2 2 -O(ε) v.
Moreover, if we have two bad items o 1 and o 2 , then Lemma 5.3.4 implies

f ( S′ ) ≥ 1 3 (1 + αc 2 ) -O(ε) v.
Therefore, the approximation ratio is the minimum of the RHSes in the above five inequalities, which is maximized to

min 1 -c 3 2 -c 3 , c 2 + 1 c 2 + 3 -O(ε), when α = 1/(2 -c 3 ) or α = 2/(c 2 + 3).
We now see that we get an approximation ratio of 2/5 -O(ε) by combining the above two lemmas.

Theorem 5.3.7. Let ε ∈ (0, 1] and suppose that v ≤ f (OPT) ≤ (1 + ε)v and c i ≤ c(o i )/K ≤ (1 + ε)c i for i ∈ {1, 2, 3}. If c(o 1 ) ≤ K/2,
then we can obtain a (2/5 -O(ε))-approximate solution with a single pass.

Proof. We run the two algorithms with the optimal α shown in Lemmas 5.3.5 and 5.3.6 in parallel. Let S be the output with the better function value. Then, we have f ( S) ≥ βv, where

β = max min 1 -c 2 2 -c 2 , 2(1 -c 2 ) 5 -4c 2 -c 1 , min 1 -c 3 2 -c 3 , c 2 + 1 c 2 + 3 -O(ε).
We can confirm that the first term is at least 2/5, and thus S is a (2/5 -O(ε))-approximate solution.

To eliminate the assumption that we are given v, we can design a dynamic-update version of BranchingMRT by keeping the interval that contains the optimal value, similarly to Theorem 5.2.5. The algorithm, called DynamicBranchingMRT, is given in Algorithm 5. The proof for updating the interval I dynamically is the same as the proof of Theorem 5.2.5. The number of streams for guessing v is O(log(K)/ε). We also guess c i for i ∈ {1, 2, 3} from

{(1 + ε) j | j ∈ Z + }. As 1 ≤ c(o i ) ≤ K/2 for i ∈ {1, 2,
3}, the number of guessing for c i is O(log(K)/ε). Hence, including v, there are O((log(K)/ε) 4 ) streams in parallel. To summarize, we obtain the following: Theorem 5.3.8. Suppose that c(o 1 ) ≤ K/2. The algorithm that runs DynamicBranchingMRT and Singleton in parallel and takes the better output is a (2/5ε)-approximation streaming algorithm with a single pass for the problem (5.1). The space complexity of the algorithm is O(K(log(K)/ε) 4 ).

1: procedure DynamicBranchingMRT(ε)

2: V := {(1 + ε) i | i ∈ Z + }.

3:

For each c 1 , c 2 , c 3 ∈ V with c 3 ≤ c 2 ≤ c 1 ≤ 1/2 and each b ∈ {(1 + ε)c 1 , (1 + ε)c 2 , 1/2}, do the following with α defined based on Lemmas 5.3.5 and 5.3.6.

4:

For each v ∈ V, set S v := ∅.

5:

while item e is arriving do 6: ratio which will be determined later. We may assume that f (o 1 ) < βf (OPT), as otherwise Singleton (Algorithm 2) gives β-approximation. Then, we see f (OPTo 1 ) > (1β)f (OPT) and c(OPTo 1 ) < K/2. Consider maximizing f (S) subject to c(S) ≤ K/2 in the set {e ∈ E | c(e) ≤ K/2}. The optimal value is at least f (OPTo 1 ) > (1β)f (OPT). We now apply Theorem 5.4.1 with p = 2 to this problem. Then, the output S has size at most K, and moreover, we have f ( S) ≥ 4 7 -O(ε) (1β)f (OPT). Thus, we obtain min{β, ( 4 7 -O(ε))(1β)}-approximation. This approximation ratio is maximized to 4/11 when β = 4/11.

Bicriteria Approximation for a Knapsack Constraint

We here present the proof of Theorem 5.4.1. Let p ≥ 2.

The basic framework is the same as in Section 5.3; we design both a simple-thresholding algorithm and a branching algorithm, where the parameters are different and the analysis is simpler. It is sufficient to design algorithms assuming that a (good) approximation v to f (OPT) is given, as we can get rid of the assumption by using the dynamic update technique.

We design a variant of MarginalRatioThresholding. The new algorithm is parameterized by a number p ≥ 2. In the algorithm we allow to pack items to the total size at most pK. Also, we change the marginal-ratio threshold condition to the following:

f (s | S) c(e) ≥ αpv -f (S) pK -c(S) . (5.7)
Let MarginalRatioThresholding ′ p be the resulting algorithm. Similarly to Lemma 5.2.1, the following lemma holds. The proof is omitted as it is almost identical to that of Lemma 5.2.1. Lemma 5.4.3. Let S = MarginalRatioThresholding ′ p (α, v) for some α ∈ (0, 1] and v ∈ R + . Then, the following hold:

(1) During the execution of the algorithm, we have f (S) ≥ αvc(S)/K.

(2) If an item e fails the marginal-ratio threshold condition, i.e., f (e|S) c(e) < αpv-f (S) pK-c(S) , then f (e | S) < αvc(e)/K.

Determining α using a good approximation to the largest size c(o 1 ) in OPT gives the following approximation guarantee:

Lemma 5.4.4. For ε ∈ (0, 1], suppose that v ≤ f (OPT) and c 1 ≤ c(o 1 )/K ≤ (1 + ε)c 1 . Then, S = MarginalRatioThresholding ′ p (α, v), where α = 1/(p + 1 -c 1 ), satisfies f ( S) ≥ p -c 1 p + 1 -c 1 -O(ε) v.
Proof. If the output S has size at least (p -(1 + ε)c 1 )K, then we have by Lemma 5.4.3 (1)

f ( S) ≥ α(p -(1 + ε)c 1 )v = α(p -c 1 )v -O(ε)v. see that f ( S) ≥ 1 2 1 + α c 1 + p -2 2 -O(ε) v.
The approximation ratio is the minimum of the RHSes of the above three inequalities. It is maximized to

min p -c 2 p + 1 -c 2 , c 1 + p c 1 + p + 2 -O(ε). when α = 1 p-c2+1 or α = 2 c1+p+2 . This is in fact equal to c1+p c1+p+2 -O(ε) with α = 2 c1+p+2 , since p ≥ 2.
Therefore, if we apply both of the above algorithms and take the better one, we obtain a set S ⊆ E satisfying

f ( S) ≥ max p -c 1 p + 1 -c 1 , c 1 + p c 1 + p + 2 -O(ε) v.
This is minimized when c 1 = p/3, and hence we have

f ( S) ≥ 2p 2p + 3 -O(ε) v.
Thus the set S can be found in O(K(log(K)/ε) 2 ) space. This, together with the dynamic update technique to guess v, proves Theorem 5.4.1.

Multiple-Pass Streaming Algorithm

In this section, we provide a multiple-pass streaming algorithm with approximation ratio 2/5ε. In Section 5.5.1, we consider the monotone submodular function maximization with a different constraint and develop an algorithm for it. In Section 5.5.2, this algorithm is used as a subroutine for the original problem with a knapsack constraint.

Dealing with Large Items with Single Pass

We first consider a generalization of the original problem. Let E r ⊆ E be a subset of the ground set E. For ease of presentation, we will call E r the red items. Consider the problem defined below:

maximize f (S) subject to c(S) ≤ K, |S ∩ E R |≤ 1. (5.8)
In the following, we show that, given ε ∈ (0, 1], an approximation v to f (OPT) with v ≤ f (OPT) ≤ (1 + ε)v, and an approximation θ to f (o r ) for the unique item o r in OPT ∩ E r , we can choose O(1) of the red items so that one of them e ∈ E r satisfies that f (OPTo r + e) ≥ (Γ(θ) -O(ε))v, where Γ is a piecewise linear function lower-bounded by 2/3. For technical reasons, we will choose θ to be one of the geometric series (1 + ε) i /2 for i ∈ Z. Theorem 5.5.1. Suppose that we are given ε ∈ (0, 1], v ∈ R + with v ≤ f (OPT) ≤ (1 + ε)v, and θ ∈ R + with the following property:

1: procedure SelectRedItems(ε, v, θ, t, x) ▷ ε ∈ (0, 1], v ∈ R + , θ ≤ 1/2, t ∈ Z + , and x ∈ R + 2:
S := ∅.

3:

while item e is arriving do S := {e}. if |S|= t + 1 then return S.

10:

return S.

1. if θ ≤ 1/2, θv/(1 + ε) ≤ f (o r ) ≤ θv, 2. if θ ≥ 1/2, θv ≤ f (o r ) ≤ (1 + ε)θv ≤ v.
Then, there is a single-pass streaming algorithm that chooses a set S of red items in E r with constant size such that (i) for any item e ∈ S, θv/(1

+ ε) ≤ f (o r ) ≤ θv when θ ≤ 1/2 and θv ≤ f (o r ) ≤ (1+ε)θv ≤ v when θ ≥ 1/2, and (ii) some item e ∈ S satisfies that f (OPT-o r +e) ≥ (Γ(θ)-O(ε))v,
where Γ(θ) is defined as follows: when θ ∈ (0, 1/2), In what follows, we prove Theorem 5.5.1 considering the cases θ ≤ 1/2 and θ ≥ 1/2 separately.

Γ(θ) = max t(t + 3) (t + 1)(t + 2) - t -1 t + 1 θ | t ∈ Z + , t > 1 θ -2 , (5.9
Case 1: θ ≤ 1/2

In this case, θ is supposed to satisfy θv/(1 + ε) ≤ f (o r ) ≤ θv. Then, we can just ignore all red items e ∈ E r with f (e) < θv/(1 + ε) or f (e) > θv. Hence in the following, we assume that all the arriving red items e satisfy f (e) ≥ θv/(1 + ε).

Our algorithm picks the first red item e 1 and then collects up to t + 1 red items, where t is a constant determined later. Observe that, as

v ≤ f (OPT) ≤ f (o r )+f (OPT-o r ) ≤ θv+f (OPT-o r ), we have f (OPT -o r ) ≥ (1 -θ)v.
The algorithm guarantees that one of the chosen red items, along with f (OPTo r ), gives the value of (1θ + x)v, where x is the term we will try to maximize. Our algorithm, SelectRedItems, is given in Algorithm 6.

The following lemma follows immediately from the algorithm. Proof. Since the first item e we pick satisfies f (e) ≥ θ 1+ε v, the condition at line 8 implies that

f (S) ≥ θ 1 + ε v + |S|-1 j=1 (θ -xj)v.
Thus the lemma follows.

The next lemma states that if o r is thrown away at line 8 of the algorithm, then one of the red items in S is already good for our purpose.

Lemma 5.5.3. Suppose that |S|< t + 1 holds for the current set S ⊆ E r and the arriving item is o r and is thrown away at line 8 of the algorithm. Then at least one red item e ∈ S satisfies

f (OPT -o r + e) ≥ (1 -θ + x)v. Proof. First suppose that f (S ∪ (OPT -o r )) ≥ (1 -θ + |S|x)v. Then (1 -θ + |S|x)v ≤ f (S ∪ (OPT -o r )) ≤ f (OPT -o r ) + e∈S f (e | OPT -o r ),
implying that at least one red item e ∈ S ensures that

f (e | OPT -o r ) ≥ (1 -θ + |S|x)v -f (OPT -o r ) |S| .
So we obtain

f (OPT -o r + e) = f (e | OPT -o r ) + f (OPT -o r ) ≥ x + 1 -θ |S| v + |S|-1 |S| f (OPT -o r ) ≥ (1 -θ + x)v, as f (OPT -o r ) ≥ (1 -θ)v. Next assume that f (S ∪ (OPT -o r )) < (1 -θ + |S|x)v.
But if this is the case, o r would not have been thrown away by the algorithm in line 8, since

f (o r | S) ≥ f (o r | S ∪ (OPT -o r )) = f (OPT ∪ S) -f (S ∪ (OPT -o r )) ≥ v -(1 -θ + |S|x)v = (θ -|S|x)v.
Thus the proof is complete.

The next lemma states that, if |S|= t + 1, we can just ignore the rest, no matter o r has arrived or not. Lemma 5.5.4. Suppose that |S|= t + 1. Then at least one red item e ∈ S guarantees that

f (OPT -o r + e) ≥ θ(1 -ε) + t t + 1 - tx 2 v.
(5.10)

Proof. As f (OPT -o r ) + e∈S f (e | OPT -o r ) ≥ f (S)
, there exists an item e ∈ S so that

f (e | OPT -o r ) ≥ f (S)-f (OPT-or) |S| , implying that f (OPT -o r + e) = f (e | OPT -o r ) + f (OPT -o r ) ≥ f (S) t + 1 + t t + 1 f (OPT -o r ) ≥   θ 1 1+ε + t -xt(t+1) 2 t + 1 + t t + 1 (1 -θ)   v (By Lemma 5.5.2) ≥ t + θ(1 -ε) t + 1 - tx 2 v (Rearranging and using 1/(1 + ε) ≥ 1 -ε)
It follows from the two previous lemmas that the output is lower bounded by

min 1 -θ + x, θ + t t + 1 - tx 2 v - θ t + 1 εv. (5.11) If t > 1/θ -2, then we can ignore the second term because it is O(ε)v.
In what follows, we consider maximizing the first term of (5.11) subject to t ∈ Z + with t > 1/θ -2 and x ∈ [0, θ], for a given parameter θ. Suppose that t is a fixed number. Then, since both the terms in (5.11) are linear functions with respect to x, the maximum of (5.11) is attained when they are equal. That is, it is when

x * t = 2 θt + 2θ -1 (t + 1)(t + 2) = 2 1 t + 2 - 1 -θ t + 1 .
(5.12)

We see x * t ∈ [0, θ] when t > 1/θ -2. Therefore, by substituting for (5.12), the first term of (5.11) is changed to

1 -θ + x * t = t(t + 3) (t + 1)(t + 2) - t -1 t + 1 θ.
Thus, if we run SelectRedItems(ε, v, θ, t, x * t ) with different t, then the best output S satisfies

f ( S) ≥ (Γ(θ) -O(ε))v, where Γ(θ) = max t(t + 3) (t + 1)(t + 2) - t -1 t + 1 θ | t ∈ Z + , t > 1 θ -2 . (5.13)
This is a piecewise convex non-increasing function of θ. See Figure 5.1 for the ratio calculated by only considering t ≤ 10.

Case 2: θ ≥ 1/2

We now present another algorithm for the case of θ ≥ 1/2 and define the function Γ for the interval of [1/2, 1]. In this case, θ is supposed to satisfy θv ≤ f (o r ) ≤ θv(1 + ε) ≤ v. Thus, in the following, we assume that θv ≤ f (e) ≤ (1 + ε)θv for all red items e ∈ E r . If θ ≥ 2/3, just pick any red item e with f (e) ≥ θv gives trivially f (OPTo r + e) ≥ θv. Thus, we can define Γ(θ) = θ when θ ∈ [2/3, 1]. The remaining case is when θ ∈ [1/2, 2/3). We Algorithm 7

1: procedure SelectRedItems'(ε, v, θ) ▷ ε ∈ (0, 1], v ∈ R + and θ ≥ 1/2 2: S := {e 1 }
, where e 1 is the first arriving item in E r .

3:

while item e ∈ E r is arriving do return S.

present an algorithm, SelectRedItems', for this case to guarantee that one of the chosen items e has f (OPTo r + e) ≥ (2/3ε)v. Namely, we will just let Γ(θ) = 2/3 for the interval θ ∈ [1/2, 2/3).

The detail of the algorithm is provided in Algorithm 7.

To avoid triviality, we assume that e 1 ̸ = o r . The next lemma states that if there are two items in the returned set S, at least one serves the purpose. Lemma 5.5.5. Suppose that S = {e 1 , e 2 }. Then it cannot happen that f (OPTo r + e i ) < 2/3v for both i ∈ {1, 2}.

Proof. As f (OPT -o r ) + f (o r ) ≥ f (OPT) ≥ v and f (o r ) ≤ (1 + ε)θv, we have f (OPT -o r ) ≥ (1 -θ(1 + ε))v. Now suppose that f (OPT -o r + e i ) < 2v/3 for both i ∈ {1, 2}. Then we have f (e 1 | OPT -o r ) = f (e 1 + OPT -o r ) + f (OPT -o r ) ≤ 2 3 -(1 -(1 + ε)θ) v, and
f (e 1 | OPT -o r + e 2 ) ≥ f ({e 1 , e 2 }) -f (OPT -o r + e 2 ) ≥ f ({e 1 , e 2 }) - 2 3 v. As f (e 1 | OPT -o r ) ≥ f (e 1 | OPT -o r + e 2
) by submodularity, the above two inequalities imply that f ({e 1 , e 2 }) ≤ (1/3 + (1 + ε)θ)v, contradicting Line 4 of the algorithm.

The next lemma states that if o r is thrown away by the algorithm, e 1 itself is already good for approximation.

Consider the problem of maximizing f (S) subject to c(S) ≤ (1

-c1 1+ε )K. Since c(OPT -o 1 ) ≤ K -c(o 1 ) ≤ (1 -c1
1+ε )K, the set OPTo 1 is a feasible solution of the problem. Now apply the bicriteria approximation in Theorem 5.4.1 with p = (1 -c1 1+ε ) -1 ≥ 3. Then, since p ≥ 3 and f (OPTo 1 ) > 3 5 f (OPT), the output S satisfies that

f ( S) ≥ 2p 2p + 3 -O(ε) f (OPT -o 1 ) ≥ 2 5 -O(ε) f (OPT).
Thus the lemma holds.

We use the first pass to estimate f (OPT) as follows. For an error parameter ε ∈ (0, 1], perform the single-pass algorithm in Theorem 5.2.5 to get a (1/3ε)-approximate solution S ⊆ E, which can be used to upper bound the value of f (OPT), that is, f (S) ≤ f (OPT) ≤ (3 + ε)f (S). We then find the geometric series to guess its exact value. Thus, we may assume that we are given the value v satisfying v ≤ f (OPT) ≤ (1 + ε)v with O(ε -1 ) space.

Below we show how to obtain a solution of value at least (2/5 -O(ε))v, using two more passes. Before we start, we introduce a slightly modified versions of the algorithms presented in Section 5.2; it will be used as a subroutine. Then, the best returned set S of the two algorithms with α = 2h h+2 satisfies that c( S) ≤ hK ′ and f ( S) ≥ h h+2 v.

Proof. Let v ′ be an approximation to the optimal value f (OPT ′ ) of the problem (5.1) with the knapsack capacity K ′ . It is straightforward to to check that Lemma 5.2.1 holds with slight variations: (1) f (S) ≥ αv ′ c(S) hK where S is the current set, and (2) if an item e fails the marginal-ratio threshold, then f (e | S)

< αv ′ c(e) hK . If there is no bad item, then v ′ ≤ f (OPT ′ ) ≤ f ( S) + e∈OPT ′ \ S f (e | S) ≤ f ( S) + αv ′ h , implying that f ( S) ≥ (1 -α h )v ′ .
If there is a bad item, then the set S just before some bad item e arrives satisfies that f (S +e) ≥ αv ′ . Hence f ( S) or some singleton has the value at least αv ′ /2. Therefore, when α = 2h h+2 , the lower bound is maximized and the ratio in this case is h h+2 .

Let all items e ∈ E whose sizes c(e) satisfy c 1 /(1 + ε) ≤ c(e)/K ≤ c 1 be the red items. By Theorem 5.5.1, we can select a set S of the red items so that one of them guarantees f (OPTo 1 + e) ≥ (Γ(θ) -O(ε))v, where θ satisfies the condition in Theorem 5.5.1. Note that θ can be guessed by a geometric series from the interval [ 3 10 v, 2 5 (1 + ε)v] by Lemma 5.5.7. The space required is O(ε -1 ).

1: procedure MultiPassKnapsack(ε, v, θ, c 1 ) ▷ ε ∈ (0, 1], v ∈ R + , and θ, c 1 ∈ [0, 1].

2:

Use the algorithm in Theorem 5.5.1 to choose a set S of items e with c 1 /(1 + ε) ≤ c(e)/K ≤ c 1 so that one of them e ∈ S satisfies f (OPTo 1 + e) ≥ (Γ(θ) -O(ε))v.

3:

for each item e ∈ S do Apply the marginal-ratio thresholding algorithm (Lemma 5.5.9) with regard to function g e , where

h = 1 -c 1 1 -(c 1 /(1 + ε))
and

K ′ = 1 - c 1 1 + ε K. 6:
Let the resultant set be S e .

7:

return the solution S e ∪ {e} with max e∈S f (S e + e).

In the next pass, for each e ∈ S, define a new monotone submodular function g e (•) = f (• | e) and apply the modified thresholding algorithm (Lemma 5.5.9) with h =

1-c1 1-(c1/(1+ε)) and K ′ = (1 -(c 1 /(1 + ε))K.
Let S e be the output of the modified thresholding algorithm. Then our algorithm returns the solution S e ∪ {e} with max e∈S f (S e + e). The detail is given in Algorithm 8.

The returned solution has size at most K, since c(S e ) ≤ (1c 1 )K by Lemma 5.5.9. Moreover, it follows that the returned solution S satisfies that f Consider the problem of maximizing g e (S) subject to c(S) ≤ h -1 (1c 1 )K with available space (1c 1 )K. Since c(OPTo 1 ) ≤ Kc(o 1 ) ≤ h -1 (1c 1 )K, the set OPTo 1 is a feasible solution of this problem. Therefore, it follows from Lemma 5.5.9 that the obtained solution S e satisfies that

( S) ≥ (2/5 -O(ε))v. Theorem 5.5.10. For ε ∈ (0, 1], suppose that v ≤ f (OPT) ≤ (1 + ε)v, 1/2 ≤ c 1 /(1 + ε) ≤ c(o 1 )/K ≤ c 1 ,
g e (S e ) ≥ h h + 2 -O(ε) g e (OPT -o 1 ) ≥ 1 - 2 h + 2 -O(ε) g e (OPT -o 1 ). Now we have h = 1 - εc 1 1 + ε -c 1 ≥ 1 - c 1 1 -c 1 ε = 1 -O(ε), since c1
1-c1 is a constant by Lemma 5.5.8. Therefore, we have

g e (S e ) ≥ 1 3 -O(ε) g e (OPT -o 1 ) = 1 3 -O(ε) (f (OPT -o 1 + e) -f (e)).
It follows that the output S e + e satisfies that f (S e + e) = f (e) + g e (S e ) ≥ f (e

) + 1 3 (1 -O(ε)) ((Γ(θ) -O(ε))v -f (e))
graph G may not be bipartite. The polytope of popular fractional matchings is still half-integral here and thus we can compute a max-utility popular half-integral matching in G in polynomial time. To complement this result, we also show that the problem of computing a max-utility popular (integral) matching in a roommates instance G is NP-hard.

Introduction

Let G = (A ∪ B, E) be a bipartite graph on n vertices and m edges where A is called the set of applicants, B is called the set of jobs, and every vertex u ∈ A ∪ B has a preference list ranking its neighbors in a strict order of preference. Such a graph G is also referred to as an instance of the stable marriage problem with strict and possibly incomplete preference lists. Moreover, a utility function w : E → Q is given, where w(a, b) is the utility of matching applicant a with job b. Our goal is to match applicants to jobs such that this matching is popular and has the maximum utility, where the utility w(M ) of a matching M is the sum of utilities of all edges in M . The notion of popularity was introduced by Gärdenfors [START_REF] Gärdenfors | Match making: assignments based on bilateral preferences[END_REF] in 1975. A vertex u ∈ A∪B prefers matching M to matching M ′ if u is matched in M and unmatched in M ′ or it is matched in both and M (u) ranks higher than M ′ (u) in u's preference list. For any two matchings M and M ′ in G, let ϕ(M, M ′ ) be the number of vertices that prefer M to M ′ . We say M is more popular than

M ′ if ϕ(M, M ′ ) > ϕ(M ′ , M ). Definition 6.1.1. A matching M is popular if ϕ(M, M ′ ) ≥ ϕ(M ′ , M ) for every matching M ′ in G, i.e., ∆(M, M ′ ) ≥ 0 where ∆(M, M ′ ) = ϕ(M, M ′ ) -ϕ(M ′ , M ).
Thus a popular matching never loses an election (where vertices cast votes) and so a popular matching can be considered to be "globally stable" since an election cannot force a migration from a popular matching to any other matching. The notion of popularity is naturally appealing and is less demanding than the notion of stability. A matching is stable if it has no blocking edges: an edge (a, b) blocks matching M if both a and b prefer each other to their respective assignments in M . The existence of stable matchings and the Gale-Shapley algorithm [START_REF] Gale | College admissions and the stability of marriage[END_REF] to find one are classical results in algorithms. It is easy to show that every stable matching is popular [START_REF] Gärdenfors | Match making: assignments based on bilateral preferences[END_REF].

There are many polynomial time algorithms to compute a max-utility stable matching in G [START_REF] Feder | A new fixed point approach for stable networks and stable marriages[END_REF][START_REF] Feder | Network flow and 2-satisfiability[END_REF][START_REF] Fleiner | A fixed-point approach to stable matchings and some applications[END_REF][START_REF] Irving | An efficient algorithm for the "optimal" stable marriage[END_REF][START_REF] Rothblum | Characterization of stable matchings as extreme points of a polytope[END_REF][START_REF] Teo | The geometry of fractional stable matchings and its applications[END_REF][START_REF] Vate | Linear programming brings marital bliss[END_REF] -several of these use linear programming on the stable matching polytope S G , which is the convex hull of the 0-1 edge incidence vectors of stable matchings in G. The utility of a max-utility popular matching could be much more than that of a max-utility stable matching; for instance, when all utilities are 1, a max-utility popular matching is the same as a max-size popular matching and it is known that a stable matching is a min-size popular matching [START_REF] Huang | Popular matchings in the stable marriage problem[END_REF].

Mixed matchings. Our objective is to find a max-utility matching under the constraints of popularity -so as to achieve highest utility, what we seek should be a popular mixed matching rather than a popular (pure) matching. A mixed matching is a probability distribution over matchings, i.e., a mixed matching Π = {(M 0 , p 0 ), . . . , (M k , p k )}, where M 0 , . . . , M k are matchings in G and k i=0 p i = 1, p i ≥ 0 for all i, and the utility of Π is

k i=0 p i • w(M i ).
However a potential drawback of generalizing from matchings to mixed matchings is that the optimal solution has become more complex to describe and more difficult to implement. A mixed matching can be interpreted as either a lottery over matchings or a time-sharing arrangement (when the mixed matching is viewed as a fractional matching) [START_REF] Roth | Stable matchings, optimal assignments, and linear programming[END_REF]: in the former case, we need access to several random bits to implement a lottery and the latter case involves sub-dividing jobs and assigning several fractional jobs to an applicant. Thus we may need to deal with an unstructured optimal solution. Our first result is the following. Theorem 6.1.3. Given an instance G = (A ∪ B, E) with strict preference lists and a utility function w : E → Q, G always has a max-utility popular mixed matching Π = {(M 0 , 1 2 ), (M 1 , 1 2 )} and Π can be computed in polynomial time. Moreover, if G admits a perfect stable matching, i.e. a stable matching where no vertex is unmatched, then Π = {(M, 1)}, namely, Π is pure.

Thus our result implies that to achieve max-utility, we just need a single random bit to implement the lottery or we can find a time-sharing arrangement that is simple and organized-every vertex has at most two partners and spends the same amount of time with each. Hence we can find a max-utility popular mixed matching that is highly structured. Note that it was already known how to compute a max-utility popular half-integral matching in G in polynomial time [START_REF] Kavitha | Popular half-integral matchings[END_REF]. However it was not known whether this was a max-utility popular fractional matching or not. Our main contribution is to show that this is so by proving that the polytope P G is half-integral. Moreover, P G is integral when G admits a perfect stable matching (say, |A|= |B| and preference lists are complete).

The complexity of finding a max-utility popular matching in G = (A ∪ B, E) is currently unknown. We show here that when G is a general graph, i.e., not necessarily bipartite (also called a roommates instance with strict preferences), the max-utility popular matching problem becomes NP-hard. In fact, the max-utility stable matching problem in a roommates instance is also NP-hard, as shown by Feder [START_REF] Feder | A new fixed point approach for stable networks and stable marriages[END_REF]. Theorem 6.1.4. Given G = (V, E) where each vertex has a strict preference list over its neighbors and a utility function w : E → Q, the decision question of computing a max-utility popular matching in G is NP-complete. Moreover, for any constant ϵ > 0, it is UGC-hard to design a polynomial time ϵ-approximation algorithm for this problem.

We show below that when integrality is relaxed to half-integrality, the above problem becomes tractable. Recall that a fractional matching needs not be a mixed matching in a non-bipartite graph but it is always a convex combination of half-integral matchings. Analogous to a popular mixed matching in a bipartite graph, a popular fractional matching in a general graph is a fractional matching that "beats" all other fractional matchings. Formally, if node v prefers node v ′ to node v ′′ or v ′ = v ′′ , we write v ′ ⪰ v v ′′ ; if only the former, we write v ′ ≻ v. We slighly abuse notation by writing v ′ ≻ v ∅ to denote that v prefers to be matched to any node v ′ than being unmatched.

Given a half-integral matching M ∈ {0, 1/2, 1} m , each node v in M is either fully-matched, halfmatched, or unmatched. In the first case, let M (v, 1), M (v, 2) be the two (not necessarily distinct) vertices that v is fractionally matched to and let M (v, 1) ⪰ v M (v, 2); in the second case, M (v, 1) is the node v is matched to and M (v, 2) = ∅; in the last case, M (v, 1) = M (v, 2) = 0. Given two half-integral matchings M and M

′ , ϕ(M, M ′ ) = 2 i=1 |{v|M (v, i) ≻ v M ′ (v, i)}|-{v|M ′ (v, i) ≻ v M (v, i)}|. Let p = k i=0 p i M i , where k i=0 p i = 1, be a fractional matching. Then ϕ(p, M ′ ) = k i=0 p i ϕ(M i , M ′ ).
The definition of ϕ(M ′ , p) is analogous. We can now define a popular fractional matching analogously to Definition 6.1.2. Definition 6.1.5. A fractional matching p = k i=0 p i M i , where

k i=0 p i = 1, is popular if ϕ(p, M ′ ) ≥ ϕ(M ′ , p) for all half-integral matchings M ′ in G, i.e., ∆(p, M ′ ) ≥ 0, where ∆(p, M ′ ) = ϕ(p, M ′ ) -ϕ(M ′ , p).
Let q = h j=0 q j N j , where h j=0 q j = 1, be another fractional matching. Furthermore, let ∆(p, q) = k i=1 h j=1 p i q j ∆(M i , N j ). It is clear that if p is popular, ∆(p, q) ≥ 0 for all fractional matchings q. We show that there is a max-utility popular fractional matching that is half-integral. Theorem 6.1.6. Given an instance G = (V, E) with strict preference lists and a utility function w : E → Q, G always has a max-utility popular fractional matching p ∈ {0,1 2 , 1} m , and p can be computed in polynomial time.

Our Techniques

The polytope P G of popular fractional matchings has a compact extended formulation P ′ G ⊆ R m+n and in this paper, we analyze the linear program that gives rise to P ′ G and discover an unusual property of this linear program. This LP is self-dual, i.e., it is exactly identical to its dual program. 1 To the best of our knowledge, this seems to be the first time a natural problem has an LP with this property and our proof on the structure of P G uses this self-duality crucially. Prior to our result, the only linear program that had a somewhat similar property is the one used by Roth, Rothblum and Vande Vate [START_REF] Roth | Stable matchings, optimal assignments, and linear programming[END_REF] to describe the stable matching polytope S G . Every stable fractional matching is an optimal solution to their original LP there but also gives rise to an optimal solution in its dual. In the original words of Roth et al. [START_REF] Roth | Stable matchings, optimal assignments, and linear programming[END_REF]: "We know of no similarly rich class of linear programs whose primal and dual solutions are related in this way."

By setting the n new variables (the ones added for the extended formulation) to 0, the description of P ′ G reduces to the description of S G . This formulation of S G is not independent of other descriptions of this polytope [START_REF] Roth | Stable matchings, optimal assignments, and linear programming[END_REF][START_REF] Teo | The geometry of fractional stable matchings and its applications[END_REF], however it has a novel and intuitive interpretation where stability is interpreted as follows: the "sum of votes" of any adjacent pair of vertices for each other is less than or equal to 0 (see Section 6.2 for details).

Our technique to prove the integrality of P G in the case when G = (A ∪ B, E) admits a perfect stable matching (one that matches all vertices) is inspired by the one used by Teo and Sethuraman [START_REF] Teo | The geometry of fractional stable matchings and its applications[END_REF] to show the integrality of S G . However as the description of the extended popular fractional matching polytope P ′ G is more general than that of S G , our task is more involved here. We use the fact that G admits a perfect stable matching to first conclude that for any integral matching M here, there is a witness (α u ) u∈A∪B ∈ {±1} n to the popularity of M , where the α u 's are the n new variables that were added for the extended formulation. In order to find popular matchings in G whose convex combination forms a popular fractional matching ⃗ x, we use the following new idea: for any vertex u, use the value of α u to divide into two sub-arrays the ordered array of partners that u gets assigned in ⃗ x and swap these two sub-arrays to get a reordered array.

We obtain the matchings M 1 , . . . , M k that form ⃗ x from these reordered arrays. The popularity of these matchings will be proved by assigning an appropriate witness ⃗ α i ∈ {±1} n to each M i and

showing that each M i along with its witness ⃗ α i belongs to P ′ G . The half-integrality of P G for the general case (when G has no perfect stable matching) and for non-bipartite graphs follows from the integrality of P G in this special case. For non-bipartite graphs, we show a simple reduction from the vertex cover problem to show that it is NP-hard to compute a max-utility popular matching.

Background and related work. As mentioned earlier, popular matchings were introduced by Gärdenfors [START_REF] Gärdenfors | Match making: assignments based on bilateral preferences[END_REF] for two-sided preferences, i.e., vertices on both sides of the graph have preferences over their neighbors. For one-sided preferences (i.e., vertices of only one side have preferences over their neighbors), similar notions have been suggested by Kreweras [START_REF] Kreweras | Aggregation of preference orderings. Mathematics and Social Science I: Proceedings of the seminar of Menthon-Saint-Bernad, France and of Gösing[END_REF] and Fishburn [START_REF] Fishburn | Probabilistic social choice based on simple voting comparisons[END_REF]. Popular matchings need not always exist in this setting and an efficient algorithm was given in [START_REF] Abraham | Popular matchings[END_REF] to determine if the given instance admits a popular matching or not. It was shown in [START_REF] Kavitha | Popular mixed matchings[END_REF] that popular mixed matchings always exist in the same setting and such a mixed matching can be efficiently computed. Popular mixed matchings as an allocation mechanism have been studied in [START_REF] Brandl | Consistent probabilistic social choice[END_REF][START_REF] Aziz | On the tradeoff between economic efficiency and strategyproofness in randomized social choice[END_REF][START_REF] Aziz | On popular random assignments[END_REF].

In the domain of two-sided preferences, when preferences involve ties, the problem of determining if G = (A ∪ B, E) admits a popular matching or not is NP-hard [START_REF] Cseh | Popular matchings with two-sided preferences and one-sided ties[END_REF][START_REF] Biró | Popular matchings in the marriage and roommates problems[END_REF]. When preference lists are strict, popular matchings always exist in G and efficient algorithms for computing a maxsize popular matching were given in [START_REF] Huang | Popular matchings in the stable marriage problem[END_REF][START_REF] Kavitha | A size-popularity tradeoff in the stable marriage problem[END_REF]. A subclass of max-size popular matchings called dominant matchings were studied in [START_REF] Cseh | Popular edges and dominant matchings[END_REF]. The convex hull of the {0, 1 2 , 1}-edge incidence vectors of popular half-integral matchings in G was described in [START_REF] Kavitha | Popular half-integral matchings[END_REF] -this was done via the stable matching polytope of a larger graph G * that was constructed using G.

Stable matchings have been extensively studied and there are several monographs [START_REF] Gusfield | The Stable Marriage Problem: Structure and Algorithms[END_REF][START_REF] Knuth | Mariages stables et leurs relations avec d'autre problèmes[END_REF][START_REF] Manlove | Algorithmics of Matching Under Preferences[END_REF][START_REF] Roth | Two-sided matching: a study in game-theoretic modeling and analysis[END_REF] on this subject. In practice, Roth [START_REF] Roth | New physicians: A natural experiment in market organization[END_REF][START_REF] Roth | A natural experiment in the organization of entry level labor markets: Regional markets for new physicians and surgeons in the u.k[END_REF] discusses how stable matchings are compared with other types of matchings in the two-sided matching markets. The first description of the polytope S G for G = (A ∪ B, E) was given by Vande Vate [START_REF] Vate | Linear programming brings marital bliss[END_REF] in 1989 and several descriptions of S G are now known [START_REF] Fleiner | A fixed-point approach to stable matchings and some applications[END_REF][START_REF] Eirinakis | Polyhedral aspects of stable marriage[END_REF][START_REF] Roth | Stable matchings, optimal assignments, and linear programming[END_REF][START_REF] Rothblum | Characterization of stable matchings as extreme points of a polytope[END_REF][START_REF] Teo | The geometry of fractional stable matchings and its applications[END_REF]. Stable matchings need not exist in the roommates problem and efficient algorithms to determine if G = (V, E) admits a stable matching or not was given in [START_REF] Irving | An efficient algorithm for the stable roommates problem[END_REF][START_REF] Teo | The geometry of fractional stable matchings and its applications[END_REF]. Stable half-integral matchings always exist in G and it was shown in [2] that the polytope of all stable fractional matchings is half-integral.

Organization of the paper. In Section 6.2 we describe the extended popular fractional matching polytope P ′ G and show the self-duality of the LP that gives rise to this description. Section 6.3 shows the integrality of the popular fractional matching polytope P G when G is bipartite and admits a perfect stable matching. Section 6.4 shows the half-integrality of P G in the general bipartite graph. The proofs of Theorems 6.1.4 and 6.1.6 are given Sections 6.5 and 6.6 respectively.

The extended popular fractional matching polytope P ′

G Let M G be the matching polytope of G = (A ∪ B, E): so M G = {x ∈ R m : e∈E(u) x e ≤ 1 ∀u ∈ A ∪ B and x e ≥ 0 ∀e ∈ E}, where E(u) is the set of all edges incident on u in G. The popular fractional matching polytope of G is

P G = {⃗ x ∈ M G : ∆(⃗ x, M ) ≥ 0 ∀ matchings M in G},
where ∆(⃗ x, M ) = ∆(Π, M ) where Π is a mixed matching corresponding to the fractional matching ⃗ x (recall that in a bipartite graph, a mixed matching is equivalent to a fractional matching).

Alternately, ∆(⃗ x, M ) = u∈A∪B vote u (⃗ x, M (u)), where the function vote u (•, •) is defined as follows.

For any vertex u ∈ A ∪ B and neighbors v, v ′ of u, we have vote u (v, v ′ ) = 1 if u prefers v to v ′ , it is -1 if u prefers v ′ to v, else it is 0 (i.e., v = v ′ ). The function vote u (v, v ′ ) extends by linearity to vote u (⃗ x, v ′ ) where ⃗ x is a fractional matching:

vote u (⃗ x, v ′ ) = v x (u,v) • vote u (v, v ′ ) = v: v ≻u v ′ x (u,v) - v: v≺u v ′ x (u,v) ,
where {v : v ≻ u v ′ } consists all neighbors of u that are ranked higher than v ′ in u's preference list and the set {v : v ≺ u v ′ } consists of those who are ranked lower. We also let vote u (v ′ , x) = -vote u (x, v ′ ).

The description of P G in (6.1) above involves possibly exponentially many constraints -one for each matching in G. Hence we will use the extended popular fractional matching polytope P ′ G of G in m + n dimensions (from [START_REF] Kavitha | Popular mixed matchings[END_REF]) that uses n new variables α u for u ∈ A ∪ B along with the m variables x e for e ∈ E. Note that the edge utilities given in the input instance G play no part in the description of either P G or P ′ G . It will be convenient to assume that each vertex u ∈ A ∪ B is completely matched in ⃗ x. So each vertex u gets matched to a distinct artificial vertex ℓ(u) (referred to as the last resort neighbor of u) placed at the bottom of u's preference list with x (u,ℓ(u)) = 1 -e∈E(u) x e . Let Ẽ denote the edge set E ∪ {(u, ℓ(u)) : u ∈ A ∪ B} and let Ẽ(u) be the set of edges in Ẽ that are incident on u. Then e∈ Ẽ(u) x e = 1 for all u ∈ A ∪ B. For convenience, we will continue to use ⃗ x to denote the revised ⃗ x in [0, 1] m+n .

The graph Gx . The graph Gx is the graph G augmented with last resort vertices and with edge set Ẽ where the weight of edge (a, b) is equal to vote a (b, ⃗ x) + vote b (a, ⃗ x) (note that in case a or b is l(u) for some u ∈ A ∪ B, vote a (b, ⃗ x) or vote b (a, ⃗ x) is understood to be 0). For any matching M in Gx that matches all vertices in A ∪ B, observe that the weight of M in Gx is exactly the same as ∆(M, ⃗ x).

The polytope P ′ G is based on the following observation: ⃗ x ∈ M G is popular if and only if the maximum weight of a matching in the graph Gx that matches all vertices in A ∪ B is 0; note that this value is always non-negative since the weight of the fractional matching ⃗ x in Gx is 0. Consider the dual program (in variables α u for u ∈ A ∪ B) to the primal program which is the maximum weight matching problem in the graph Gx that matches all vertices in A∪B. This is LP1 described below.

(LP1) minimize For any point ⃗ x ∈ P G , by LP-duality, the optimal dual value is 0 and so there is the optimal solution ⃗ α x = (α x u ) u∈A∪B to LP1 such that u∈A∪B α x u = 0. We will regard ⃗ α x as the witness to the popularity of ⃗ x. For example, consider the instance in Fig. e∈ Ẽ(u)

x e = 1 ∀u ∈ A ∪ B.

x e ≥ 0 ∀e ∈ Ẽ.

The polytope P ′ G is the set of optimal solutions to LP2. Hence u∈A∪B α u = 0 and thus the description of P ′ G consists of the following constraints: (we will refer to constraint (6.1) as the covering constraint in x e = 1, ∀u ∈ A ∪ B, x e ≥ 0, ∀e ∈ Ẽ. (6.4) Observe that the description of P ′ G involves just O(m + n) constraints, far fewer than the exponentially many constraints in the description of P G . We now show a very interesting and special property of LP2. Lemma 6.2.1. LP2 is its own dual program, i.e., LP2 is self-dual. Let us substitute γ u = -β u for each u ∈ A ∪ B. This makes LP3 exactly the same as LP2 -the variable γ u is in place of α u for each u ∈ A ∪ B and the variable y e is in place of x e for each e ∈ Ẽ .

Thus LP2 is self-dual and so an optimal solution to LP2 is also an optimal solution to LP3. This property will be crucial to us. We now show the relationship between P ′ G and the stable matching polytope S G .

The typical formulation of S G contains the constraints that e∈ Ẽ(u) x e = 1 for all u ∈ A ∪ B and x e ≥ 0 for all e ∈ Ẽ along with the stability constraint for each edge (a, b) ∈ Ẽ. The stability constraint for edge (a, b) in the description of S G from [START_REF] Roth | Stable matchings, optimal assignments, and linear programming[END_REF] is given by Inequality (6.5) below and the stability constraint for each edge (a, b) in the description of S G from [START_REF] Teo | The geometry of fractional stable matchings and its applications[END_REF] is given by Inequality (6.6) below. In fact, the above two stability constraints are not independent and one can be derived from the other.2 By subtracting the first from the second, we get the following constraint which is equivalent to either of these constraints: x (a ′ ,b) ≤ 0.

Thus constraint (6.7) for each edge (a, b) along with the constraints that e∈ Ẽ(u) x e = 1 for all u ∈ A ∪ B and x e ≥ 0 for all e ∈ Ẽ is a description of S G . Observe that the first term in constraint (6.7) is vote a (b, ⃗ x) and the second term there is vote b (a, ⃗ x). Thus the description of P ′ G is a natural generalization of the description of S G where we have α a + α b on the right side of constraint (6.7) along with the constraint that the sum of all α u 's has to be 0.

So S G is the set of those points ⃗ x in P G that admit ⃗ α = 0 as a witness to their popularity.

While S G is integral, we know that P G is not integral (as shown by the example in Fig. 6.1). However we will be able to show in Section 6.3 that P G is integral in an important special case.

Integrality of P G in a special case

We will prove the following theorem in this section.

Theorem 6.3.1. Let G = (A ∪ B, E) be an instance of the stable marriage problem with strict preference lists such that G admits a perfect stable matching. Then P G is integral.

Our assumption that G admits a perfect stable matching implies that every stable matching S in G is perfect [START_REF] Gabow | Efficient algorithms for graphic matroid intersection and parity (extended abstract)[END_REF], i.e., every u ∈ A ∪ B is matched in S. In fact, this implies that every popular matching in G has to be perfect -this is due to the fact that a stable matching is a minimum-size popular matching in G (see Corollary 1 in [START_REF] Huang | Popular matchings in the stable marriage problem[END_REF]). Also, this extends to all popular fractional matchings as well. That is, if ⃗ x ∈ P G , then ⃗ x has to fully match every vertex in A ∪ B to genuine neighbors, otherwise we have ∆(⃗ x, S) < 0 where S is any stable matching3 , contradicting the popularity of ⃗ x. The following lemma shows an important property satisfied by popular perfect matchings in G. Lemma 6.3.2. If M is a popular matching in G = (A ∪ B, E) such that M is perfect, then M has a witness ⃗ α M ∈ {±1} n to its popularity.

Proof. A perfect popular matching in G is a dominant matching in G, i.e., a popular matching M with the property that M is strictly more popular than every larger matching. It was shown in [START_REF] Cseh | Popular edges and dominant matchings[END_REF] that every dominant matching allows a partition A 0 ∪ A 1 of A and B 0 ∪ B 1 of B such that the following two properties are satisfied:

Thus there exists a witness ⃗ α x = (α x u ) u∈A∪B ∈ [-1, 1] n for the popularity of ⃗ x. We will use ⃗ α x as follows.

• for each a ∈ A: determine the value p a such that p a •1+(1-p a )•(-1) = α x a , i.e., 2p a -1 = α x a .

• The values p a and p b . The interpretation of p a is as follows: we would like to come up with popular matchings spanning x. We know from Lemma 6.3.2 that every popular matching M in G has a witness vector ⃗ α M ∈ {±1} n and so for any a ∈ A, we have α M a ∈ {±1}. Suppose p a fraction of the popular matchings that span ⃗ x assign a's α-value to 1 and so 1p a of them assign a's α-value to -1. Then p a • 1 + (1p a ) • (-1) = 2p a -1 = α x a . Let X a denote the array containing a's assignment in ⃗ x: each cell in the array X a corresponds to a neighbor b of a such that x (a,b) > 0. These neighbors of a are arranged in X a in increasing order of a's preferences and the cell containing b has length x (a,b) . Thus the total length of X a is 1. We use the value p a to partition X a into a positive sub-array and a negative sub-array as defined below. Definition 6.3.5. For any a ∈ A, the initial p a fraction of X a (i.e., the least preferred p a fraction of X a ) will be called the positive sub-array of X a and the remaining part (i.e., the most preferred 1p a fraction of X a ) will be called the negative sub-array of X a . In Fig. 6.2, the array on the left is X a and the positive sub-array of X a is colored blue and the negative sub-array of X a is colored red. We will assume that the positive sub-array of X a has a's α-value set to 1 and the negative sub-array of X a has a's α-value set to -1.

Our main idea here is the following: reorder X a as shown in Fig. 6.2. That is, we cut X a at the end of its positive sub-array and move its entire negative sub-array (in the same order) to the left of its positive sub-array. Note that neither the order within the positive sub-array nor within the negative sub-array is changed by this. The reordered array is shown on the right on Fig. 6.2, call this array X ′ a . In case the line cutting X a into these 2 sub-arrays went through a cell, that cell is now split into 2 cells (one negative and one positive). Thus each cell in X ′ a is either positive or negative. Recall that each negative cell corresponds to a's α-value being -1 and each positive cell corresponds to a's α-value being 1. Note that it follows from Lemma 6.3.3 that when x (a,b) > 0, Inequality (6.8) is tight. Thus we have shown the lemma.

We are now ready to show that M t is a valid matching in G. For any edge (a, b), if x (a,b) > 0, we need to show that the cell corresponding to b in X ′ a and the cell corresponding to a in X ′ b are perfectly aligned in the vertical direction. Theorem 6.3.8. M t is a matching in G.

Proof. Recall that in X ′ a , a's increasing order of preference of partners in ⃗ x begins from the start of its positive sub-array (the blue region) in a left to right orientation and it wraps around. Suppose Similarly in X ′ b , b's increasing order of preference of partners in ⃗ x begins from the end of its positive sub-array and this order is from right to left (as indicated by the arrow in Fig. . Thus in this case as well we have perfect alignment between the two cells in X ′ a that contain b and the two cells in X ′ b that contain a. So no matter which of these cells is intersected by the line L t , we have exact alignment between the cell containing a in X ′ b and the cell containing b in X ′ a .

The popularity of matching M t . We now need to show that M t is a popular matching in G.

We do this by showing a witness vector ⃗ α t such that ⃗ α = ⃗ α t and ⃗ x = I Mt satisfy the constraints of P ′ G , where I Mt is the 0-1 edge incidence vector of M t . We define ⃗ α t as follows. Recall that we defined the matching M t via the vertical line L t that intersected table T .

• For each u ∈ A ∪ B do: if the cell intersected by L t is in the negative sub-array of X ′ u , then set α t u = -1; else (the cell is in the positive sub-array of X ′ u ) set α t u = 1. Theorem 6.6.6. Suppose all utilities are non-negative. Then there is no polynomial time ϵapproximation algorithm, for any ϵ > 0, to compute a max-utility popular matching in a roommates instance, even when all preferences are strict and complete, unless the unique games conjecture fails.

Proof. In the above reduction, let us modify the edge utilities as follows: w(a i 0 , a i 2 ) = w(a i 1 , a i 3 ) = 1, ∀v i ∈ V ; all other edges e have w(e) = 0. Lemmas 6.6.1 and 6.6.4 can be rephrased as there is a vertex cover of size k if and only if there is a popular matching of utility 2n -2k.

According to [START_REF] Chlebík | Minimum 2sat-deletion: Inapproximability results and relations to minimum vertex cover[END_REF], vertex cover is hardest to approximate when the given instance G = (V, E) has a perfect matching. Thus we can assume that |OPT VC |≥ n/2. Suppose we have an ϵ-approximation algorithm for some ϵ > 0. Then the utility of the returned matching M is at least ϵ(1 -2ϵ)n. As w(M ) = 2n -2k ≥ ϵ(1 -2ϵ)n, we have k ≤ (1ϵ/2 + ϵ 2 )n. By assumption |OPT VC |≥ n/2, so we have a vertex cover whose size is at most (1-ϵ/2+ϵ 2 )n n/2 = 2ϵ + ϵ 2 = 2 -Θ(ϵ) times the size of OPT VC . In both cases, we have a 2 -Θ(ϵ) approximation for vertex cover. This would break the unique games conjecture.

  1. O(W nm) time, in the case of simple b-matching (where c ≡ 1); 2. O(W √ βm) time, where β = v∈A∪B b(e); 3. O(W (n 1 m + n 3 1 )), where n 1 = min{|A|, |B|}; 4. O(W (n 1 m + n 2 1 √ m)); 5. O(W (n 1 m + n 2 1 √ log C)), where C = max e∈E c(e); 6. O(W n 1 m log(2 +

  Weight Bipartite Capacitated b-matching. Let G = (A ∪ B, E) be a bipartite graph with weight function w : E → {1, • • • , W }. Note that G need not be simple, i.e., multi-edges are allowed. Additionally, there is a quota b : A ∪ B → Z >0 on the vertices and a capacity c : E → Z >0 on the edges. A function M : E → Z ≥0 is a feasible solution if (1) M (e) ≤ c(e) for every e ∈ E and (2) e∈δ(v) M (e) ≤ b(v) for every v ∈ A ∪ B. The goal is to find a feasible solution M so that e∈E w(e)M (e) is maximized.

Figure 2 . 1 :

 21 Figure 2.1: The numbers on edges denote their weights and the bold edges (x, a) and (b, c) are the ones in the maximum weight matching. The weight of a maximum weight matching in G is 5.

  the sets of vertices as defined in Definition 2.3.2. Furthermore, let M ′ be an arbitrary maximum cardinality b-matching in G. Then the following holds.(1) the three sets O A , E A , and U A are pairwise disjoint; so are O B , E B , and U B .

  the sum of M and the flow f . Let us summarize what we know about f using what we have proved so far. (i) Under f , there is no edge going from E A to U B ∪ E B and no edge from U A to E B , (ii) under f , there is no edge going from O B to U A ∪ O A , and no edge from U B to O A , (iii) for all vertices in O A ∪ U A ∪ O B ∪ U B , the amounts of incoming flow and outgoing flow are equivalent.

  respect to M can be determined in O(m + n) time easily. We are now ready to describe our algorithm to compute a maximum weight b-matching in G = (A ∪ B, E). The linear program corresponding to the maximum weight b-matching problem and the dual LP are given below. max e∈E w(e)x e e∈E(v) x e ≤ b(v) ∀v ∈ A ∪ B. 0 ≤ x e ≤ c(e) ∀e ∈ E. min v∈V b v y v + e∈E c(e)z e y a + y b + z e ≥ w(e) ∀e = (a, b) ∈ E.

  Theorem 2.3.5. The matching M W is a maximum weight b-matching in G. Proof. We prove the optimality of M W by showing a dual feasible solution ⟨y * u , z * e ⟩ (u∈A∪B, e∈E) such that this dual solution and M W satisfy complementary slackness conditions. Let y * u = y W u for all u ∈ A ∪ B and define z * e = 0 if e ̸ ∈ Ψ W , else z * e = w(e)y * ay * b where e = (a, b). Observe that w W (e) = w(e) for all edges e. The dual feasibility of ⟨y * u , z * e ⟩ (u∈A∪B, e∈E) follows from conditions (2.9), (2.10), (2.13), and the definition of z * e values. Primal complementary slackness follows from conditions (2.10) and (2.12) along with the definition of z * e values for e ∈ Ψ W . Dual complementary slackness follow from conditions (2.10) and (2.11) along with the observation that if z * e > 0 then e ∈ Ψ W . This proves that M W is primal optimal and ⟨y * u , z * e ⟩ (u∈A∪B, e∈E) is dual optimal. Thus the maximum weight bipartite capacitated b-matching problem can be decomposed into W unweighted versions of the same problem, where W = max e∈E w(e). The following computational result is immediate. Theorem 2.3.6. The maximum weight capacitated b-matching problem in G = (A ∪ B, E) can be solved in 1. O(W nm) time using Orlin's maximum flow algorithm [137], or 2. O(W √ βm) time, using Gabow's algorithm [61], where β = v∈A∪B b(e), in the case of simple b-matching (where c ≡ 1), or 3. O(W (n 1 m + n 3 1 )) time, using Ahuja et al.'s algorithm [5], where n 1 = min{|A|, |B|}, or 4. O(W (n 1 m + n 2 1 √ m)) time, using Ahuja et al.'s algorithm [5], or 5. O(W (n 1 m + n 2 1 √ log C)) time, using Ahuja et al.'s algorithm [5], or 6. O(W n 1 m log(2 + n 2 1 m )) time, using Ahuja et al.'s algorithm [5].

(

  I0) I ̸ = ∅. (I1) If I ⊆ J and J ∈ I, then I ∈ I. (I2) If I, J ∈ I and |I|< |J|, then there is e ∈ J \ I such that I + e ∈ I. 2

Lemma 3 .

 3 2.1. Assume that we are given a matroid M = (S, I) and a weight function w: S → {0, 1, . . . , W }. We define Z(t) = {e ∈ S | w(e) ≥ t} for each integer t ≥ 0. (i) M w = W t=0 (M|Z(t))/Z(t + 1).

Algorithm 1 :

 1 Exact algorithmInput: two matroids M 1 = (S, I 1 ) and M 2 = (S, I 2 ), a weight function w: S → Z ≥0 , and W = max e∈S w(e).

Lemma 3 .

 3 4.2. (1) During Phase i with 0 ≤ i ≤ log 2 ϵW , w 1 and w 2 are nonnegative multiples of δ i , except in Step (2-2).

≤

  w i (e) + 2δ j .

For

  the exact algorithm, a slight sharpening in the running time is possible. Observe that in Round i, Cunningham's algorithm takes O(τ |S ′ |r 1.5 ) time, where S ′ = {e ∈ S | w(e) ≥ i}. Since W i=1 |{e ∈ S | w(e) ≥ i}|= e∈S w(e), the total running time is O(τ ( e∈S w(e))r 1.5

Theorem 3 . 5 . 6 .

 356 For two linear matroids, we can solve the weighted matroid intersection exactly in O(nr log r * + W nr ω-1 * ) time and (1ϵ)-approximately in O(nr log r * + ϵ -1 nr ω-1 * log r * ) time, where r * is the size of a common independent set.

  ) ≥ d k+2 by Lemma 3.6.1. Hence we have w(t) 2 (e)w (t)2 (f ) > 0 for t = 0, 1, . . . , d k+1 -1. Therefore, (2) follows.

  both a and b rank each other as rank ≤ ri neighbors 1 if exactly one of {a, b} ranks the other as a rank ≤ ri neighbor 0 otherwise Definition 4.2.1. For any matching M in G, let signature(M ) be (|M |, w 1 (M ), . . . , w r-1 (M )), where w i (M ) = e∈M w i (e), for 1 ≤ i ≤ r -1.

  Figure 4.1.

Figure 4 . 1 :

 41 Figure 4.1: The bold edges are edges of Mj and are directed from B to A ′ while the edges of Ej \ Mj are directed from A ′ to B.

  Such algorithms take O(m √ n) time or Õ(n ω ) time when the largest edge weight is O(1). Let d v be the distance label of vertex v ∈ A ′ ∪ B. We define an initial vertex cover as follows. If a ∈ A ′ , let ỹa := d a ; if b ∈ B, let ỹb := -d b .

Theorem 4 .

 4 3.1. Given G = (A ∪ B, E) and a capacity function q : A ∪ B → S >0 , the fair b-matching problem can be solved in time O(rmn log (n 2 /m) log n) using space O(m).

( c ) 4 .

 c4 Compute new reduced costs as c i (u, v) = ci (u, v) + π(u)π(v). (d) Let d be the constant from Lemma 4.3.3 (in Appendix B). If any edge e ∈ E has |c i (e)|> d • n + 1 fix it to empty or saturated by removing it (and its reversal) from the graph and modifying the imbalances of both its endpoints accordingly. Return the b-matching induced by the flow x K and any flow on edges which were fixed to either empty or saturated.

Figure 4 . 3 :

 43 Figure 4.3: The scaling algorithm for the fair b-matching problem.

Lemma 4 . 3 . 2 .

 432 The following claims hold:

  Let f : 2 E → R + be a monotone submodular function. For two subsets S ⊆ T ⊆ E, it holds that f (T ) ≤ f (S) + e∈T \S f (e | S).

Lemma 5 . 2 . 3 .

 523 If v ≤ f (OPT) and there have been no bad item, then f ( S) ≥ (1α)v holds.Proof. By the submodularity and the monotonicity, we havev ≤ f (OPT) ≤ f (OPT ∪ S) ≤ f ( S) + e∈OPT\ S f (e | S).Since we have no bad item, f (e | S) ≤ αvc(e)/K for any e ∈ OPT \ S by Lemma 5.2.1 (2). Hence, we have v ≤ f ( S) + αv, implying f ( S) ≥ (1α)v.Consider an algorithm Singleton, which takes the best singleton as shown in Algorithm 2. If some item e ∈ OPT is bad, then, together with S′ = Singleton(), we can achieve (almost) 1/3approximation.Theorem 5.2.4. We have max{f ( S), f ( S′ )} ≥ min{α/2, 1 -α}v. The right-hand side is maximized to v/3 when α = 2/3.Proof. If there exists no bad item, we have f ( S) ≥ (1α)v by Lemma 5.2.3. Suppose that we have a bad item e ∈ E. Let S e ⊆ E be the set just before e arrives in MarginalRatioThresholding. Then, we have f (S e + e) ≥ αvc(S e + e)/K by Lemma 5.2.1 (1). Since c(S e + e) > K, this means f (S e + e) ≥ αv. Since f (S e + e) ≤ f (S e ) + f (e) by submodularity, one of f (S e ) and f (e) is at least αv/2. Thus f ( S) ≥ f (S e ) ≥ αv/2 or f ( S′ ) ≥ f (e) ≥ αv/2.

Lemma 5 . 3 . 1 .

 531 For a bad item e with c(e) ≤ bK, let S e be the set just before e arrives in Algorithm 4. Then f (S e ) ≥ λ holds. Thus branching has happened before e arrives. Proof. Sine e is a bad item, we have c(S e ) > Kc(e) ≥ (1b)K. Hence f (S e ) ≥ α(1b)v ≥ λ by Lemma 5.2.1 (1). Since the value of f is non-decreasing during the process, it means that branching has happened before e arrives. Since f (S ′ 0

Lemma 5 . 3 . 4 .

 534 Let α be a number in (0, 1], and suppose that we have exactly two bad items o b and o m with c(o b ) ≥ c(o m ). If v ≤ f (OPT) and b ∈ [c(o b )/K, (1 + ε)c(o b )/K], then it holds that

  {o b , o m }. Since the bad items o b and o m have size at most bK, these two items arrive after branching by Lemma 5.3.1. By Lemma 5.3.2, c(S ′ 0 + o b ) ≤ K and c(S ′ 0 + o m ) ≤ K. Since f ( S′ ) < βv, we know f (S ′ 0 + o b ) < βv and f (S ′ 0 + o m ) < βv. Hence it holds that

4 :

 4 if e ∈ E r and f (e) ≥ θv/(1 + ε) then 5:if S = ∅ then 6:

7 : else 8 :

 78 if f (e | S) > (θ -x|S|)v then S := S + e. 9:

)

  when θ ∈ [1/2, 2/3), Γ(θ) = 2/3, and when θ ∈ [2/3, 1], Γ(θ) = θ.

Lemma 5 . 5 . 2 .

 552 During the execution of SelectRedItems, f (S) ≥ v(θ( 1 1+ε + |S|-1)x |S|-1 j=1 j).

Figure 5

 5 Figure 5.1: Function Γ(θ).

4 :

 4 if f (S + e) ≥ (1/3 + θ(1 + ε))v then e 2 := e, S := S + e 2 and return S.

Lemma 5 . 5 . 9 .

 559 Consider the problem (5.1) with the knapsack capacity K ′ . Let h ∈ R + , and suppose that Algorithms 1 and 2 are modified as follows: • (At Line 4 in Algorithm 1) A new item e is added into the current set S only if f (e|S) c(e) ≥ αv-f (S) hK ′ -c(S) and c(S + e) ≤ hK ′ . • (At Line 4 in Algorithm 2) A new item e is taken into account only if c(e) ≤ hK ′ .

4 :

 4 Define a submodular function g e (•) = f (• | e).

  and θ satisfies the condition in Theorem 5.5.1. After running MultiPassKnapsack(ε, v, θ, c 1 ), there exists an item e ∈ S chosen in Line 2, which, along with S e collected in Line 6, gives f (S e + e) ≥ (2/5 -O(ε))v. Proof. By Theorem 5.5.1, one item e ∈ S has f (OPTo 1 + e) ≥ (Γ(θ) -O(ε))v and f (e) ≥ θv/(1 + ε).

  a + α b ≥ vote a (b, ⃗ x) + vote b (a, ⃗ x) ∀ (a, b) ∈ Ẽ.

  6.1: the half-integral matching ⃗ p = (S + M )/2 where S = {(a 1 , b 1 ), (a 2 , b 2 )} and M = {(a 1 , b 2 ), (a 2 , b 1 )} is popular as witnessed by the following α-values: α a0 = α a1 = α b2 = 0, α a2 = -1, and α b1 = 1. Note thatα a0 + α a1 + α a2 + α b1 + α b2 = 0.Instead of fixing a particular fractional matching ⃗ x and regarding LP1 as a linear program in the n variables α u , for u ∈ A ∪ B, we could regard LP1 as a linear program in m + n variables x e , for e ∈ Ẽ, and α u , for u ∈ A ∪ B. This yields the following linear program (where vote a (b, ⃗ x) and vote b (a, ⃗ x) have been explicitly written in terms of x e 's).

(

  LP2) minimize u∈A∪B α u α a + α b ≥ (6.1) b ′ :b ′ ≺ab x (a,b ′ )b ′ :b ′ ≻ab x (a,b ′ ) + a ′ :a ′ ≺ b a x (a ′ ,b) a ′ :a ′ ≻ b a x (a ′ ,b) ∀ (a, b) ∈ Ẽ.

  P ′ G for (a, b)) α a + α b ≥ vote a (b, ⃗ x) + (6.2) vote b (a, ⃗ x), ∀(a, b) ∈ Ẽ.

Proof.

  Consider the dual program corresponding to LP2. The dual variables are non-negative y e for each e = (a, b) ∈ Ẽ and β u for each u ∈ A ∪ B. This linear program is:(LP3) maximize u∈A∪B β u β a + β b + b ′ :b ′ ≺ab y (a,b ′ )b ′ :b ′ ≻ab y (a,b ′ ) + a ′ :a ′ ≺ b a y (a ′ ,b) a ′ :a ′ ≻ b a y (a ′ ,b) ≤ 0 ∀ (a, b) ∈ Ẽ.e∈ Ẽ(u) y e = 1 ∀u ∈ A ∪ B. y e ≥ 0 ∀e ∈ Ẽ.

b

  ′ : b ′ ≻ab x (a,b ′ ) + x (a,b) + a ′ : a ′ ≻ b a x (a ′ ,b) ≥ 1. (6.5) b ′ : b ′ ≺ab x (a,b ′ ) + x (a,b) + a ′ : a ′ ≺ b ax (a ′ ,b) ≤ 1.(6.6)

b

  ′ : b ′ ≺ab x (a,b ′ )b ′ : b ′ ≻ab x (a,b ′ ) (6.7) + a ′ : a ′ ≺ b a x (a ′ ,b)a ′ : a ′ ≻ b a

  for each b ∈ B: determine the value p b such that p b •(-1)+(1-p b )•1 = α x b , i.e., 1-2p b = α x b .

Figure 6 . 2 :

 62 Figure 6.2: We will reorder X a (the array on the left) by swapping the positive and negative sub-arrays as shown above.

Proof.

  We know by the covering constraint in P ′ G that for any (a, b) ∈ Ẽ:α x a + α x b ≥ b ′ ≺ab x (a,b ′ )b ′ ≻ab x (a,b ′ ) + a ′ ≺ b a x (a ′ ,b)a ′ ≻ b a x (a ′ ,b)Rewrite the above constraint in a simpler form by substitutingb ′ ≻ab x (a,b ′ ) = 1x (a,b)b ′ ≺ab x (a,b ′ ) and similarly substitute a ′ ≻ b a x (a ′ ,b) = 1x (a,b)a ′ ≺ b a x (a ′ ,b). Replace α x a with 2p a -1 and α x b with 1 -2p b . This results in the following simpler looking inequality:x (a,b) + b ′ ≺ab x (a,b ′ ) + a ′ ≺ b a x (a ′ ,b)(6.8)≤ 1 + p ap b = p a + (1p b ).

b

  ′ ≺ab x (a,b ′ ) ≥ p a . Let d = b ′ :b ′ ≺ab x (a,b ′ )p a . Then after traversing length d from the start of X ′ a (refer to Fig. 6.4), we reach the cell in X ′ a that contains b -this is the darkened red cell in X ′ a in Fig. 6.4 and it has length x (a,b) .

Figure 6 . 4 :

 64 Figure 6.4: The top array is X ′ a and the darkened cell there contains b. The cell exactly below this in the blue sub-array of X ′ b contains a.

  6.4). Let d ′ = a ′ :a ′ ≺ b a x (a ′ ,b) . After traversing length d ′ from this vertical line in X ′ b (marking the end of the positive sub-array) from right to left, we reach the cell that contains a. Note that this cell is within the positive sub-array of X ′ b since d ′ +x (a,b) ≤ 1-p b because b ′ ≺ab x (a,b ′ ) +d ′ +x (a,b) = p a +(1-p b ) (by Lemma 6.3.7) and we are in the case where b ′ ≺ab x (a,b ′ ) ≥ p a . Refer to Fig. 6.4, where the cell in X ′ b that contains a is the darkened blue cell and it has length x (a,b) . Since d + x (a,b) + d ′ = 1p b , it follows that the cell containing a in X ′ b and the cell containing b in X ′ a are exactly aligned with each other in the vertical direction. The picture is absolutely symmetric when a ′ ≺ b a x (a ′ ,b) ≥ (1p b ). Then the cell containing b is in the positive sub-array of X ′ a and the cell containing a is in the negative sub-array of X ′ b . The only case left is when b ′ ≺a b x (a,b ′ ) < p a and a ′ ≺ b a x (a ′ ,b) < (1p b ). So in X a , the line separating the positive sub-array from the negative sub-array went through the cell containing b and similarly, in X b , the line separating the negative sub-array from the positive sub-array went through the cell containing a. Let d 0 = b ′ ≺a b x (a,b ′ ) and d 1 = a ′ ≺ b a x (a ′ ,b) (see Fig. 6.5).

Figure 6 . 5 :

 65 Figure 6.5: Both the leftmost (the dashed red) cell and the rightmost (the dashed blue) cell in X ′ a contain b. Symmetrically both the leftmost (the dashed blue) cell and the rightmost (the dashed red) cell in X ′ b contain a. Let the length of the leftmost cell in X ′ a be x 0 (a,b) and let the length of the rightmost cell in X ′ b be x 1 (a,b) .Let the length of the rightmost cell in X ′ a be x 0 (a,b) and let the length of the leftmost cell inX ′ b be x 1 (a,b) . So x 0 (a,b) = p ad 0 and x 1 (a,b) = (1p b )d 1 . Lemma 6.3.7 tells us that x (a,b) + d 0 + d 1 = p a + (1p b ). Hence x (a,b) = x 0 (a,b) + x 1 (a,b). We know that the length of the cell containing b in X a is x (a,b) . So is the length of the cell containing a in X b . Hence the length of the leftmost cell inX ′ a is x (a,b)x 0 (a,b) = x 1 (a,b) and the length of the rightmost cell in X ′ b is x (a,b)x 1 (a,b) = x 0 (a,b). Thus in this case as well we have perfect alignment between the two cells in X ′ a that contain b and the two cells in X ′ b that contain a. So no matter which of these cells is intersected by the line L t , we have exact alignment between the cell containing a in X ′ b and the cell containing b in X ′ a .

  First suppose |OPT VC |≥ (1/2 + ϵ)n. Then returning the entire set of vertices V would give a n (1/2+ϵ)n = 2-Θ(ϵ) approximation. Next suppose n/2 ≤ |OPT VC |≤ (1/2+ϵ)n. Then the maximum utility of a popular matching in H is at least 2n -2((1/2 + ϵ)n) = (1 -2ϵ)n.

Table 2 .

 2 1: A summary of the current fastest maximum weight matching algorithms in G = (V, E), where |V |= n and |E|= m. The Õ notation of Cygan, Gabow and Sankowski's algorithm hides some factors of log nW .

	Running Time	Algorithm
	O(n(m + n log n))	Gabow [61]
	O(m

√ n log n log nW ), O(m √ n log nW ) Gabow and Tarjan [65], Duan, Pettie, and Su [38] Õ(W n ω )

Cygan, Gabow, and Sankowski

[START_REF] Cygan | Algorithmic applications of baur-strassen's theorem: shortest cycles, diameter and matchings[END_REF]

Table 2 .

 2 2: A summary of the current fastest maximum weight bipartite capacitated b-matching. Here β = v∈A∪B b(e), B = max v∈A∪B B(e), C = max e∈E c(e), n 1 = min(|A|, |B|), and SP + (n, m, W ) is the time needed to solve a shortest path problem in a digraph with n vertices, m arcs, and nonnegative edge length function l and e∈E l(e) ≤ W . Furthermore, the Õ notation of Gabow and Sankowski's algorithm hides some factors of log βW ; the Õ notation of Lee and Sidford's algorithm hides some factors of log m.

	Running Time	Algorithm	Note
	O(n log β • SP + (n, m, W )) O(nm log n 2 /m log nW )	Lawler [119] Goldberg and Tarjan [77, 78]
	O(m log n • SP + (n, m, W )) O(( √ βm + β log β) log nW )	Orlin [135, 136] Gabow and Tarjan [63]
	O((nm + β log β) log nW )	Gabow and Tarjan [63]
	O(n 1 m + n 3 1 log n 1 W ) O(n 1 m log(2 + n 2 1 m ) log n 1 W ) Õ( √ nm • log O(1) C) Õ(W β ω )	Ahuja, Orlin, Stein, and Tarjan [5] Ahuja, Orlin, Stein, and Tarjan [5] Lee and Sidford [122] Gabow and Sankowski [62]	only for simple graphs
	O(W nm) O(W √ βm)	this paper this paper	only for simple b-matching

  .6) Proof. Let S = MarginalRatioThresholding(α, v). Note that f ( S′ ) ≥ f ( S). If S has size at least and, if it is o 2 , we obtain by Lemma 5.3.3 with b 2

Indeed Petersen[START_REF] Petersen | Die theorie der regulären graphs[END_REF] made such an observation as early as in 1891.

After Edmonds, there are also non-constructive proofs showing his linear system describes the matching polytope, see for example[START_REF] Aráoz | Reductions to 1-matching polyhedra[END_REF][START_REF] Balinski | Establishing the matchig polytope[END_REF].

[START_REF] Abraham | Popular matchings[END_REF] Other common generalisations are also proposed, namely, the matchoid [? ] and the matroid matching [? ]. It turns out that all three formulations are equivalent.

This is the only example we are aware of where the linear program for a natural problem has this surprising property.

In Kao et al.[START_REF] Kao | A decomposition theorem for maximum weight bipartite matchings[END_REF], a decomposition theorem of the maximum weight matching in bipartite graphs is given and their algorithm is then derived from it. However, in general graphs, the same theorem fails and the correctness of our algorithm rather follows from the complementary slackness conditions. See Section

2.2.2 for details.

Here in the description and also in Step 2(c) of the algorithm, we use Edmonds' algorithm for ease of presentation. In actual implementation, we can use any other maximum cardinality algorithm to find a maximum cardinality Mi

This complexity is superior to the previous one only when the given weights are very "unbalanced."

We use the shorthand I + e and I -e to stand for I ∪ {e} and I \ {e}, respectively.

,M ′

(I ′ ). Then, the set I = I ′ △P is also (w 1 , w 2 )-near-optimal.Proof. By Lemma

3.2.1(iii), in G M ′ 1 ,M ′ 2 (I ′ ), an element e ∈ (Z 1 (t) \ Z 1 (t + 1)) \ I ′ hasoutgoing arcs to only other elements in Z 1 (t) \ Z 1 (t + 1) for every integer t ≥ 1. Similarly, an element

Sng used the term "generous maximum matching."

Irving called it "greedy matching."

We remark that the same LP was first introduced in[START_REF] Kavitha | Popular mixed matchings[END_REF]. However, its self-duality is observed and explicitly used the first time in the present work.

We can obtain (6.6) by summing up the two equations e∈E(a) xe = 1 and e∈E(b) xe = 1 and subtracting (6.5). (6.5) can be obtained from (6.6) analogously.

⃗ x ∈ M G , so ⃗ x is a convex combination of some matchings M 1 , . . . , Mr in G and if some M j is not perfect, then it means ∆(M j , S) < 0 and we also have ∆(M i , S) ≤ 0 for all matchings M i by the popularity of S, so this implies ∆(⃗ x, S) < 0

Acknowledgement.

We are grateful to the anonymous reviewers for their helpful comments. The second author wishes to thank Naveen Garg for fruitful discussions.

Step 2. Applying Algorithm 1: While i ≤ log 2 ϵW , do the following steps.

(2-0) Set L := W 2 i+1 if i < log 2 ϵW , and L := 1 if i = log 2 ϵW . (2-1) While h ≥ L, do the following steps.

(2-1-1) Set S ′ := {e ∈ S | w 2 (e) ≥ h}.

(2-1-2) Set M ′ ℓ = (S ′ , I ′ ℓ ) to be M w ℓ ℓ |S ′ for each ℓ = 1, 2. (2-1-3) Unweighted Matroid Intersection Construct I using I ′ so that (i) I is a maximum-cardinality common independent set of M ′ 1 and M ′ 2 , and (ii) I is (w 1 , w 2 )-near-optimal in S ′ .

(2-1-4) Update Weight (i) Let T ⊆ S ′ be the set of elements reachable from X 2 in G M ′ 1 ,M ′ 2 (I).

(ii) For each e ∈ T , let w 1 (e) := w 1 (e) + δ i , w 2 (e) := w 2 (e)δ i .

(2-1-5) Set h := hδ i and I ′ := I.

(2-2) Weight Adjustment:

If i < log 2 ϵW , do the following.

(2-2-1) ∀e ∈ I ′ , let w 2 (e) = w 2 (e) + δ i+1 .

(2-2-2) ∀e ∈ S \ I ′ where w i+1 (e) = w i (e) + δ i+1 , let w 2 (e) = w 2 (e) + δ i+1 .

(2-2-3) Set h := h + δ i+1 .

(2-3) Set i := i + 1.

Step 3. Return I.

The outer loop

Step 2 corresponds to a phase. We use a counter h to keep track of the progress of the algorithm. Initially h = W . In Phase i, the weights are always kept as nonnegative multiples of δ i . In Step (2-1), the two matroids M ′ 1 and M ′ 2 are defined on the common ground set S ′ = {e ∈ S | w 2 (e) ≥ h}, and the two procedures Unweighted Matroid Intersection and Update Weight are invoked as was done in the exact algorithm (Algorithm 1) in Section 3.3. The counter h is decreased by the amount of δ i each time after Update Weight is invoked in Step (2-1).

Each time h is halved, we make ready to move to the next phase, except in the last phase: in Phase log 2 ϵW , we stop when h goes down to 1. The reason that we adjust the w 2 -weights at Step (2-2) is that we want to ensure that in the beginning of the next phase, the weights w 1 and w 2 still approximate the next weight w i+1 (see Lemma 3.4.5). In particular, we increase the w 2 -weights of all elements in the current common independent set I ′ . This is to make sure that I ′ is still w 2 -maximum in the beginning of the next phase (with respect to the newly-defined set S ′ in Step (2-1)).

Analysis

We first observe the number of iterations in the algorithm.

where we recall Z(t) = {e ∈ S | w(e) ≥ t} for t = 0, . . . , W + 1. The size of A w is the same as A; the ground set of M w is S, and the row set of A w is also R. We denote by Y (t) the set of the nonzero rows in A w [R, Z(t)] for t = 0, . . . , W . Thus A w is a block-diagonal matrix whose blocks are A w [Y (t) \ Y (t + 1), Z(t) \ Z(t + 1)] for t = 0, . . . , W , where Y (W + 1) = ∅. Note that A w can be computed in O(nr ω-1 ) time, since this can be obtained by Gaussian elimination (see [START_REF] Harvey | An algebraic algorithm for weighted linear matroid intersection[END_REF]).

We now go back to the weighted matroid intersection. For ℓ = 1, 2, let M ℓ be a linear matroid of rank r ℓ on S, whose matrix representation is given by an r ℓ × n matrix A ℓ with the same field. We also denote by R ℓ the row set of A ℓ for ℓ = 1, 2. Then the following proposition is known in [START_REF] Harvey | Algebraic algorithms for matching and matroid problems[END_REF]. Proposition 3.5.4. Two linear matroids M 1 and M 2 have a common base if and only if the matrix N = -A 1 D -1 A ⊤ 2 is nonsingular, where D is a diagonal matrix of order n such that the set of the diagonal entries is algebraically independent.

Note that N can be computed in O(nr ω-1 ) time (see [START_REF] Harvey | Algebraic algorithms for matching and matroid problems[END_REF]). Let us consider the procedure Unweighted Matroid Intersection. Given a weight-splitting w 1 and w 2 of w, recall Z ℓ (t) = {e ∈ S | w ℓ (e) ≥ t} for t = 0, . . . , W + 1 and ℓ = 1, 2. Let Y ℓ (t) be the set of the nonzero rows in A w ℓ ℓ [R ℓ , Z ℓ (t)] for t = 0, . . . , W . For a subset S ′ , let Z ′ ℓ (t) = Z ℓ (t) ∩ S ′ .

Lemma 3.5.5. For two linear matroids, suppose that I ′ is (w 1 , w 2 )-near-optimal in a subset S ′ . Then we can construct a common independent set I, in O(nr ω-1 ) time, that is simultaneously (i) a maximum-cardinality common independent set of M ′ 1 and M ′ 2 , and (ii) (w 1 , w 2 )-near-optimal in S ′ .

Proof. We denote A ′ ℓ = A w ℓ ℓ [R ℓ , S ′ ], which is a matrix representation of M ′ ℓ |S ′ , for ℓ = 1, 2. We first show the following claim on (w 1 , w 2 )-near-optimality. Claim 2. A set J is (w 1 , w 2 )-near-optimal in a subset S ′ if and only if there exists U ℓ ⊆ R ℓ (ℓ = 1, 2) with Y 1 (1) ⊆ U 1 and Y 2 (p + 1) ⊆ U 2 , where p = min e∈S ′ w 2 (e), such that J is a common base of

Proof. Suppose J is (w 1 , w 2 )-near-optimal in S ′ . Then it follows from (3.1) that J ∩ Z ′ 1 (t) is a base of M 1 |Z ′ 1 (t) for every integer t ≥ 1 if and only if each submatrix

Conversely, suppose that we have row subsets U 1 and U 2 satisfying the conditions. Since

] is a zero matrix, the base J has a nonsingular submatrix

By the assumption that I ′ is (w 1 , w 2 )-near-optimal in S ′ , there exist U 1 and Let G = (A ∪ B, E) be a bipartite graph, where every vertex ranks its neighbors in an order of preference (with ties allowed) and let r be the worst rank used. A matching M is fair in G if it has maximum cardinality, subject to this, M matches the minimum number of vertices to rank r neighbors, subject to that, M matches the minimum number of vertices to rank (r -1) neighbors, and so on. We show an efficient combinatorial algorithm based on LP duality to compute a fair matching in G. We also show a scaling based algorithm for the fair b-matching problem.

Our two algorithms can be extended to solve other profile-based matching problems. In designing our combinatorial algorithm, we show how to solve a generalized version of the minimum weighted vertex cover in bipartite graph, using a single-source shortest paths computation-this can be of independent interest.

Introduction

Let G = (A ∪ B, E) be a bipartite graph on n vertices and m edges, where each u ∈ A ∪ B has a list ranking its neighbors in an order of preference (ties are allowed). Such an instance is usually referred to a stable marriage instance with incomplete lists and ties. A matching is a collection of edges, no two of which share an endpoint. The focus in stable marriage problems is to find matchings that are stable. However, there are many applications where stability is not the most critical objective: for instance, in matching students with counsellors or applicants with training posts, we cannot compromise on the size of the matching and a fair matching is a natural candidate for an optimal matching in such problems. We claim that d b ≤ 0. Suppose not. Then the shortest distance from s to b is strictly larger than 0. But this cannot be, since there is a path composed of edges (s, z) and (z, b), and such a path has total distance of exactly 0. This completes the proof of part (1).

To show part (2), by Lemma 4.2.4.3, an unmatched vertex must be in R. First, assume that this unmatched vertex is a ∈ (A ∩ R) \ K j-1 . By our construction, there is only one path from s to a, which is simply the directed edge from s to a and its distance is 0. So y a = d a = 0. Next assume that this unmatched vertex is b ∈ (B ∩ R) \ K j-1 . Suppose that ỹb > 0. Then d b = -ỹ b < 0. By Lemma 4.2.4.2 and the fact that all edges from A ′ \ R to B ∩ R have been deleted, the shortest path from s to b cannot go through (A ∪ B) \ R. So the shortest path from s to b must consist of the edge from s to some unmatched vertex a ∈ (A ′ ∩ R) \ K j-1 , followed by an augmenting path P (of odd length) ending at b. As in the proof of (1), we can replace M j by M j ⊕ P (irrespective of whether the first edge in P is virtual or not) so as to get a matching of larger weight while preserving the feasibility of the matching, a contradiction. This proves part (2).

For parts (3) and ( 4 At this point, we possibly still do not have a valid cover for the dual program due to the following two reasons.

• Some vertex a ∈ A \ K j-1 has ỹa < 0. (However it cannot happen that some vertex b ∈ B \ K j-1 has ỹb < 0, since Lemma 4.2.4.1 states that such a vertex is in R and Lemma 4.2.5.1 states that ỹb must be non-negative.)

• The edges deleted from G j (to form H j ) are not properly covered by the initial vertex cover {ỹ v } v∈A∪B .

We can remedy these two defects as follows. Define δ = max{δ 1 , δ 2 , 0},

where

In O(n + m) time, we can compute δ. If δ = 0, the initial cover is already a valid solution to the dual program. In the following, we assume that δ > 0 exists (if the initial cover is already a valid solution for the dual program, then the proof that it is also optimal is just the same as in Theorem 4.2.6.) We build the final vertex cover as follows. The proof of Theorem 4.2.6 is included in Appendix A. Given M j , it follows that the dual problem can be solved in time O(m √ n) or Õ(n ω ). The problem of computing M j can be solved by the following folklore technique: form a new graph Gj by taking two copies of G j and making the two copies of a vertex u / ∈ K j-1 adjacent using an edge of weight 0. A maximum weight perfect matching in Gj yields a maximum weight matching in G j that matches all vertices in K j-1 , i.e., an optimal solution to the primal program of the j-th iteration. Since c = O(1), a maximum weight perfect matching in Gj can be found in O(m √ n log n)

time by the fastest bipartite matching algorithms [START_REF] Duan | A scaling algorithm for maximum weight matchings in bipartite graphs[END_REF][START_REF] Fredman | Fibonacci heaps and their uses in improved network optimization algorithms[END_REF][START_REF] Gabow | Faster scaling algorithms for network problems[END_REF][START_REF] Orlin | New scaling algorithms for the assignment and minimum mean cycle problems[END_REF], or in Õ(n ω ) time with high probability by Sankowski's algorithm [START_REF] Sankowski | Maximum weight bipartite matching in matrix multiplication time[END_REF].

Our main algorithm

We now present our algorithm to compute a fair matching. Recall that r is the worst rank in the problem instance and r * is the worst rank in a fair matching. We first present an algorithm that runs for r iterations and we show later in this section how to terminate our algorithm in r * iterations.

2. For j = 0 to r -1 do (a) Find the optimal solution {y j u } u∈A∪B to the dual program of the (j + 1)-st iteration. (b) Delete from G j every edge (a, b) such that y j a + y j b > w j (e). Call this subgraph G j+1 . (c) Add all vertices with positive dual values to the critical set, i.e., K j = K j-1 ∪ {u} y j u >0 . 3. Return the optimal solution to the primal program of the last iteration.

The solution returned by our algorithm is a maximum (w r-1 )-weight matching in the graph G r-1 that matches all vertices in K r-2 . By Proposition 4.2.3, this is, in fact, a matching in the subgraph G r that matches all vertices in K r-1 . Lemma 4.2.8 proves the correctness of our algorithm. Lemma 4.2.7 (proof in Appendix A) guarantees that our algorithm is never "stuck" in any iteration due to the infeasibility of the primal or dual problem. Lemma 4.2.7. The primal and dual programs of the (j + 1)-st iteration are feasible, for 0 ≤ j ≤ r -1. Lemma 4.2.8. For every 0 ≤ j ≤ r -1, the following hold:

1. any matching M in G j that matches all v ∈ K j-1 is j-optimal; 2. conversely, a j-optimal matching in G is a matching in G j that matches all v ∈ K j-1 .

Proof. We proceed by induction. The base case is j = 0. As K -1 = ∅, G 0 = G, and all matchings are, by definition, 0-optimal, the lemma holds vacuously.

For the induction step j ≥ 1, suppose that the lemma holds up to j -1. As K j-1 ⊇ K j-2 and G j is a subgraph of G j-1 , M is a matching in G j-1 that matches all vertices of K j-2 . Thus Appendix A: Missing proofs from Section 4.2

Proof of Theorem 4.2.6. We first argue that {y v } v∈A∪B is a feasible dual solution. By Lemma 4.2.5.1 and the choice of δ, all vertices a ∈ A \ K j-1 have y a ≥ 0. By Lemma 4.2.4.1 and Lemma 4.2.5.1, all vertices b ∈ B \ K j-1 have y b ≥ 0. Also by Lemma 4.2.4.2 and Lemma 4.2.5.3, and the choice of δ, all edges in E j are properly covered. So {y v } v∈A∪B is feasible. We have: Abstract In this paper, we consider the problem of maximizing a monotone submodular function subject to a knapsack constraint in the streaming setting. In particular, the elements arrive sequentially and at any point of time, the algorithm has access only to a small fraction of the data stored in primary memory. For this problem, we propose a (0.363ε)-approximation algorithm, requiring only a single pass through the data; moreover, we propose a (0.4ε)-approximation algorithm requiring a constant number of passes through the data. The required memory space of both algorithms depends only on the size of the knapsack capacity and ε.

Introduction

A set function f : 2 E → R + on a ground set E is called submodular if it satisfies the diminishing marginal return property, i.e., for any subsets S ⊆ T ⊊ E and e ∈ E \ T , we have

A function is monotone if f (S) ≤ f (T ) for any S ⊆ T . Submodular functions play a fundamental role in combinatorial optimization, as they capture rank functions of matroids, edge cuts of graphs, and set coverage, just to name a few examples. Besides their theoretical interests, submodular Algorithm 4

S := ∅.

3:

while item e is arriving do

Delete e with c(e) > min{(1 + ε)c 1 , 1/2}K.

6:

if f (e|S) c(e) ≥ αv-f (S) K-c(S) and c(S + e) ≤ K then S := S + e.

7:

if f (S) ≥ λ then break // leave the While loop.

8:

Let ê be the latest added item in S.

10:

while item e is arriving do

Delete e with c(e) > min{(1 + ε)c 1 , 1/2}K.

13:

K-c(S) and c(S + e) ≤ K then S := S + e.

14:

return S or S ′ whichever has the larger function value.

Proof. We denote by S the set obtained right after leaving the while loop from Line

Let S and S′ be the final two sets computed by BranchingMRT. Note that we can regard S as the output of MarginalRatioThresholding and S′ as the final set obtained by adding at most one item to S ′ 0 . Observe that the number of bad items depends on the parameter α. As we will show in Section 5.3.2, by choosing a suitable α, if we have more than two bad items, then the size of S is large enough, implying that f ( S) is already good for approximation (due to Lemma 5.2.1 (1)). Therefore, in the following, we just concentrate on the case when we have at most two bad items.

Lemma 5.3.3. Let α be a number in (0, 1], and suppose that we have only one bad item

Proof. Suppose not, that is, suppose that both of f ( S) and f ( S′ ) are smaller than βv, where

In this case, we see that only the item o 1 can have size more than (1 + ε)c 2 K, and hence only o 1 can be a bad item. If o 1 is not a bad item, then we have no bad item, and hence Lemma 5.2.3 implies that

Thus the approximation ratio is the minimum of the RHSes of the above three inequalities. This is maximized when α = 1/(2c 2 ) or α = 2/(5 -4c 2c 1 ), and the maximum value is equal to the RHS of (5.6).

Note that the approximation ratio achieved in Lemma 5.3.5 becomes 1/3 -O(ε) when, for example, c 1 = c 2 = 1/2. Hence, the above lemma does not show any improvement over Theorem 5.2.4 in the worst case. Thus, we next consider the case that we have guessed the largest three sizes c(o 1 ), c(o 2 ), and c(o 3 ) in OPT. Using Lemma 5.3.4, we have the following guarantee. Lemma 5.3.6. Let ε ∈ (0, 1], and suppose that v ≤ f (OPT) and

Delete e with c(e) > (1 + ε)c 1 K.

7:

m := max{m, f (e)}.

8:

Delete S v (along with Ŝv and S ′ v if exists) such that v ̸ ∈ I.

10:

15:

Ŝv := S ′ .

16:

18:

20:

S := S v for v ∈ I that maximizes f (S v ).

21:

22:

return S or S ′ whichever has the larger function value.

Single-Pass (4/11ε)-Approximation Algorithm

In this section, we consider the case that c(o 1 ) is larger than K/2. For the purpose, we consider the problem of finding a set S of items that maximizes f (S) subject to the constraint that the total size is at most pK, for a given number p ≥ 2. We say that a set S of items is a (p, α)-approximate solution if c(S) ≤ pK and f (S) ≥ αf (OPT), where OPT is an optimal solution of the original instance.

Theorem 5.4.1. For a number p ≥ 2, there is a p, 2p 2p+3ε -approximation streaming algorithm with a single pass for the problem (5.1). In particular, when p = 2, it admits (2, 4/7ε)approximation. The space complexity of the algorithm is O(K(log(K)/ε) 3 ). The proof will be given in the next subsection. Using Theorem 5.4.1, we can design a (4/11ε)approximation streaming algorithm for an instance having a large item.

Theorem 5.4.2. For the problem (5.1), there exists a (4/11ε)-approximation streaming algorithm with a single pass. The space complexity of the algorithm is O(K(log(K)/ε) 4 ).

Proof. Let o 1 be an item in OPT with the maximum size. If c(o 1 ) ≤ K/2, then Theorem 5.3.8 gives a (2/5 -O(ε))-approximate solution, and thus we may assume that c(o 1 ) > K/2. Note that there exists only one item whose size is more than K/2. Let β be the target approximation Otherwise, c( S) < (p -(1 + ε)c 1 )K, and hence there is no bad item. Similarly to Lemma 5.2.3, it follows from Lemma 5.4.3 (2) that we have

The approximation ratio is the minimum of the RHSes of the above two inequalities, which is maximized to (pc 1 )/(p + 1c 1 ) -O(ε) by setting α = 1/(p + 1c 1 ).

Next, we design a branching algorithm based on BranchingMRT. Here, the parameter b should be at most 1, and the marginal-ratio threshold is replaced with (5.7). Also, λ is set to be

and, at Line 8 of Algorithm 4, the condition is changed to (pb)K instead of (1b)K. Let BranchingMRT ′ p be the resulting algorithm. The analysis in Section 5.3 can be adapted: Lemma 5.4.5. The following hold for BranchingMRT ′ p :

• For a bad item e ∈ E with c(e) ≤ bK, let S e be the set just before e arrives. Then f (S e ) ≥ λ holds. Thus, branching has happened before e arrives.

Note that in the second statement, we do not need the assumption that b ≤ 1/2 as c(ê

Determining α using good approximations to the largest two sizes c(o 1 ) and c(o 2 ) in OPT gives the following approximation guarantee:

Proof. If the output S has size at least (p -(1 + ε)c 2 )K, then we have by Lemma 5.4.3 (1)

In this case, we see that there exists at most one bad item.

If we have no bad item, it holds by Lemma 5.4.3 (2) that

Suppose that we have one bad item, which must be o 1 . Following the proof of Lemma 5.3.3, we Lemma 5.5.6.

On the other hand, it holds that

and the above two inequalities lead to a contradiction.

By the previous two lemmas, one of the red items in the returned set S, along with OPTo r , gives (2/3 -O(ε))v. We then can define Γ as 2/3 in the interval θ ∈ [1/2, 2/3).

Multiple-Pass (2/5ε)-Approximation Algorithm

In this section, we show that when c(o 1 ) ≥ K/2, we can use multiple passes to get a (2/5ε)-

First we observe the following claims.

Lemma 5.5.7. When c(o 1 ) ≥ K/2, we may assume that 3 10 f (OPT) < f (o 1 ) < 2 5 f (OPT).

Proof. If f (o 1 ) ≥ 2 5 f (OPT), then Algorithm 2 returns a 2/5-approximate solution. So we may assume that f (o 1 ) < 2 5 f (OPT). Suppose to the contrary that f (o 1 ) < 3 10 f (OPT). This implies f (OPTo 1 ) ≥ 7 10 f (OPT). Consider the problem of maximizing f (S) subject to c(S) ≤ K/2 in the set {e ∈ E | c(e) ≤ K/2}. Since the optimal value is at least f (OPTo 1 ) > 7 10 f (OPT), by applying the bicriteria approximation algorithm in Theorem 5.4.1 with p = 2, we obtain a solution S satisfying

Thus the lemma holds.

Lemma 5.5.8. We may assume that c(o 1 ) ≤ (1 + ε) 2 3 K.

Proof. Suppose not. That is, suppose c(o 1 ) > (1 + ε) 2 3 K. By Lemma 5.5.7, we may assume that f (o 1 ) < 2 5 f (OPT), and hence f (OPTo 1 ) > 3 5 f (OPT) by submodularity.

where the last inequality holds since f (e) ≥ θv/(1 + ε). When θ ≥ 1/2, we have Γ(θ) ≥ 2/3 by Theorem 5.5.1, and hence the ratio is more than 2/5. Consider the case when θ < 1/2. We observe that 2 3 θ + 1 3 Γ(θ) is a non-decreasing function. Hence the minimum is attained when θ = 3/10 by Lemma 5.5.7. The ratio is bounded by the linear function in (5.13) when t = 2, and hence it is at least 2/5.

The next theorem summarizes our results in this section.

Theorem 5.5.11. Suppose that c(o 1 ) > K/2. There exists an algorithm that uses MultiPassKnapsack as a subroutine so that it returns (2/5ε)-approximation with 3 passes for the problem (5.1). The space complexity of the algorithm is O(Kε -3 ).

Chapter 6

Popularity, Mixed Matchings, and Self-duality This paper appeared in SODA 2017. It is joint-work with Kavitha Telikepalli.

Abstract We consider the problem of matching applicants to jobs under two-sided preferences in a popular and utility-optimal manner. Our input instance is a bipartite graph G = (A ∪ B, E) with a utility function w : E → Q where each vertex u ∈ A ∪ B has a preference list ranking its neighbors in a strict order of preference. For any two matchings M and T in G, let ϕ(M, T ) be the the number of vertices that prefer M to T . A matching M is popular if ϕ(M, T ) ≥ ϕ(T, M ) for all matchings T in G. A mixed matching is defined as Π = {(M 0 , p 0 ), . . . , (M k , p k )} for some matchings M 0 , . . . , M k and k i=0 p i = 1, p i ≥ 0 for all i. The function ϕ(•, •) easily extends to mixed matchings; a mixed matching Π is popular if ϕ(Π, Λ) ≥ ϕ(Λ, Π) for all mixed matchings Λ in G.

Motivated by the fact that a popular mixed matching could have a much higher utility than all popular matchings, we study the popular fractional matching polytope P G . Our main result is that this polytope is half-integral (and in the special case where a stable matching is a perfect matching, this polytope is integral), implying that there is always a max-utility popular mixed matching Π such that Π = {(M 0 , 1 2 ), (M 1 , 1 2 )} and Π can be computed in polynomial time. An immediate consequence is that in order to implement a max-utility popular mixed matching in G, we need just one single random bit.

We analyze P G whose description may have exponentially many constraints via an extended formulation in m + n dimensions with O(m + n) constraints. The linear program that gives rise to this formulation has an unusual property: self-duality. In other words, this linear program is exactly identical to its dual program. This is a rare case where an LP of a natural problem has such a property. The self-duality of the LP plays a crucial role in our proof of the half-integrality of P G .

We also show that our result carries over to the roommates problem, where the given In economics, mixed matchings are called random assignments and they are used in the design of mechanisms to guarantee various desirable properties, such as efficiency, fairness, and strategyproofness (see [START_REF] Bogomolnaia | A new solution to the random assignment problem[END_REF][START_REF] Kavitha | Efficient algorithms for weighted rank-maximal matchings and related problems[END_REF] and the references therein). The function ϕ(M, M ′ ) defined earlier easily extends to ϕ(Π, M ′ ) as follows:

Then it follows easily from definition that if Π is popular then ∆(Π, Λ) ≥ 0 for all mixed matchings Λ in G. Thus a popular mixed matching "beats" all integral and mixed matchings. As an allocation mechanism, a popular mixed matching has several nice properties, such as population-consistency and composition-consistency. We refer the readers to [START_REF] Brandl | Consistent probabilistic social choice[END_REF] for details.

A popular mixed matching need not be a probability distribution over popular matchings in G. Such an example was shown in [START_REF] Kavitha | Popular half-integral matchings[END_REF] and we show a much simpler example below in Fig. 6.1.

Here A = {a 0 , a 1 , a 2 }, B = {b 1 , b 2 }, and E = A × B. The preference list of every applicant is the same: b 1 ≻ b 2 , i.e., b 1 is the top choice and then b 2 ; the preference list of every job is the same: a 1 ≻ a 2 ≻ a 0 . This instance admits exactly one popular matching: this is the stable matching S = {(a 1 , b 1 ), (a 2 , b 2 )} (the blue matching in Fig. 6.1). Consider the mixed matching Π = {(S, 1 2 ), (M, 1 2 )} where M = {(a 1 , b 2 ), (a 2 , b 1 )} (the red matching in Fig. 6.1). Note that Π is outside the convex hull of popular matchings -we will show in Section 6.2 that Π is popular. Whenever w(a 1 , b 2 ) + w(a 2 , b 1 ) is larger than w(a 1 , b 1 ) + w(a 2 , b 2 ), the utility of Π is higher than that of S. Thus the utility of a max-utility popular mixed matching can be much higher than that of a popular matching. Mixed matchings are closely related to fractional matchings. A fractional matching ⃗ p in G is a point in R m ≥0 that satisfies e∈E(v) p e ≤ 1, for every vertex v, where E(v) is the set of edges incident on vertex v. In a bipartite graph, a mixed matching is equivalent to a fractional matching (Birkhoff-von Neumann theorem). The polytope P G ⊆ R m of all popular mixed matchings in G = (A∪B, E) involves exponentially many constraints. However a compact extended formulation of this polytope was given in [START_REF] Kavitha | Popular mixed matchings[END_REF]. Thus a max-utility popular mixed matching can be computed in polynomial time.

(1) every blocking edge with respect to M is present in A 0 × B 1

(2) if (a, b) is an edge in A 1 × B 0 then both a and b prefer their respective partners in M to each other.

Set α M u = 1 for each u ∈ A 0 ∪ B 1 and set α M u = -1 for each u ∈ A 1 ∪ B 0 . This vector ⃗ α M witnesses M 's membership in P G since the covering constraints of all edges get satisfied by properties (1) and (2) given above; also u∈A∪B α M u = (a,b)∈M (α M a + α M b ) since M is perfect and this sum is 0 by our assignment of α M -values.

Let ⃗ x ∈ P G . We seek to express ⃗ x as a convex combination of some popular (integral) matchings M 1 , . . . , M k in G. For ease of the narrative, we say these matchings M i span ⃗ x in the following discussion.

We know from LP1 that there exists a witness ⃗ α x to the popularity of ⃗ x. Since ⃗ x has to fully match every vertex in A ∪ B to genuine neighbors, the covering constraint for (u, ℓ(u)) in the description of P ′ G becomes α x u ≥ -1. (Recall that ℓ(u) is the artificial last resort neighbor of u.) So α x u ≥ -1 for each u ∈ A ∪ B. It can also be shown that α x u ≤ 1 for each u ∈ A ∪ B. Before we prove this, we need the following very useful lemma. Recall that Ẽ

That is, we have:

Proof. This follows directly from Lemma 6.2.1 which proved that LP2 is self-dual. So (⃗ x,⃗ α x ) which is an optimal solution to LP2 is also an optimal solution to its dual. Thus the following condition is implied by complementary slackness: if x (a,b) > 0 then the constraint in LP2 for x (a,b) is tight. That is,

x (a ′ ,b) . Lemma 6.3.4. For every vertex u ∈ A ∪ B, we have α x u ≤ 1.

Proof. Let {v 1 , v 2 , . . . , v d } be the set of all neighbors of u such that x (u,vi) > 0. Let v d be the least preferred neighbor of u in this set. If

Similar to the interpretation of p a , the interpretation of p b is that if we assume p b fraction of the popular matchings that span ⃗ x assign b's α-value to -1 and so (1p b ) of them assign b's α-value to 1, then

As done for each a ∈ A, here also we form the array X b which is b's assignment in ⃗ x, however here the neighbors of b are arranged in decreasing order of b's preference. Definition 6.3.6. For any b ∈ B, the initial p b fraction of X b (i.e., the most preferred p b fraction of X b ) will be called the negative sub-array of X b and the remaining part (i.e., the least preferred 1p b fraction of X b ) will be called the positive sub-array of X b .

Refer to Fig. 6.3 -in the array on the left, the red part is the negative sub-array of X b and the blue part is the positive sub-array of X b . As before, we will assume that the negative sub-array of X b has b's α-value set to -1 and the positive sub-array of X b has b's α-value set to 1. We will cut X b at the end of its negative sub-array and move its entire positive sub-array to the left of its negative sub-array as shown in Fig. 6.3. Call this reordered array X ′ b . Finding the popular matchings that span ⃗ x. Form the table T whose rows are the reordered arrays X ′ u , for u ∈ A ∪ B. The table T has width 1 and the number of cells in u's row is at most deg(u) + 1, where deg(u) is u's degree in G. For any t ∈ [0, 1), define the matching M t as follows:

• draw the vertical line L t at distance t from the left end of T ;

• the line L t intersects (or touches the left boundary of) some cell in X ′ u for each u ∈ A ∪ B;

In fact, it is not obvious from the above construction that M t is a matching: we need to show that if b is in the cell in X ′ a at distance t from the left end of T , then a has to be in the cell in X ′ b at distance t from the left. We will show this in Theorem 6.3.8. Before we show this, we show the following simple lemma which will be used in the proof of Theorem 6.3.8.

Moreoever, if x (a,b) > 0 then this inequality is tight.

Observe that α t a + α t b = 0 for each edge (a, b) ∈ M t . This is because it follows from the proof of Theorem 6.3.8 that, for each edge (a, b) ∈ M t , either b's cell is in the negative sub-array of X ′ a and a's cell is in the positive sub-array of X ′ b or vice-versa. Since M t is a perfect matching, Corollary 6.3.9 follows. Corollary 6.3.9.

u∈A∪B α t u = 0.

We now need to show that ⃗ α t and I Mt also satisfy the "covering constraints" in P G . Refer to Fig. 6.6. The vertical line in X ′ a (with the left to right arrow adjacent to it) denotes the start of a's preference order of its partners in ⃗ x in increasing order and this wraps around. Similarly, the vertical line in X ′ b (with the right to left arrow adjacent to it) denotes the start of b's preference order of its partners in ⃗ x in increasing order and this also wraps around. Let the line L t intersect cell c in X ′ a and cell c ′ in X ′ b . Using Lemma 6.3.7, it is easy to make the following observations:

is the sum of lengths of positive sub-arrays in X ′ a and X ′ b . Hence for both a and b to be matched in M t to worse partners than each other, both c and c ′ must be in their respective positive sub-arrays. So if only one of c, c ′ is in its positive sub-array, then at least one of a, b is matched in M t to a better partner than the other.

(II) suppose both c and c ′ are in their respective negative sub-arrays: then we claim that both a and b get matched in M t to better partners than each other. This is because Proof. Let (a, b) ∈ E and let the line L t intersect cell c in X ′ a and cell c ′ in X ′ b . There are three possible cases regarding the "signs" of the cells c and c ′ :

(1) Both c and c ′ are positive: so α t a = α t b = 1 and thus α t a + α t b = 2; hence the covering constraint for edge (a, b) holds because the right side of this constraint is always at most 2.

120

(2) One of c, c ′ is positive and the other is negative: so (α t a , α t b ) is either (-1, 1) or (1, -1). We know from Observation (I) and the proof of Theorem 6.3.8 that when exactly one of the cells is positive, either (i) at least one of a, b is matched in M t to a better partner or (ii) a and b are matched to each other. Thus the edge (a, b) is covered in both these sub-cases.

(3) Both cells c and c ′ are negative: so α t a = α t b = -1. We know from Observation (II) that when both c and c ′ are negative, then both a and b are matched in M t to better partners than each other. Thus here also the edge (a, b) is covered.

Thus ⃗ α t and I Mt together satisfy the covering constraints in P G for all edges (a, b) in E. For each u ∈ A ∪ B, we have α t u ≥ -1 and so the covering constraint for the edge (u, ℓ(u)) is also satisfied (because vote u (ℓ(u), M t ) = -1). We have also shown that u α t u = 0. Thus we can conclude that I Mt ∈ P G , i.e., M t is a popular matching in G.

We are now ready to express ⃗ x as a convex combination of popular matchings: these matchings are obtained by sweeping a vertical line from the left end to the right end of table T . Whenever a new cell begins in some row in T (say, at distance t from the left end of T ), we define a new matching M t as described above. The leftmost cell in T begins at distance 0 from the left end of T , let the second leftmost cell in T begin at distance t 1 from the left side of T , and so on, i.e., let the i-th leftmost cell in T begin at distance t i-1 from the left side of T . Then we have:

The total number of matchings k that we construct here is at most m + |A| since m + |A|= a∈A (deg(a)+1) is an upper bound on the total number of distinct cells in T . Thus every popular fractional matching in G can be expressed as a convex combination of at most m + n popular matchings in G. This finishes the proof of Theorem 6.3.1, in other words, if G = (A ∪ B, E) admits a perfect stable matching then the polytope P G is integral.

Half-integrality of P G in the general bipartite graph

In this section we are in the general case: we have an instance G = (A∪B, E) with strict preference lists and G need not admit a stable matching that matches all vertices. We know that P G need not be integral here. We will show the following theorem. Theorem 6.4.1. The popular fractional matching polytope

We will show the above theorem with the help of Theorem 6.3.1. Using the given instance G, we will construct a new instance H = (V ∪V ′ , E ′ ) as follows: let V = A 0 ∪B 1 and let V ′ = B 0 ∪A 1 , where A i = {a i : a ∈ A} and B i = {b i : b ∈ B}, for i = 0, 1 (see Fig. 6.7).

The edge set of

∈ E}, for i = 0, 1. For i = 0, 1 and for each vertex u i in H, u i 's preference list is the same as it was in G, with a subscript i added to each of its neighbors (in the same order of preference) along with u 1-i added as u i 's least preferred neighbor in H.

The vertex set of the graph H is two copies of vertex set of the graph G.

Lemma 6.4.2. H admits a perfect stable matching.

Proof. Let S be a stable matching in H. Let S 0 = S ∩ E 0 and S 1 = S ∩ E 1 . Thus both S 0 and S 1 are stable matchings in G. Since all stable matchings in G match exactly the same vertices [START_REF] Gabow | Efficient algorithms for graphic matroid intersection and parity (extended abstract)[END_REF], it follows that u 0 is left unmatched in S 0 if and only if u 1 is left unmatched in S 1 . Thus S = S 0 ∪ S 1 ∪ {(u 0 , u 1 ) : u is an unstable vertex in G}. Thus S is perfect.

We can now use Theorem 6.3.1 to conclude that P H (the popular fractional matching polytope of H) is integral. The rest of this section will use the integrality of P H to prove that P G is halfintegral. In order to do this, we define a mapping f from P G to the set of fractional matchings in H. Let ⃗ x ∈ P G , where ⃗ x = (x e ) e∈ Ẽ ; we know that there exists a witness ⃗ α x = (α x v ) v∈A∪B such that ⃗ x and ⃗ α x satisfy the constraints of P ′ G . Define the vector f (⃗ x) = ⃗ z = (z e ) e∈E ′ as follows: for every edge (a, b) ∈ E, let z (a0,b0) = z (a1,b1) = x (a,b) and for every u ∈ A ∪ B, let z (u0,u1) = x (u,ℓ(u)) . It is easy to see that ⃗ z is a fractional matching in H. Lemma 6.4.3. f (⃗ x) is a popular fractional matching in H.

Proof. We need to show a witness vector ⃗ β = (β v ) v∈V ∪V ′ such that ⃗ β and f (⃗ x) satisfy the constraints in P ′ H . We define ⃗ β as follows: for each u ∈ A ∪ B, let

Given the fact that ⃗ x and ⃗ α x satisfy the covering constraints in P G for (a, b), it immediately follows that f (⃗ x) along with the vector ⃗ β satisfies covering constraints in P ′ H for the edges (a 0 , b 0 ) and (b 1 , a 1 ).

Consider the edge (u, ℓ(u)) in G for any u ∈ A ∪ B: we have α x u ≥ x (u,ℓ(u)) -1. In the graph H, the right side of the edge covering constraint for the edge (u 0 , u 1 ) is 2(x (u,ℓ(u)) -1) and as the left hand side is α x u + α x u , it follows that the covering constraint for the edge (u 0 , u 1 ) is also satisfied by f (⃗ x) and ⃗ β. Thus the covering constraints in the description of P ′ H for all edges in E ′ are satisfied by f (⃗ x) and ⃗ β. Since β ui = α x u ≥ -1, the covering constraint in P ′ H for the edge (u i , ℓ(u i )) is trivially satisfied for all u ∈ A ∪ B and i = 0, 1.

Our goal now is to define a mapping h, which is the inverse of f , from P H to P G , i.e., h•f (⃗ x) = ⃗ x for any popular fractional matching ⃗ x in G. Let ⃗ z = (z e ) e∈E ′ be any popular fractional matching in H. We define h(⃗ z) = ⃗ y = (y e ) e∈ Ẽ as given below and note that h • f (⃗ x) = ⃗ x for any x ∈ P G . y (a,b) = (z (a0,b0) + z (b1,a1) )/2 for every (a, b) ∈ E y (u,ℓ(u)) = z (u0,u1) for every u ∈ A ∪ B.

For ⃗ y to belong to P G , it is necessary that ⃗ y satisfies e∈ Ẽ(u) y e = 1 for each u ∈ A ∪ B. Since e∈E ′ z e = 1, it is simple to see that the above constraint is satisfied. We will now show that ⃗ y satisfies the other constraints defining P ′ G . For this we need to show a witness vector ⃗ α: we know that there exists a witness vector (β v ) v∈V ∪V ′ that is a witness to ⃗ z's popularity in H. For each u ∈ A ∪ B, let α u = (β u0 + β u1 )/2. Since u∈A∪B (β u0 + β u1 ) = 0, we have u∈A∪B α u = 0. Using the fact that ⃗ β and ⃗ z satisfy covering constraints for all edges in E ′ , it is straightforward to show that ⃗ α and h(⃗ z) satisfy covering constraints for all edges in Ẽ. Thus we can conclude the following lemma.

Lemma 6.4.4. For any popular fractional matching ⃗ z in H, h(⃗ z) is a popular fractional matching in G.

Theorem 6.4.1 follows from Lemma 6.4.5. Thus the polytope P G is half-integral.

Lemma 6.4.5. Let ⃗ x ∈ P G . Then ⃗ x = r i=1 λ i p i , where p 1 , . . . , p r are popular half-integral matchings in G and λ i ≥ 0 for 1 ≤ i ≤ r along with i λ i = 1.

Proof. Let ⃗ x ∈ P G and let ⃗ z = f (⃗ x). We know from Lemma 6.4.3 that ⃗ z ∈ P H . Since P H is integral, it follows that ⃗ z = r i=1 λ i M i , where M 1 , . . . , M r are popular matchings in H and for each i, we have λ i ≥ 0 along with i λ i = 1.

We know that h

). Lemma 6.4.4 tells us that h(M 1 ), . . . , h(M r ) belong to P G . Since M 1 , . . . , M r are integral matchings in H, it follows from the definition of h that h(M 1 ), . . . , h(M r ) are half-integral matchings in G. Thus ⃗ x is a convex combination of popular half-integral matchings in G.

Half-integrality of P G in a roommates instance

The input instance here is a graph G = (V, E) (not necessarily bipartite) and popular matchings need not always exist here. Consider the instance G on the left of Fig. 6.8 on 3 vertices a, b, and c. Suppose the preferences are cyclic, i.e., a prefers b to c, b prefers c to a, and c prefers a to b. It is easy to see that G has no popular matching. We first define the fractional matching polytope FM G of G:

x e ≤ 1 ∀u ∈ V and x e ≥ 0 ∀e ∈ E}.

The polytope P G is the set of points ⃗ x ∈ FM G such that ∆(⃗ x, ⃗ y) ≥ 0 for all ⃗ y ∈ FM G . It is known that FM G is half-integral, where a half-integral matching ⃗ p = (p e ) e∈E is a point in FM G such that p e ∈ {0, 1 2 , 1} for each edge e. Thus P G can also be defined as ∆(⃗ x, ⃗ p) ≥ 0 for all half-integral matchings p in G.

As done in the case of bipartite instances in Section 6.2, there is an extended formulation P ′ G on m + n variables as given by constraints (6.2)-(6.4). We will use this extended formulation to prove the half-integrality of P G as done in Section 6.4.

Corresponding to G, we define the bipartite graph

We show an example in Fig. 6.8 where the graph H on the right is the bipartite graph corresponding to the graph G on the left. The preference lists of vertices are identical to how we defined them in Section 6.4. Thus for each v ∈ V , we have v ′ as v's last choice and symmetrically, v is the v ′ 's last choice. The following lemma will be useful to us. Lemma 6.5.1. H admits a perfect stable matching.

Proof. Let S be a stable matching in H. We claim that S must be perfect. Suppose, for a contradiction, that v inV is unmatched (the case v ′ ∈ V ′ is unmatched follows symmetrically). As S is stable, v ′ must be matched to some vertex u 0 which ranks higher than v. Then u ′ 0 is matched to some vertex u 1 ranking higher than v (otherwise (v, u ′ 0 ) blocks S). As u ′ 0 prefers u 1 to v, u 0 prefers u ′ 1 to v ′ . Thus, u ′ 1 must be matched to some vertex u 2 ranking higher than u 0 , otherwise (u 0 , u ′ 1 ) blocks S. Repeating this reasoning, we find a path ρ = ⟨v, v ′ , u 0 , u ′ 0 , u 1 , u ′ 1 , . . .⟩, where s(v ′ ) = u 0 and s(u ′ i ) = u i+1 for i ≥ 0. Such a path is of finite length and must loop back to v, i.e., there exists some node u ′ k so that s(u ′ k ) = v, contradicting the assumption that v is unmatched.

Thus we can conclude that the popular fractional matching polytope P H of H is integral (by Theorem 6.3.1) The rest of the proof is identical to the proof in Section 6.4. For any ⃗ x ∈ P G , define the function f

As done in the proof of Lemma 6.4.3, it is easy to show that f (⃗ x) is a popular fractional matching in H. Thus f is a function from P G to P H .

We then define a mapping h from P H to P G such that h • f (⃗ x) = ⃗ x for any popular fractional matching ⃗ x in G. Let ⃗ z = (z e ) e∈E ′ be any popular fractional matching in H. We define h(⃗ z) = ⃗ y = (y e ) e∈ Ẽ as follows:

It is again easy to show that ⃗ y ∈ P G . So for any popular fractional matching ⃗ z in H, h(⃗ z) is a popular fractional matching in G.

As done in the proof of Lemma 6.4.5, we can now show that if ⃗ x ∈ P G then ⃗ x = r i=1 λ i p i , where p 1 , . . . , p r are popular half-integral matchings in G and λ i ≥ 0 for 1 ≤ i ≤ r along with i λ i = 1. Thus we can conclude Theorem 6.1.6.

Hardness of max-utility popular matching in roommates instances

In this section, we prove Theorem 6.1.4 by showing that it is NP-hard to compute a max-utility popular matching in a roommate instance. Here we use the characterization of popular matchings from [START_REF] Huang | Popular matchings in the stable marriage problem[END_REF] that uses edge labels -for edge (u, v) in E \M , assign the label (vote u (v, M (u)), vote v (u, M (v)). Note that all edges with the label (1,1) are blocking edges to M . Let G M be the graph obtained by deleting all edges labeled (-1, -1) from G. The matching M is popular in G if and only if the following three conditions hold in G M :

(1) There is no alternating cycle with respect to M that contains a (1, 1) edge.

(2) There is no alternating path starting from an unmatched vertex that contains a (1, 1) edge.

(3) There is no alternating path with respect to M that contains more than one (1, 1) edge.

Let G = (V, E) be an instance of vertex cover. We construct a new graph H now. H will be a complete graph. For every vertex v i ∈ V , there will be four vertices a i 0 , a i 1 , a i 2 , a i 3 in H and they have the following preferences (here π(X) means a permutation of elements in X in an arbitrary order and π(• • •) means an arbitrary permutation of all vertices not explicitly listed so far in the preference list of a i t , 0 ≤ t ≤ 3):

We now define edge utilities in H as follows: w(a i 0 , a i 2 ) = w(a i 1 , a i 3 ) = 2, ∀v i ∈ V ; all other edges e have w(e) = 1. Proof. We construct a popular matching M in H according to the vertex cover

Observe that G M consists of the following edges. See Fig. 6.9 and Fig. 6.10.

Edges in M .

2. ∀v i ∈ C: (a i 0 , a i 2 ), (a i 1 , a i 2 ), (a i 1 , a i 3 ) -these are (1, -1) edges.

3. ∀v i ∈ V \ C: (a i 0 , a i 1 ), (a i 1 , a i 2 ) -these are (1, 1) edges.

4. (a i 0 , a j 0 ) is a (1, -1) edge and such an edge exists in G M if and only if (v i , v j ) ∈ E, and exactly one of v i , v j is in C. Note that if (v i , v j ) ∈ E, then (a i 0 , a j 0 ) cannot be a (1, 1) edge since C is a vertex cover. We now show that M is popular. As M is a perfect matching, we only need to show that conditions (1) and (3) characterizing popular matchings (from [START_REF] Huang | Popular matchings in the stable marriage problem[END_REF]) stated earlier hold in G M . That is, there is no alternating path containing two or more (1, 1) edges and no alternating cycle containing at least a (1, 1) edge.

The only (1, 1) edges in G M are (a i 0 , a i 1 ) and (a i 1 , a i 2 ) when v i ∈ V \C. The alternating path (cycle) containing (a i 0 , a i 1 ) must contain (a i 3 , a i 1 ) ∈ M and (a i 0 , a i 2 ) ∈ M and neither a i 3 nor a i 2 has any other incident edges in G M . So we can rule out such paths (cycles).

Next suppose that the alternating path (cycle) contains (a i 1 , a i 2 ). Such a path (cycle) contains (a i 1 , a i 3 ) ∈ M and (a i 0 , a i 2 ) ∈ M and as a i 3 has no other incident edge in G M , we can rule out the possibility of the alternating cycle containing (a i 1 , a i 2 ). Observe that a i 0 may have incident edges (a i 0 , a j 0 ) labeled as (1, -1) in G M , when v j ∈ C. However, the alternating path, if it includes (a i 0 , a j 0 ), must also include (a j 0 , a j 1 ) ∈ M . As a j 1 has only (a j 1 , a j 2 ) and (a j 1 , a j 3 ) as incident edges, it is easy to see that this alternating path must be "trapped" (see Figure 6.10) inside the vertices corresponding to v j (i.e., this path cannot continue on to vertices corresponding to other nodes v k̸ =j ), without encountering a second (1, 1) edge. This proves the popularity of M .

We now proceed on the other direction of the reduction. Lemma 6.6.2. No edge (a i t , a j t ′ ), 0 ≤ t, t ′ ≤ 3, i ̸ = j, belongs to a popular matching M .

Proof. First assume that t, t ′ ∈ {0, 1}. If (a i t , a j t ′ ) ∈ M , then the path v i 1-t -v i t -v j t ′ -v j 1-t ′ contains two (1, 1) edges. Next assume that t ∈ {0, 1} and t ′ ∈ {2, 3}. Suppose first that t ′ = 2. If (a j 1 , a j 3 ) ̸ ∈ M , then v i 1-t -v i t -v j 2 -v j 3 has two (1, 1) edges; if (a j 1 , a j 3 ) ∈ M , then v i 1-t -v i t -v j 2 -v j 0 has two (1, 1) edges ((v j 2 , v j 0 ) is a (1, 1) edge since we already established that v j 0 cannot be matched to v j ′ ̸ =j 0 in M ). Suppose next that t ′ = 3. If a j 2 is matched to neither a j 0 nor a j 1 , then v i 1-t -v i t -v j 3 -v j 2 has two (1, 1) edges; if a j 2 is matched to a j t ′′ where t ′′ ∈ {0, 1}, then v i 1-t -v i t -v j 3 -v j 1-t ′′ has two (1, 1) edges. So we have established that a i 0 , a i 1 cannot be matched to vertices corresponding to other nodes v j ∈ V . The remaining case is t, t ′ ∈ {2, 3}. Suppose that t = 2. If (a i 1 , a i 3 ) ∈ M , then (a i 2 , a i 1 ) is a (1, 1) edge; if (a i 1 , a i 0 ) ∈ M , then (a i 2 , a i 3 ) is (1, 1). Suppose that t = 3. If (a i 0 , a i 1 ) (respectively (a i 0 , a i 2 ), (a i 1 , a i 2 )) is part of M , then (a i 3 , a i 2 ) (respectively, (a i 3 , a i 1 ), (a i 3 , a i 0 )) is an (1, 1) edge. This applies to t ′ analogously. We then have a path of length 3 with two (1, 1) edges (with (a i t , a j t ′ ) in between) to arrive at a contradiction. Lemma 6.6.3. Suppose M is popular in the instance H.

(i) For the vertices a i 0 , a i 1 , a i 2 , a i 3 , either {(a i 0 , a i 1 ), (a i 2 , a i 3 )} ⊆ M or {(a i 0 , a i 2 ), (a i 1 , a i 3 )} ⊆ M .

(ii) If (v i , v j ) ∈ E, then it cannot happen that {(a i 0 , a i 2 ), (a i 1 , a i 3 ), (a j 0 , a j 2 ), (a j 1 , a j 3 )} ⊆ M .

Proof. For (i), first note that M has to be a perfect matching, otherwise, the edge between two unmatched vertices is a (1, 1) edge, contradicting the popularity of M . So by Lemma 6.6.2, we just need to rule out the possibility of {(a i 0 , a i 3 ), (a i 1 a i 2 )} ⊆ M . If this happens, then a i 0 -a i 1 -a i 2 -a i 3 -a i 0 is a cycle with a (1, 1) and a (1, -1) edge in it, contradicting the popularity of M . For (ii), if the described situation really happens, then the alternating path a i 0 -a j 0 -a j 2 -a j 1 has two (1, 1) edges, a contradiction. Lemma 6.6.4. Suppose M is a popular matching with w(M ) = 4n -2k. Then we can construct a vertex cover C with |C|= k.

Proof. By Lemma 6.6.3 (i), either {(a i 0 , a i 1 ), (a i 2 , a i 3 )} ⊆ M or {(a i 0 , a i 2 ), (a i 1 , a i 3 )} ⊆ M . In the former case, put v i ∈ C; in the latter case, leave v i ouside of C. It follows from Lemma 6.6.3 (ii) that the set C is a vertex cover in G. The fact that |C|= k can be easily verified. Using Lemmas 6.6.1 and 6.6.4, we can draw the following conclusion. Theorem 6.6.5. It is NP-hard to compute a max-utility popular matching in the roommates instance, even when all preferences are strict and complete, and each edge utility is either 1 or 2.

Suppose the edge utilities are non-negative arbitrary values. We can also show the following inapproximability result.