Hall’s marriage theorem has numerous applications in mathematics, computer-science and economics. Given a bipartite graph with , Hall’s theorem gives a necessary and sufficient condition for the existence of a perfect matching, in which all vertices in both sides are matched. In case , the same conditions are necessary and sufficient for the existence of an -saturated matching, in which all vertices in are matched. Since a saturated matching does not always exist, the following relaxation may be useful.
In a bipartite graph , an -bipartite-envy-free matching is a matching between a subset and a subset such that every unmatched vertex in is not adjacent to any matched vertex in , i.e.:
For brevity, instead of “-bipartite-envy-free matching” we just say “bipartite envy-free matching” or BEFM. The term “envy-free” is inspired by thinking of the vertices of as people and the vertices of as items, where an edge between a person and an item means that the person likes the item. In a BEFM, an unmatched person does not envy any matched person , because he does not like any matched item anyway.
Any -saturated matching is also a BEFM, since all members of are matched. But while the former may not exist, the latter always does: the empty matching is vacuously envy-free.
In some graphs, only the empty matching is envy-free. For example, here:
in any non-empty matching, some envies the other one. This raises the question: when does a non-empty BEFM exist?
Our first result is a simple sufficient condition. For every subset , denote by its neighborhood in , i.e.: .
In a bipartite graph , if , then there exists a non-empty bipartite-envy-free matching, and it can be found in polynomial time.
The sufficient condition is a relaxation of Hall’s condition, which requires to hold for any subset . A short proof of existence was already presented by Luria (2013). A constructive proof, that implies a polynomial-time algorithm for finding a BEFM when the condition holds, is presented in Section 2
Leveraging the sufficient condition of Theorem 2, our second result provides a different condition, which is both sufficient and necessary. It is based on the existence of a small-neighborhood subset (SNS).
In a bipartite graph , a small-neighborhood subset is a subset for which .
Given a bipartite graph , it can be decided in polynomial time whether contains a non-empty small-neighborhood subset, and if so, find such subset.
For finding a BEFM, we can remove, without loss of generality, all vertices that are disconnected (have a degree of 0), since such vertices cannot participate in any matching.
Let be a bipartite graph with no disconnected vertices. Then contains a non-empty bipartite envy-free matching, if and only if contains a non-empty small-neighborhood subset.
Given a SNS, it is possible to find a BEFM in polynomial time.
Together, the theorems provide an efficient algorithm that finds a non-empty BEFM if-and-only-if it exists. The proofs and related algorithms are presented in Section 3.
BEFM is not entirely a new invention: we have seen similar ideas in previous papers. However, they were “hidden” inside much more complex algorithms. Our goal in presenting a stand-alone algorithm for BEFM is to make the concept more visible and easily usable as a subroutine in future algorithms. As an illustration, some old and new algorithms for fair division using BEFM as a subroutine are presented in Section 4.
2 Sufficient Condition
This section presents an algorithmic proof to Theorem 2.
The main idea of the algorithm is as follows. First, try to find a saturated matching in the graph. If it exists, return it. Otherwise, by Hall’s theorem, there exists a Hall violator — a vertex set that violates Hall’s condition.111 The term “Hall violator” is from Barman et al. (2018), Appendix B. Use this Hall-violator to construct a BEFM.
Algorithm 1 is a sub-routine that finds either a saturated matching or a Hall violator. Step 3 uses Koenig’s theorem for finding a minimum vertex cover in a bipartite graph. Koenig’s theorem has a constructive proof showing how to efficiently construct a minimum vertex cover from a maximum matching (Bondy and Murty, 1976)
[Lemma 5.3 in page 74]. Alternatively, a linear program can be used to simultaneously find both a maximum matching and a minimum vertex cover of the same size(Matousek and Gärtner, 2007)[pages 144-147].
Algorithm 2 is the main routine that finds a BEFM.
INPUT: a bipartite graph that satisfies .
OUTPUT: a non-empty bipartite-envy-free matching.
Step 1. Run Algorithm 1. If it returns an -saturated matching, return it.
Otherwise, it returns a Hall-violator . Continue to step 2.
Step 2. Define and and and:
A schematic illustration of these definitions is shown below, where an arrow denotes possible edges; note that there are no edges from to :
By the algorithm assumptions, must be a strict subset of , since while . Hence is not empty.
Step 3. Run Algorithm 1 on the sub-graph . If it returns an -saturated matching, then this matching is envy-free in too, since any vertex of is not adjacent to any vertex of . Return it and finish.
Step 4. Otherwise, Algorithm 1 returns a Hall-violator — a non-empty subset for which . Since also , the union also satisfies the same condition, i.e., . Replace by and go back to step 2.
Most steps in Algorithm 2 are straightforward. The only thing that needs proof is that the algorithm finishes. Indeed, whenever step 3 does not return an -saturated matching, strictly increases since we add to it the non-empty set . Therefore, eventually step 3 must return an -saturated matching for some non-empty . This matching is the required BEFM.
3 Full Characterization
Recall that a small-neighborhood subset (SNS) is a subset for which . We prove Theorem 4 by providing an algorithm that finds a non-empty SNS iff it exists. The algorithm is based on the following linear program.
In this program, there is a variable for each node in , and a variable for each node in . Let be the subset of defined by , and the subset of defined by .
The constraints ensure that, if some vertex is in , then all its neighbors are in , so . The objective is to maximize the difference . If the value of the optimal solution is at least , then , so is the required SNS. On the other hand, if the optimal solution is negative, there is no SNS.
In general, integer linear programs are hard to solve. But in LP (1), the matrix of constraints is totally unimodular, since it satisfies the Hoffman-Gale conditions: every entry in the matrix is one of ; every row in the matrix contains at most two nonzero entries; and if there are two nonzero entries, they have opposite signs. Therefore, we can solve LP (1) without the integrality constraints, and we are guaranteed to get an integral solution that can be converted to a SNS.
The only problem is that the LP (1) does not guarantee that is non-empty. In fact, setting all variables to gives a feasible solution in which the objective value is .222We could add a constraint such as , but this would invalidate the argument of total unimodularity This issue can be handled by solving different linear programs: for each vertex , solve the LP with the constraint replaced by the constraint . If for some the objective is at least , we have found a non-empty as required. Otherwise, such does not exist. The procedure is summarized in Algorithm 3.
(a) The definition of a SNS is similar but not identical to the definition of a Hall-violator, which is . Therefore Algorithm 1 cannot be used to find a SNS.
(b) In the bipartite expansion problem, we are given an integer and have to find a subset with such that is as small as possible. The SNS problem could easily be solved by solving bipartite expansion for all . Unfortunately, the bipartite expansion problem is NP-hard and hard to approximate (Khot and Saket, 2016; Chlamtáč et al., 2017). However, the SNS problem is easier since we are not trying to minimize . As shown above, it can be solved efficiently.
We now prove Theorem 5, which we restate shortly below:
Let be a bipartite graph with no disconnected vertices.
contains a non-empty BEFM iff contains a non-empty SNS.
: Suppose contains a non-empty BEFM. Denote the matched subsets by and . By definition of a matching, . By definition of envy-freeness, , since no vertex in is a neighbor of any vertex in . By definition of a matching again, . Hence: , so is a non-empty SNS.
: Suppose contains a non-empty subset with . Define . Since the graph has no disconnected vertices, is non-empty. Define as the subset of containing only the edges between and . In the sub-graph , , so . Applying Theorem 2 to the sub-graph implies that contains a non-empty BEFM. This matching is envy-free even in the original graph , since by definition of , no vertex in is adjacent to any vertex in . ∎
Based on all the above theorems, Algorithm 4 finds a non-empty BEFM if-and-only-if it exists.
4 Related Work and Applications
This section surveys two classes of related works: works that present similar concepts but do not give it a name, and works that present different concepts with a similar name.
4.1 BEFM in fair cake-cutting
The earliest similar concept that we are aware of was presented in a lemma of Kuhn (1967, page 31). He presents the lemma in matrix notation. In graph terminology, his lemma says that a BEFM exists whenever and there is a vertex for whom . This is a special case of Theorem 2. Kuhn uses this lemma to extend a method of Steinhaus (1948) for fair cake-cutting.
In a fair cake-cutting problem, there is a heterogeneous and continuous resource (“cake”), usually thought of as the real interval . There are agents and each agent has a nonatomic value-measure on . A proportional division of is a partition into pairwise-disjoint pieces, , such that . There are various algorithms for proportional cake-cutting. One of them is now called the lone divider method. Steinhaus presented it for agents. Kuhn (1967) extended it to any number of agents. The cases and are described in detail by Brams and Taylor (1996, pages 31-35), and the general case is described in detail by Robertson and Webb (1998, pages 83-87). To demonstrate the usefulness of BEFM, we use it to present the lone divider method in a simpler way; see Algorithm 5.
For standard cake-cutting, there are many other algorithms besides Lone Divider. However, the present author has found BEFM useful in solving a variant of it called archipelago division. In this problem, is made of disconnected islands, and we need to give each agent a subset of that overlaps at most islands, so that an agent does not have to jump between too many different islands to get from one side of his plot to the other side. The case is easy to solve, but the case is more challenging. It can be solved optimally using BEFM as a subroutine; see Segal-Halevi (2018).
4.2 BEFM in fair item allocation
In Procaccia and Wang (2014, subsection 3.1), we found another BEFM-like concept, hiding inside proofs of lemmas related to fair allocation of indivisible goods.333 This paper has a journal version (Kurokawa et al., 2018) where these lemmas do not appear. This problem involves a finite set of goods. There are agents. Each agent has a value measure on subsets of .
Since the goods are indivisible, a proportional allocation of the goods among the agents may not exist. Hence, the following relaxation is used. For every agent and integers , define the -out-of- maximin-share of from as:
where the maximum is over all partitions of into subsets, and the minimum is over all unions of subsets from the partition. is the largest value that agent can get by dividing into piles and getting the worst piles. Obviously , with equality holding iff can be partitioned into subsets with the same value. Thus, can be thought of informally as “rounded down to the nearest good”.
Budish (2011) asked whether there always exists a partition of in which the value of each agent is at least . For , the answer is yes — such allocation can easily be found by divide-and-choose: Alice divides using her 1-out-of-2 MMS partition, Bob chooses the pile he prefers and Alice receives the other pile.444 To find her 1-out-of-2 maximin partition, Alice has to solve the NP-hard problem Partition. However, this is not the problem of the division manager. In fact, if Alice is computationally bounded and provides a sub-optimal partition, this makes life even easier for the division manager — he can give Alice a smaller value and she cannot complain.
For , Procaccia and Wang (2014); Kurokawa et al. (2018) prove that such allocation might not exist. They present a multiplicative approximation algorithm, by which each agent receives a bundle whose value is a certain fraction . Their approximation fraction is for , and approaches when .
They then consider an ordinal approximation — a partition in which the value of each agent is at least . They say that
“We have designed an algorithm that achieves this guarantee for the case of three players (it is already nontrivial). Proving or disproving the existence of such allocations for a general number of players remains an open problem.”
They do not present the algorithm for .555 Perhaps they wanted to write it in the margin but the margin was too narrow ☺ Using BEFM as a subroutine, we could design such an algorithm. It is presented in Algorithm 6. It is very similar to the Lone Divider method for cake-cutting.
Only Step 4 requires explanation. By envy-freeness, each remaining agent values each allocated pile as less than . When , there is one remaining agent and he values the remaining goods as at least .
For , we need to show that for each remaining agent, the 1-out-of-2 maximin share of the remaining goods is at least . So we need to show that each agent can partition the remaining goods into two piles with value at least . Let be a remaining agent. Let be his 1-out-of-4 maximin partition of . For , let be the subset of that Alice took in Step 3, and the remaining subset. Now . Similarly, . Hence, the 2-partition shows that the 1-out-of-2 MMS of is at least . The same is true for both agents. Hence, divide-and-choose on the remaining goods guarantees each agent at least .
Algorithm 6 can be modified to give various other fairness guarantees. For example, it can guarantee to each agent at least his 2-out-of-7 maximin share, i.e., . In some cases, this guarantee may be better than the 1-out-of-4 MMS. For example, if contains 7 items and agent values all of them as 1, then while . Alternatively, Algorithm 6 can guarantee a multiplicative approximation, giving each agent a value of at least . It can even make different guarantees to different agents. The only required change is that in step 2, in the bipartite graph, each agent should be adjacent to pile iff is above the fairness threshold chosen by agent (e.g. or ). For each fairness criterion, we have to prove that, in step 4, if a subset whose value is below the threshold was taken, then the remaining goods can be partitioned into two subsets both of which are above the threshold. The proof for each criterion is similar to the one for and we omit it.
4.3 EFM in markets
The term envy-free matching (EFM) is used, in a somewhat more specific meaning, in the context of markets, both with and without money.
In a market with money, there are several buyers and several goods, and each good may have a price. Given a price-vector, an EFM is an allocation of bundles to agents in which each agent weakly prefers his bundle over all other bundles (given their respective prices). An EFM is a relaxation of aWalrasian equilibrium (WEQ). A WEQ is an EFM in which every item with a positive price is allocated to some agent. In a WEQ, the seller’s revenue might be low. This motivates its relaxation to EFM, in which the seller may set reserve-prices in order to increase his expected revenue. See, for example, Guruswami et al. (2005); Alaei et al. (2012).
In a market without money, there are several people who should be assigned to positions. For example, several doctors have to be matched for residency in hospitals. Each doctor has a preference-relation on hospitals (ranking the hospitals from best to worst), and each hospital has a preference relation on doctors. Each doctor can work in at most one hospital, and each hospital can employ at most a fixed number of doctors (called the capacity of the hospital). A matching has justified envy if there is a doctor and a hospital , such that prefers over his current employer, and prefers over one of its current employees. An EFM is a matching with no justified envy. An EFM is a relaxation of a stable matching (SM). A SM is an EFM which is also non-wasteful — there is no doctor and a hospital , such that prefers over his current employer and has some vacant positions (Wu and Roth, 2018). When the hospitals have, in addition to upper quotas (capacities), also lower quotas, a SM might not exist. This motivates its relaxation to EFM, which always exists and can be found efficiently (Yokoi, 2017).
We use the term bipartite envy-free matching to differentiate it from the above market-related concepts and emphasize that it is defined for an arbitrary bipartite graph.
5 Future Work
In this paper we focused on finding a non-empty BEFM. For the fair division algorithms presented in Section 4, this is sufficient. However, it may be more useful to find a maximum-cardinality BEFM. The similarity to the bipartite-expansion problem hints that finding a maximum BEFM might be hard, but its exact hardness is open.
Another direction for future research is generalizing bipartite envy-free matchings to envy-free matchings in general graphs.
This paper benefited a lot from answers by Zur Luria, Yuval Filmus and Elad Horev.
- Alaei et al. (2012) Alaei, S., Jain, K., and Malekian, A. (2012). Competitive Equilibria in Two Sided Matching Markets with Non-transferable Utilities. arXiv preprint 1006.4696.
- Babaioff et al. (2017) Babaioff, M., Nisan, N., and Talgam-Cohen, I. (2017). Competitive Equilibria with Indivisible Goods and Generic Budgets. arXiv preprint 1703.08150.
- Barman and Krishna Murthy (2017) Barman, S. and Krishna Murthy, S. K. (2017). Approximation algorithms for maximin fair division. In Proceedings of the 2017 ACM Conference on Economics and Computation, pages 647–664. ACM.
- Barman et al. (2018) Barman, S., Krishnamurthy, S. K., and Vaish, R. (2018). Finding fair and efficient allocations. In Proceedings of the 2018 ACM Conference on Economics and Computation, pages 557–574. ACM. arXiv preprint 1707.04731.
- Bondy and Murty (1976) Bondy, J. A. and Murty, U. S. R. (1976). Graph theory with applications, volume 290. North Holland.
- Brams and Taylor (1996) Brams, S. J. and Taylor, A. D. (1996). Fair Division: From Cake Cutting to Dispute Resolution. Cambridge University Press, Cambridge UK.
- Budish (2011) Budish, E. (2011). The Combinatorial Assignment Problem: Approximate Competitive Equilibrium from Equal Incomes. Journal of Political Economy, 119(6):1061–1103.
- Chlamtáč et al. (2017) Chlamtáč, E., Dinitz, M., and Makarychev, Y. (2017). Minimizing the union: Tight approximations for small set bipartite vertex expansion. In Proceedings of the Twenty-Eighth Annual ACM-SIAM Symposium on Discrete Algorithms, pages 881–899. SIAM.
- Ghodsi et al. (2018) Ghodsi, M., HajiAghayi, M., Seddighin, M., Seddighin, S., and Yami, H. (2018). Fair allocation of indivisible goods: Improvements and generalizations. In Proceedings of the 2018 ACM Conference on Economics and Computation, pages 539–556. ACM. arXiv preprint 1704.00222.
- Guruswami et al. (2005) Guruswami, V., Hartline, J. D., Karlin, A. R., Kempe, D., Kenyon, C., and McSherry, F. (2005). On Profit-maximizing Envy-free Pricing. In Proceedings of the Sixteenth Annual ACM-SIAM Symposium on Discrete Algorithms, SODA ’05, pages 1164–1173, Philadelphia, PA, USA. Society for Industrial and Applied Mathematics.
- Khot and Saket (2016) Khot, S. and Saket, R. (2016). Hardness of bipartite expansion. In LIPIcs-Leibniz International Proceedings in Informatics, volume 57. Schloss Dagstuhl-Leibniz-Zentrum fuer Informatik.
- Kuhn (1967) Kuhn, H. W. (1967). On games of fair division, pages 29–37. Princeton University Press.
- Kurokawa et al. (2018) Kurokawa, D., Procaccia, A. D., and Wang, J. (2018). Fair enough: Guaranteeing approximate maximin shares. Journal of the ACM (JACM), 65(2):8.
- Luria (2013) Luria, Z. (2013). Envy-free matching. Mathematics Stack Exchange. URL: https://math.stackexchange.com/q/621306/29780 (version: 2013-12-29).
- Matousek and Gärtner (2007) Matousek, J. and Gärtner, B. (2007). Understanding and using linear programming. Springer Science & Business Media.
- Procaccia and Wang (2014) Procaccia, A. D. and Wang, J. (2014). Fair Enough: Guaranteeing Approximate Maximin Shares. In Proc. EC-14, pages 675–692, New York, NY, USA. ACM.
- Robertson and Webb (1998) Robertson, J. M. and Webb, W. A. (1998). Cake-Cutting Algorithms: Be Fair if You Can. A K Peters/CRC Press, first edition.
- Segal-Halevi (2018) Segal-Halevi, E. (2018). Fair division of an archipelago. arXiv preprint 1812.08150.
- Steinhaus (1948) Steinhaus, H. (1948). The problem of fair division. Econometrica, 16(1):101–104.
- Wu and Roth (2018) Wu, Q. and Roth, A. E. (2018). The lattice of envy-free matchings. Games and Economic Behavior, 109:201–211.
- Yokoi (2017) Yokoi, Y. (2017). Envy-free matchings with lower quotas. arXiv preprint 1704.04888.