Many-to-one matchings with lower quotas: Algorithms and complexity

. We study a natural generalization of the maximum weight many-to-one matching problem. We are given an undirected bipartite graph G = ( A ˙ ∪ P, E ) with weights on the edges in E , and with lower and upper quotas on the vertices in P . We seek a maximum weight many-to-one matching satisfying two sets of constraints: vertices in A are incident to at most one matching edge, while vertices in P are either unmatched or they are incident to a number of matching edges between their lower and upper quota. This problem, which we call maximum weight many-to-one matching with lower and upper quotas ( wmlq ), has applications to the assignment of students to projects within university courses, where there are constraints on the minimum and maximum numbers of students that must be assigned to each project. In this paper, we provide a comprehensive analysis of the complexity of wmlq from the viewpoints of classic polynomial time algorithms, ﬁxed-parameter tractability, as well as approximability. We draw the line between NP -hard and polynomially tractable instances in terms of degree and quota constraints and provide eﬃcient algorithms to solve the tractable ones. We further show that the problem can be solved in polynomial time for instances with bounded treewidth; however, the corresponding runtime is exponential in the treewidth with the maximum upper quota u max as basis, and we prove that this dependence is necessary unless FPT = W [1]. Finally, we also present an approximation algorithm for the general case with performance guarantee u max + 1, which is asymptotically best possible unless P = NP .


Introduction
Many university courses involve some element of team-based project work.A set of projects is available for a course and each student submits a subset of projects as acceptable.For each acceptable student-project pair (s, p), there is a weight w(s, p) denoting the utility of assigning s to p.The question of whether a given project can run is often contingent on the number of students assigned to it.Such quota constraints also arise in various other contexts involving the centralized formation of groups, including organizing activity groups at a leisure center, opening facilities to serve a community and coordinating rides within car-sharing systems.In these and similar applications, the goal is to maximize the utility of the assigned agents under the assumption that the number of participants for each open activity is within the activity's prescribed limits.
We model this problem using a weighted bipartite graph G = (A ∪ P, E), where the vertices in A represent applicants, while the vertices in P are posts they are applying to.So in the above student-project allocation example, A and P represent the students and projects respectively, and E represents the set of acceptable student-project pairs.The edge weights capture the cardinal utilities of an assigned applicant-post pair.Each post has a lower and an upper quota on the number of applicants to be assigned to it, while each applicant can be assigned to at most one post.In a feasible assignment, a post is either open or closed : the number of applicants assigned to an open post must lie between its lower and upper quota, whilst a closed post has no assigned applicant.The objective is to find a maximum weight many-to-one matching satisfying all lower and upper quotas.We denote this problem by wmlq.
In this paper, we study the computational complexity of wmlq from various perspectives: Firstly, in Section 2, we show that the problem can be solved efficiently if the degree of every post is at most 2, whereas the problem becomes hard as soon as posts with degree 3 are permitted, even when lower and upper quotas are all equal to the degree and every applicant has a degree of 2. Furthermore, we show the tractability of the case of pair projects, i.e., when all upper quotas are at most 2.Then, in Section 3, we study the fixed parameter tractability of wmlq.To this end, we generalize the known dynamic program for maximum independent set with bounded treewidth to wmlq.The running time of our algorithm is exponential in the treewidth of the graph, with u max , the maximum upper quota of any vertex, as the basis.This yields a fixed-parameter algorithm when parameterizing by both the treewidth and u max .We show that this exponential dependence on the treewidth cannot be completely separated from the remaining input by establishing a W [1]-hardness result for wmlq parameterized by treewidth.Finally, in Section 4, we discuss the approximability of the problem.We show that a simple greedy algorithm yields an approximation guarantee of u max + 1 for wmlq and |A| + 1 in the case of unit edge weights.We complement these results by showing that these approximation factors are asymptotically best possible, unless P = NP.

Related work
Among various applications of centralized group formation, perhaps the assignment of medical students to hospitals has received the most attention.In this context, as well as others, the underlying model is a bipartite matching problem involving lower and upper quotas.The Hospitals / Residents problem with Lower Quotas (hrlq) [3,11] is a variant of wmlq where applicants and posts have ordinal preferences over one another, and we seek a stable matching of residents to hospitals.Hamada et al. [11] considered a version of hrlq where hospitals cannot be closed, whereas the model of Biró et al. [3] permitted hospital closures.Strategyproof mechanisms have also been studied in instances with ordinal preferences and no hospital closure [10].
The Student / Project Allocation problem [19,Section 5.6] models the assignment of students to projects offered by lecturers subject to upper and lower quota restrictions on projects and lecturers.Several previous papers have considered the case of ordinal preferences involving students and lecturers [1,13,20] but without allowing lower quotas.However two recent papers [14,21] do permit lower quotas together with project closures, both in the absence of lecturer preferences.Monte and Tumennasan [21] considered the case where each student finds every project acceptable, and showed how to modify the classical Serial Dictatorship mechanism to find a Pareto optimal matching.Kamiyama [14] generalized this mechanism to the case where students need not find all projects acceptable, and where there may be additional restrictions on the sets of students that can be matched to certain projects.This paper also permits lower quotas and project closures, but our focus is on cardinal utilities rather than ordinal preferences.
The unit-weight version of wmlq is closely related to the D-matching problem [7,17,26], a variant of graph factor problems [24].In an instance of the D-matching problem, we are given a graph G, and a domain of integers is assigned to each vertex.The goal is to find a subgraph G ′ of G such that every vertex has a degree in G ′ that is contained in its domain.Lovász [16] showed that the problem of deciding whether such a subgraph exists is NP-complete, even if each domain is either {1} or {0, 3}.On the other hand, some cases are tractable.For example, if for each domain D, the complement of D contains no consecutive integers, the problem is polynomially solvable [26].As observed in [25], D-matchings are closely related to extended global cardinality constraints and the authors provide an analysis of the fixed-parameter tractability of a special case of the D-matching problem; see Section 3 for details.
The problem that we study in this paper corresponds to an optimization version of the D-matching problem.We consider the special case where G is bipartite and the domain of each applicant vertex is {0, 1}, whilst the domain of each post vertex p is {0} ∪ {ℓ(p), . . ., u(p)}, where ℓ(p) and u(p) denote the lower and upper quotas of p respectively.Since the empty matching is always feasible in our case, our aim is to find a domain-compatible subgraph G ′ such that the total weight of the edges in G ′ is maximum.
2 Degree-and quota-restricted cases First, we provide a formal definition of the maximum weight many-to-one matching problem with lower quotas (wmlq).Then, we characterize the complexity of the problem in terms of degree constraints on the two vertex sets: applicants and posts.At the end, we discuss the case of bounded upper quota constraints.

Problem definition
In our problem, a set of applicants A and a set of posts P are given.A and P constitute the two vertex sets of an undirected bipartite graph G = (V, E) with V = A ∪ P .For a vertex v ∈ V we denote by δ(v) = {{v, w} ∈ E : w ∈ V } the set of edges incident to v and by Γ (v) = {w ∈ V : {v, w} ∈ E} the neighborhood of v, i.e., the set of vertices that are adjacent to v.For a subset of vertices Each edge carries a weight w : E → R ≥0 , representing the utility of the corresponding assignment.Each post is equipped with a lower quota ℓ : P → Z ≥0 and an upper quota u : P → Z ≥0 so that ℓ(p) ≤ u(p) for every p ∈ P .These functions bound the number of admissible applicants for the post (independent of the weight of the corresponding edges).Furthermore, every applicant can be assigned to at most one post.Thus, an assignment is a subset M ⊆ E of the edges such that |δ(a) ∩ M | ≤ 1 for every applicant a ∈ A and |δ(p) ∩ M | ∈ {0, ℓ(p), ℓ(p) + 1, ..., u(p)} for every p ∈ P .A post is said to be open if the number of applicants assigned to it is greater than 0, and closed otherwise.The size of an assignment M , denoted |M |, is the number of assigned applicants, while the weight of M , denoted w(M ), is the total weight of the edges in M , i.e., w(M ) = e∈M w(e).The goal is to find an assignment of maximum weight.
Remark 1.Note that when not allowing closed posts, the problem immediately becomes tractable.It is easy to see this in the unweighted case as any algorithm for maximum flow with lower capacities can be used to determine an optimal solution in polynomial time.This problem can be easily reduced to the classical maximum flow problem.The method can be naturally extended to the weighted case as the flow based linear program has integral extreme points due to its total unimodularity property.

Problem 1 wmlq
Input: I = (G, w, ℓ, u); a bipartite graph G = (A ∪ P, E) with edge weights w.Task: Find an assignment of maximum weight.If w = 1 for all e ∈ E, we refer to the problem as mlq.Some trivial simplification of the instance can be executed right at start.If u(p) > |Γ (p)| for a post p, then u(p) can be replaced by |Γ (p)|.On the other hand, if ℓ(p) > |Γ (p)|, then post p can immediately be deleted, since no feasible solution can satisfy the lower quota condition.Moreover, posts with ℓ(p) = 1 behave identically to posts without a lower quota.From now on we assume that the instances have already been simplified this way.

Degree-restricted cases
In this subsection, we will consider wmlq(i, j), a special case of wmlq, in which we restrict us to instances in which every applicant submits at most i applications and every post receives at most j applications.In order to establish our first result, we reduce the maximum independent set problem (mis) to mlq.In mis, a graph with n vertices and m edges is given and the task is to find an independent vertex set of maximum size.mis is not approximable within a factor of n 1−ε for any ε > 0, unless P = NP [29].The problem remains APX-complete even for cubic (3-regular) graphs [2].
Proof.First of all, mlq(2,3) is in APX because feasible solutions are of polynomial size and the problem has a 4-approximation (see Theorem 7).
To each instance I of mis on cubic graphs we create an instance I ′ of mlq such that there is an independent vertex set of size at least K in I if and only if I ′ admits an assignment of size at least 3K, yielding an approximation-preserving reduction.The construction is as follows.To each of the n vertices of graph G in I, a post with upper and lower quota of 3 is created.The m edges of G are represented as m applicants in I ′ .For each applicant a ∈ A, |Γ (a)| = 2 and Γ (a) comprises the two posts representing the two end vertices of the corresponding edge.Since we work on cubic graphs, |Γ (p)| = 3 for every post p ∈ P .
First we show that an independent vertex set of size K can be transformed into an assignment of at least 3K applicants.All we need to do is to open a post with its entire neighborhood assigned to it if and only if the vertex representing that post is in the independent set.Since no two posts stand for adjacent vertices in G, their neighborhoods do not intersect.Moreover, the assignment assigns exactly three applicants to each of the K open posts.
To establish the opposite direction, let us assume that an assignment of cardinality at least 3K is given.The posts' upper and lower quota are both set to 3, therefore, the assignment involves at least K open posts.No two of them can represent adjacent vertices in G, because then the applicant standing for the edge connecting them would be assigned to both posts at the same time.
⊓ ⊔ So far we have established that if |Γ (a)| ≤ 2 for every applicant a ∈ A and |Γ (p)| ≤ 3 for every post p ∈ P , then mlq is NP-hard.In the following, we also show that these restrictions are the tightest possible.If |Γ (p)| ≤ 2 for every post p ∈ P , then a maximum weight matching can be found efficiently, regardless of |Γ (a)|.Note that the case wmlq(1,∞) is trivially solvable.
Proof.After executing the simplification steps described after the problem definition, we apply two more changes to derive our helper graph H. Firstly, if ℓ(p) = 0, u(p) = 2 and |Γ (p)| = 2, we separate p's two edges, splitting p into two posts with upper quota 1.After this step, all posts with u(p) = 2 also have ℓ(p) = 2.All remaining vertices are of upper quota 1.Then, we substitute all edge pairs of posts with ℓ(p) = u(p) = 2 with a single edge connecting the two applicants.This edge will carry the weight equal to the sum of the weights of the two deleted edges.
Clearly, any matching in H translates into an assignment of the same weight in G and vice versa.Finding a maximum weight matching in a general graph with n vertices and m edges can be done in O(n(m + n log n)) time [9], which reduces to O(n 2 log n) in our case.

Quota-restricted cases
In this section, we address the problem of wmlq with bounded upper quotas.Note that Theorem 1 already tells us that the case of u(p) ≤ 3 for all posts p ∈ P is NP-hard to solve.We will now settle the complexity of the only remaining case, where we have instances with every post p ∈ P having an arbitrary degree and u(p) ≤ 2. This setting models posts that need to be assigned to pairs of applicants.
The problem is connected to various known problems in graph theory, one of them being the S-path packing problem.In that problem, we are given a graph with a set of terminal vertices S. The task is to pack the highest number of vertex-disjoint paths so that each path starts and ends at a terminal vertex, while all its inner vertices are non-terminal.The problem can be solved in O(n 2.38 ) time [6,27] with the help of matroid matching [18].An instance of mlq with ℓ(p) = u(p) = 2 for every post p ∈ P corresponds to an S-path packing instance with S = A. The highest number of vertex-disjoint paths starting and ending in A equals half of the cardinality of a maximum assignment.Thus, mlq with ℓ(p) = u(p) = 2 can also be solved in O(n 2.38 ) time.On the other hand, there is no straightforward way to model posts with u(p) = 1 in S-path packing and introducing weights to the instances also seems to be a challenging task.Some progress has been made for weighted edge-disjoint paths, but to the best of our knowledge the question is unsettled for vertex-disjoint paths [12].
Here we present a solution for the general case wmlq with u(p) ≤ 2. Our algorithm is based on f -factors of graphs.In the f -factor problem, a graph G and a function f : where deg F (v) denotes the degree of v in the graph (V, F ). Constructing an f -factor of maximum weight in a graph with n vertices and m edges or proving that none exists can be done in O(φ(m+n log n)) time, where φ is the sum of all f -values in the graph [8,9].The graph G ′ = (V ′ , E ′ ) of the constructed f -factor instance contains the graph G = (V, E) of our wmlq instance, as shown in Figure 1.We add a dummy post p d to V and connect it to every applicant in A. For every post p i in P 1 we add a dummy vertex q 1 i and connect p i to q 1 i to p d with a path of length 2, and for every post p i with ℓ(p i ) = u(p i ) = 2 we add two dummy vertices q 1 i and q 2 i and a triangle containing p and two new dummy nodes.All new edges in for every p ∈ P and f (v) = 1 for the rest of the vertices.In the initial version of our algorithm, we solve a weighted f -factor problem for every K ∈ {0, 1, ..., |A| + |P 1 |}, and later we will show a slightly modified version of the f -factor instance so that it is sufficient to construct only 2 instances.
Fig. 1.The transformation from wmlq to an f -factor problem.The solid edges form G, while the dotted edges are the added ones, carrying weight 0.
First we show that if there is a feasible assignment M in G so that the number of unmatched applicants and the number of matched posts in P 1 add up to K, then it can be extended to an f -factor M ′ of the same weight in G ′ .We construct M ′ starting with M and add the following edges to it: -{p d , a i } for every applicant a i that is unmatched in M ; -q 1 i , p i and q 2 i , p i for every post For all vertices v = p d , it immediately follows from the construction that deg M ′ (v) = f (v).The same holds for p d as well, because edges are assigned to it if and only if an applicant is unmatched or a post in P 1 is matched and we assumed that this adds up to K.
It is easy to see that if there is an f -factor M ′ in G ′ , then its restriction to G is a feasible assignment M of the same weight so that the number of unmatched applicants and the number of matched posts in P 1 add up to K. Since f (q 1 i ) = 1 for every q 1 i added to a post p i ∈ P 1 , it is either the case that p i is closed in M or p d q 1 i ∈ M ′ .Regarding posts outside of P 1 , we need to show that the two edges incident to them are either both in G or neither of them are in G. Assume without loss of generality that p i q 1 i ∈ M ′ and p i q 2 i / ∈ M ′ for some

Bounded treewidth graphs
In this section, we investigate wmlq from the point of view of fixed-parameter tractability and analyze how efficiently the problem can be solved for instances with a bounded treewidth.
Fixed-parameter tractability.This field of complexity theory is motivated by the fact that in many applications of optimization problems certain input parameters stay small even for large instances.A problem, parameterized by a parameter k, is fixed-parameter tractable (FPT) if there is an algorithm solving it in time f (k) • φ(n), where f : R → R is a function, φ is a polynomial function, and n is the input size of the instance.Note that this definition not only requires that the problem can be solved in polynomial time for instances where k is bounded by a constant, but also that the dependence of the running time on k is separable from the part depending on the input size.On the other hand, if a problem is shown to be W[1]-hard, then the latter property can only be fulfilled if which would imply NP ⊆ DTIME(2 o(n) ).For more details on fixed-parameter algorithms see, e.g., [22].
Treewidth.In case of wmlq we focus on the parameter treewidth, which, on an intuitive level, describes the likeness of a graph to a tree.A tree decomposition of graph G consists of a tree whose nodes-also called bags-are subsets of V (G).These must satisfy the following three requirements.
1. Every vertex of G belongs to at least one bag of the tree.2. For every edge {a, p} ∈ E(G), there is a bag containing both a and p.
3. If a vertex in V (G) occurs in two bags of the tree, then it also occurs in all bags on the unique path connecting them.
The width of a tree decomposition with a set of bags B is max b∈B |b| − 1.The treewidth of a graph G, tw(G), is the smallest width among all tree decompositions of G.It is well known that a tree decomposition of smallest width can be found by a fixed-parameter algorithm when parameterized by tw(G) [4].
In the following, we show that wmlq is fixed-parameter tractable when parameterized simultaneously by the treewidth and u max , whereas it remains W [1]-hard when only parameterized by the treewidth.A similar study of the fixed-parameter tractability of the related extended global cardinality constraint problem (egcc) was conducted in [25].egcc corresponds to the special case of the D-matching problem where the graph is bipartite and on one side of the bipartition all vertices have the domain {1}.Differently from wmlq, egcc is a feasibility problem (note that the feasibility version of wmlq is trivial, as the empty assignment is always feasible).The authors of [25] provide a fixed-parameter algorithm for egcc when parameterized simultaneously by the treewidth of the graph and the maximum domain size, and they show that the problem is W[1]hard when only parameterized by the treewidth.These results mirror our results for wmlq, and indeed both our FPT-algorithm for wmlq and the one in [25] are extensions of the same classic dynamic program for the underlying maximum independent set problem.However, our hardness result uses a completely different reduction than the one in [25].The latter makes heavy use of the fact that the domains can be arbitrary sets, whereas in wmlq, we are confined to intervals.

Algorithm for bounded treewidth graphs
For every tree decomposition with a specific treewidth, a nice tree decomposition of the same treewidth can be found in linear time [15].A nice tree decomposition is characterized by an exclusive composition of the following four kinds of bags: Basic notation.For ease of exposition, we will define ℓ(a) := u(a) := 1 for all a ∈ A. Furthermore, throughout this section we will deal with vectors α ∈ Z U for some U ⊆ V .We define the notion of extension and restriction of such a vector α.For U ′ ⊆ U and α ∈ Z U define α| U ′ as the restriction of α to U ′ , i.e., α| Assignment vectors.For any bag b, let V b ⊆ V denote the set of vertices contained in the union of bags present in the subtree rooted at b.We will define graph 4 An assignment vector for bag b is a vector α ∈ X b := {0, . . ., u max } b .We say a partial assignment M for b agrees with an assignment vector α ∈ X b , if α(v) = |M ∩ δ(v)| for all v ∈ b.For every bag b and every α ∈ X b , let M b (α) be the set of partial assignments for b that agree with α and let denote the optimal value of any assignment that agrees with α for the graph G b (note that a value of −∞ implies that α cannot be attained).We further denote In the following, we will provide a series of lemmas that reveals how to effi- In particular, this implies that the optimal solution value of [forget] is finite and that M Thus let . We first observe that V b1 ∩ V b2 = b by Properties 2 and 3 of the tree decomposition and hence M 1 ∩ M 2 = ∅.This implies that Finally, we observe that after computing W r (α) and corresponding elements of M * r (α) for each α for the root bag r, an optimal assignment for G can be easily obtained.Lemma 5. Let (S * , α * ) be an optimal solution of Then S * ∪ M is an optimal solution to wmlq for any M ∈ M * r (α * ). Proof.
We conclude that M * is indeed a feasible solution to wmlq.
Now let M ′ ⊆ E be any solution to wmlq and let α ′ ∈ Z r be defined by α and thus M * is indeed an optimal solution to wmlq.
⊓ ⊔ Theorem 4. wmlq can be solved in time O(T + (u max ) 3 tw(G) |E|), where T is the time needed for computing a tree decomposition of G.In particular, wmlq can be solved in polynomial time when restricted to instances of bounded treewidth, and wmlq parameterized by max{tw(G), u max } is fixed-parameter tractable.
Proof.In order to solve a given wmlq instance, the algorithm starts by computing a nice tree decomposition of G.Note that T is of the same order for tree decompositions and nice tree decompositions.Using Lemmas 1 to 5, we can inductively compute a representative M ∈ M * b (α) for every bag b and every α ∈ X b , or deduce that M * b (α) = ∅.We first observe that |X b | = (u max ) tw(G) , thus only (u max ) tw(G) representatives have to be computed per bag.Furthermore, for each of the above lemmas, the necessary computations to derive an ).This is obvious for Lemmas 1 and 2. For Lemmas 3 to 5 we observe that the sets of feasible solutions for the corresponding optimization problems [forget], [join], and [root] have size at most 2 |b| • (u max + 1), (u max ) 2 tw(G) , and 2 |r| 2 • (u max ) tw(G) , respectively (note that without loss of generality we can assume |r| to be of constant size by introducing at most tw(G) additional forget bags).The theorem then follows from the fact that the number of bags is linear.
⊓ ⊔ While our algorithm runs in polynomial time for bounded treewidth, the degree of the polynomial depends on the treewidth and the algorithm only becomes a fixed-parameter algorithm when parameterizing by treewidth and u max simultaneously.We will now show by a reduction from Minimum Maximum Outdegree that this dependence is necessary under the assumption that FPT = W [1].

Problem 2 Minimum Maximum Outdegree
w(e) ≤ r for all v ∈ V , where δ + D (v) stands for the set of edges oriented so that their tail is v.
Proof.Given an instance (G = (V, E), w, r) of Minimum Maximum Outdegree, we construct an instance (G ′ = (A ∪ P, E ′ ), ℓ, u) of mlq as follows.For every vertex v ∈ V we introduce a post p v ∈ P and let ℓ(p v ) = 0 and u(p v ) = r.Furthermore, for every edge e = {v, v ′ } ∈ E, we introduce two posts p e,v and e,v ′ , z e , for which we introduce the edges {p v , a i e,v }, {a i e,v , p e,v }, {p v ′ , a i e,v ′ }, and {a i e,v ′ , p e,v ′ } for i ∈ {1, . . ., w(e)} as well as {p e,v , z e } and {z e , p e,v ′ }.
We show that the constructed instance has a solution serving all applicants if and only if the Minimum Maximum Outdegree instance has an orientation respecting the bound on the outdegree.
First assume there is an orientation D of G with maximum outdegree at most r.Then consider the assignment that assigns for every oriented edge (v, v ′ ) ∈ D the w(e) applicants a i e,v to p v and the w(e) + 1 applicants a i e,v ′ and z e to p e,v ′ .As the weighted outdegree of vertex v is at most r, every post p v gets assigned at most r = u(p v ) applicants.Now assume M is a feasible assignment of applicants to posts serving every applicant.In particular, for every edge e = {v, v ′ } ∈ E, applicant z e is assigned to either p e,v or p e,v ′ and exactly one of these two posts is open because the lower bound of w(e) + 1 can only be met if z e is assigned to the respective post.If p e,v is open then all w(e) applicants a i e,v ′ are assigned to p v ′ and none of the applicants a i e,v is assigned to p v , and vice versa if p e,v ′ is open.Consider the orientation obtained by orienting every edge e from v to v ′ if and only if p e,v is open.By the above observations, the weighted outdegree of vertex v corresponds to the number of applicants assigned to post p v , which is at most r.
Finally, note that G ′ can be constructed in time polynomial in the input size of the Minimum Maximum Outdegree instance as the weights are encoded in unary there.Furthermore, the treewidth of G ′ is at most max{tw(G), 3}.To see this, start with a tree decomposition of G and identify each vertex v ∈ V with the corresponding post p v .For every edge e = {v, v ′ } ∈ E, there is a bag B with p v , p ′ v ∈ B. We add the new bag B e = {p v , p ′ v , p e,v , p e,v ′ } as a child to B. We further add the bags B ze = {p e,v , p e,v ′ , z e }, B a i e,v = {p v , p e,v , a i e,v } and B a i e,v ′ = {p v ′ , p e,v ′ , a i e,v } for i ∈ {1, . . ., w(e)} as children to B e .Observe that the tree of bags generated by this construction is a tree decomposition.Furthermore, since we did not increase the size of any of the existing bags and added only bags of size at most 4 the treewidth of G ′ is at most max{tw(G), 3}.

Approximation
Having established the hardness of wmlq even for very restricted instances in Theorem 1, we turn our attention towards approximability.In this section, we give an approximation algorithm and corresponding inapproximability bounds expressed in terms of |A|, |P | and upper quotas in the graph.
The method, which is formally listed in Algorithm 1, is a simple greedy algorithm.We say a post p is admissible if it is not yet open and |Γ (p)| ≥ ℓ(p).The algorithm iteratively opens an admissible post maximizing the assignable weight, i.e., it finds a post p ′ ∈ P and a set A ′ of applicants in its neighborhood Γ (p ′ ) with ℓ(p ′ ) ≤ |A ′ | ≤ u(p ′ ) such that a∈A ′ w(a, p ′ ) is maximized among all such pairs.It then removes the assigned applicants from the graph (potentially rendering some posts inadmissible) and re-iterates until no admissible post is left.We point out a reduction from wmlq to the set packing problem here.The elements in the universe of the set packing problem would be A ∪ P .For each post p and for each subset S ⊂ Γ (p), such that l(p) ≤ |S| ≤ u(p), we create a set S ∪ {p} for the set packing instance.However, if the difference between upper and lower quota is not bounded, this would create an exponential sized input for the set packing problem and we could only employ an oracle based algorithm known for set packing problem to solve wmlq.The greedy algorithm known for set packing problem [5] can be made to work in a fashion similar to the algorithm presented above.
In the following we give a tight analysis of the algorithm, establishing approximation guarantees in terms of the number of posts |P |, number of applicants |A|, and the maximum upper quota u max := max p∈P u(p) over all posts.We also provide two examples that show that our analysis of the greedy algorithm is tight for each of the described approximation factors.We further show there that the approximation ratios given above for wmlq are almost tight from the point of view of complexity theory.Proof.Let p ′ 1 , . . ., p ′ ℓ be the posts chosen by the algorithm and let A ′ 1 , . . ., A ′ ℓ be the corresponding sets of applicants.Furthermore, consider an optimal solution of weight OPT, consisting of open posts p 1 , . . ., p k and the corresponding sets of applicants A 1 , . . ., A k assigned to those posts.
We first observe that the first two approximation ratios of |P | and |A| are already achieved by the initial selection of p ′ 1 and A ′ 1 chosen in the first round of the algorithm: For every i ∈ {1, . . ., k}, post p i is an admissible post in the first iteration of the algorithm.The first iteration's choice of the pair (p ′ 1 , A ′ 1 ) implies a∈A ′ 1 w(a, p ′ 1 ) ≥ a∈Ai w(a, p i ) ≥ w(a ′ , p i ) for every a ′ ∈ A i .As the optimal solution opens at most |P | posts and serves at most |A| applicants, we deduce that a∈A ′ 1 w(a, p ′ 1 ) ≥ min{|P |, |A|} • OPT.We now turn our attention to the remaining approximation guarantees, which are u max + 1 for wmlq and |A| + 1 for mlq.For every i ∈ {1, . . ., k}, let π(i) denote the first iteration of the algorithm such that A ′ π(i) ∩ A i = ∅ or p ′ π(i) = p i .This iteration is the one in which post p i is open or an applicant assigned to it in the optimal solution becomes assigned.Note that such an iteration exists, because p i is not admissible after the termination of the algorithm.Furthermore, observe that a∈A ′ π(i) w(a, p ′ π(i) ) ≥ a∈Ai w(a, p i ), because the pair (p i , A i ) was a valid choice for the algorithm in iteration π(i).Now for iteration j define P j := {i : π(i) = j} and observe that |P j | ≤ |A ′ j |+1, because P j can only contain one index i ′ with p i ′ = p ′ j , and all other i ∈ P j \ {i ′ } must have A i ∩ A ′ j = ∅ (where the sets A i are disjoint).We conclude that Note that |A ′ j | ≤ u max and therefore OPT ≤ (u max +1) ℓ j=1 a∈A ′ j w(a, p ′ j ), proving the third approximation guarantee.Now consider the case that w(a, p) = 1 for all p ∈ P and a ∈ A and define Note that in this case, the above inequalities imply OPT ≤ (|A ′ | + 1)|A ′ | ≤ ( √ A + 1)|A ′ |, proving the improved approximation guarantee for mlq.
We now turn to proving the bound on the running time.We will describe how to implement the search for the greedy choice of the pair (p ′ , A ′ ) in each iteration efficiently using a heap data structure.Initially, for every post p, we sort the applicants in its neighborhood by non-increasing order of w(a, p).This takes time at most O(|E| log |E|) as the total number of entries to sort is p∈P |Γ (p)| = |E|.We then introduce a heap containing all admissible posts, and associate with each post p the total weight of the first u(p) edges in its neighborhood list.Note that these entries can be easily kept up to date by simply replacing applicants assigned to other posts with the first not-yet-assigned entry in the neighborhood list (or removing the post if less than ℓ(p) applicants are available).As every edge in the graph can only trigger one such replacement, only O(|E|) updates can occur and each of these requires O(log |P |) time for reinserting the post at the proper place in the heap.Now, in each iteration of the algorithm, the optimal pair (p ′ , A ′ ) can be found by retrieving the maximum element from the heap.This Each applicant a i,j applies for posts i and additionally to post 0. For the greedy algorithm, opening post p 0 and assigning applicants a 1,1 , . . ., a k,k to it is a valid choice in its first iteration, after which no further posts are admissible.Thus, it only assigns k applicants in total.The optimal solution, however, can assign all k(k + 1) applicants by assigning applicants a i,1 , . . ., a i,k to p i for each i.Therefore, the greedy algorithm cannot achieve an approximation factor better than k + 1 on this family of instances, for which |P | = k + 1, |A| < k + 1, and u max = k.(b) To see that the approximation ratio of |A| is tight for wmlq consider the following instance with k posts p 1 , . . ., p k and k applicants a 1 , . . ., a k .Let ℓ(p i ) = 0 and u(p i ) = k for every i.Every applicant applies for every post, and w(a i , p i ) = 1 for every i but w(a i , p j ) = ε for every j = i for some arbitrarily small ε > 0. In its first iteration, the greedy algorithm might choose to open post p 1 and assign all applicants to it.This solution accumulates a weight of 1 + (k − 1)ε, while the weight of the optimal solution is k = |A|.Proof.Once again we use the maximum independent vertex set problem.Given an instance of mis on a graph G = (V, E) with |V | = n and |E| = m, we create a mlq instance with n posts p 1 , . . ., p n , post p i corresponding to vertex v i .We also introduce n 2 − m applicants as follows.Initially, we introduce n applicants a i,1 , a i,2 , ..., a i,n applying for each post p i .Then, for every edge {v i , v j } ∈ E, we merge the applicants a i,j and a j,i , obtaining a single applicant applying for both p i and p j .Furthermore, we set ℓ(p j ) = u(p j ) = n for every post.
Note that due to the choice of upper and lower bounds, any open post must be assigned to all the applicants in its neighborhood.Thus, a solution to the wmlq instance is feasible if and only if Γ (p i ) ∩ Γ (p j ) = ∅ for all open posts p i and p j with i = j, which is equivalent to v i and v j not being adjacent in G by construction of the instance.Therefore, the wmlq instance has a feasible solution opening k posts (and thus serving kn applicants) if and only if there is an independent set of size k in G.We conclude that OPT mlq = n • OPT MIS for the two instances under consideration.

Theorem 3 .
wmlq with u(p) ≤ 2 for every p ∈ P can be solved in O(nm + n 2 log n) time, where n = |V | and m = |E|.Proof.In the remainder of this section we assume that 1 ≤ ℓ(p) = u(p) ≤ 2 for every post p. Posts with ℓ(p) = u(p) = 2 can be transformed into posts with ℓ(p) = u(p) = 2 by giving them a dummy edge with zero weight, allowing us to pick these edges in order to make up for the raised lower quota.Let us denote the set of posts with ℓ(p) = u(p) = 1 by P 1 .
be an f -factor.So far we have shown that it is sufficient to test |A| + |P 1 | + 1 values for f (p d ), and collect the optimal assignments given by the maximum weight ffactors.Comparing the weight of these locally optimal solutions delivers a global optimum.A slight modification on the f -factor instance will allow us to construct only two instances.Similarly to the triangles attached to posts in P \P 1 , triangles are added to p d as well.The added vertices have f -value 1 and the added edges carry weight 0. The number of such triangles hanging on p d is ⌈ |A|+|P1| 2 ⌉.These triangles can take up all the f -value of p d if necessary, but choosing the edge not incident to p d they can also let p d to fill up its f -value with other edges.Since a triangle either takes up 0 or 2 of p d 's f -value, we need to separate the two different parity cases.Thus, to cover all the |A| + |P 1 | + 1 cases for possible values for f (p d ), once we set f (p d ) to |A| + |P 1 | + 1 and in the other instance f (p d ) = |A| + |P 1 |.⊓ ⊔

1 .
leaf bag: |b| = 1 and b has no child; 2. introduce bag: b has exactly one child b 1 , so that b 1 ⊂ b and |b \ b 1 | = 1; 3. forget bag: b has exactly one child b 1 , so that b ⊂ b 1 and |b 1 \ b| = 1; 4. join bag: b has exactly two children b 1 and b 2 , so that b = b 1 = b 2 .

Lemma 2 .
ciently obtain an element of M * b (α) for every α ∈ X b for a bag b (or showing W b (α) = −∞), assuming such representatives of each set M * b ′ (α) have already been computed for every child b ′ of b for all α ∈ X b ′ .Lemma 1.Let b be a leaf bag.Then M * b (0) = {∅} and M * b (α) = ∅ for any α ∈ X b \ {0}.Proof.This follows directly from the fact that E b = ∅ for all leaf bags and thus the only element in b cannot be assigned.⊓ ⊔ Let b be an introduce bag such that b ′ is the only child of b and b

Lemma 3 .
b by Properties 2 and 3 of the tree decomposition.This implies δ(v ′ ) ∩ E b = ∅ and hence the lemma.⊓ ⊔ Let b be a forget bag such that b ′ is the unique child of b and b =

Example 8
happens at most |P | times and requires O(log |P |) time in each step.⊓ ⊔ The following two examples show that our analysis of the greedy algorithm is tight for each of the described approximation factors.(a) Consider an instance of mlq with k + 1 posts p 0 , . . ., p k and k(k + 1) applicants a 0,1 , . . ., a 0,k , a 1,1 , . . ., a k,k .Let ℓ(p i ) = u(p i ) = k for i ∈ {0, . . ., k}.