arXiv:2611.06494cs.DSNov 2026

Manuscript Offprint

arXiv:2611.06494

A 2.81n2.81^n upper bound on the number of stable matchings

Ebrahim Ghorbani, Matthias Mnich

Abstract

We study the maximum number SM(n)\text{SM}(n) of stable matchings in an instance with nn men and nn women. Karlin, Oveis Gharan, and Weber (STOC 2018) proved the first single-exponential upper bound; their argument gives SM(n)≤217n\text{SM}(n) \leq 2^{17n} for sufficiently large nn. Palmer and Pálvölgyi (FOCS 2021) improved this bound to 3.55n+O(1)3.55^n + O(1).

We prove that SM(n)<2.81n\text{SM}(n) < 2.81^n. This brings the exponential base closer to 2.28, the base of the best known lower bound. More precisely, we bound the number of stable matchings in each instance in terms of each person's number of stable partners, where a stable partner is someone matched to that person in at least one stable matching. Our proof assigns each person a weight determined by this number and uses these weights to bound the number of stable matchings by induction.

*Hamburg University of Technology, Institute for Algorithms and Complexity, Hamburg, Germany. ebrahim.ghorbani@tuhh.de †Hamburg University of Technology, Institute for Algorithms and Complexity, Hamburg, Germany. matthias.mnich@tuhh.de

1 Introduction

A stable matching instance, or simply an instance, consists of n≥1n \geq 1 men and nn women, each having a strict ranking of all members of the other set. We call these rankings preferences. Equivalently, an instance is a complete bipartite graph with nn vertices in each class, where each vertex ranks the vertices in the opposite class. A matching is a bijection between the two sets. A man and a woman who are not matched with each other form a blocking pair if each prefers the other to their assigned partner. A matching is stable if it has no blocking pair.

Gale and Shapley [GS62] proved that every instance has a stable matching and gave an efficient algorithm to find one; see also the standard textbook by Gusfield and Irving [GI89, Chapter 1]. Since their introduction in 1962, stable matching models have found applications in college admissions [GS62] and the assignment of medical graduates to hospitals [Rot84]. Related matching models have also been used to organize kidney exchange [RSÜ04]. Galvin [Gal95] used the existence of stable matchings to resolve the Dinitz conjecture, which for many years was considered one of the widest-known open questions on list coloring.

Let s(I)s(I) be the number of stable matchings of an instance II, and let SM(n)\mathrm{SM}(n) be the maximum of s(I)s(I) over all instances with nn men and nn women. Determining SM(n)\mathrm{SM}(n) is a long-standing problem, posed by Knuth in 1976 [Knu76]. Besides its interest as a counting problem, bounds on SM(n)\mathrm{SM}(n) give bounds on the time needed to enumerate all stable matchings [Gus87]. Enumeration also solves optimization problems such as sex-equal stable marriage [Kat93] and balanced stable marriage [GRSZ21], by evaluating each stable matching and choosing the best one. Bounds on SM(n)\mathrm{SM}(n) also give run time bounds for algorithms for the popular roommates problem [Kav25].

Lower bounds. A simple construction gives SM(n)≥2⌊n/2⌋\mathrm{SM}(n) \geq 2^{\lfloor n/2 \rfloor}. Irving and Leather [IL86] improved this to Ω(2.28n)\Omega(2.28^n) when nn is a power of two. Thurber [Thu02] extended their construction to all nn, obtaining a lower bound of the form 2.28n/cln⁡n2.28^n/c^{\ln n} for an absolute constant c>1c > 1.

Upper bounds. The immediate upper bound is SM(n)≤n!\mathrm{SM}(n) \leq n!, since there are only n!n! matchings. The problem of improving this bound was already raised by Knuth [Knu76] in 1976. In their by-now classic book on stable matchings, Gusfield and Irving [GI89, Section 1.3.2] list 12 open problems around stable marriage; one of these problems is to determine SM(n)\mathrm{SM}(n). Stathopoulos [Sta11] proved that SM(n)=O(n!/cn)\mathrm{SM}(n) = O(n!/c^n) for some constant c>1c > 1. Drgas-Burchardt and Świtalski [DBŚ13] gave an upper bound of the form (3/4+O(1/n))n!(3/4 + O(1/n))n!. The question of discovering SM(n)\mathrm{SM}(n) was re-iterated in the fundamental book on algorithms of matching under preferences by Manlove [Man13, Section 2.2]. Despite considerable work on the problem, the first upper bound of the form cnc^n, for an absolute constant cc, was only obtained in 2018, by Karlin, Oveis Gharan, and Weber [KOGW18]. Their argument gives SM(n)≤217n\mathrm{SM}(n) \leq 2^{17n} for sufficiently large nn. The authors noted that their method does not give an exponential base close to the known lower bound of 2.28. Thus, they highlighted determining the precise asymptotic growth of SM(n)\mathrm{SM}(n) as a challenging open problem [KOGW18, Section 5]. Further, Cechlárová, Cseh, and Manlove [CCM19, Section 3.2.1] explicitly list improving the known bounds on SM(n)\mathrm{SM}(n) as an open problem in their survey. Palmer and Pálvölgyi [PP22] thereafter proved that SM(n)≤3.55n+O(1)\mathrm{SM}(n) \leq 3.55^n + O(1).

Main contribution. Our main result gives the best upper bound on the number of stable matchings. By showing SM(n)≤2.81n\mathrm{SM}(n) \leq 2.81^n, we bring the exponential base close to the known lower bound of 2.28. More precisely, we bound s(I)s(I) in terms of the numbers of stable partners of the individual men and women. A stable partner is a partner occurring in at least one stable matching. As any instance has a stable matching, each man and woman has between one and nn stable partners.

Theorem 1. There is a sequence h1,h2,…h_1, h_2, \ldots of positive numbers with ∑d=1∞hd<ln⁡2.81\sum_{d=1}^{\infty} h_d < \ln 2.81 such that the following holds. Let II be an instance with nn men and nn women, and let DvmD_v^m and DvwD_v^w be the numbers of stable partners of man vv and woman vv, respectively. Then

s(I)≤exp⁡(12∑v=1n(∑d=1Dvm−1hd+∑d=1Dvw−1hd)) .s(I)\leq \exp\left(\frac{1}{2}\sum_{v=1}^{n}\left(\sum_{d=1}^{D_{v}^{m}-1}h_{d}+\sum_{d=1}^{D_{v}^{w}-1}h_{d}\right)\right)\ .

In particular,

SM(n)≤exp⁡(n∑d=1n−1hd)<2.81n .\mathrm{SM}(n)\leq \exp\left(n\sum_{d=1}^{n-1}h_{d}\right)<2.81^{n}\ .

Consequences of Theorem 1. Beyond an object worthwhile being studied by itself, our improved upper bound on SM(n) has combinatorial and algorithmic consequences.

Combinatorially, first, the bound of Theorem 1 transfers to an upper bound on the number of stable assignments in the stable roommates problem, in which the graph of an instance I need not be bipartite as in the stable matching problem. Each person then ranks the other n−1n-1 persons. As before, persons are matched in pairs, and such matching is stable if no two unmatched persons prefer each other over their current match. As observed by Karlin, Oveis Gharan and Weber [KOGW18], a standard reduction [DM10] can map II to a stable matching instance I′I' with nn men and nn women, such that the stable roommate assignments are a subset of the stable matchings of I′I'. We thus get:

Corollary 1.1. Any stable roommates instance with nn persons and strict preferences has at most 2.81n2.81^n stable matchings.

Second, from s(I)s(I) we can derive an upper bound on the number pop(II) of so-called “popular matchings” of an instance II. The notion of popular matchings dates back to Gärdenfors [Gär75] in 1975. A matching μ\mu is popular if, for every other matching μ′\mu', one has ∣{v:v prefers μ to μ′}∣≥∣{v:v prefers μ′ to μ′}∣|\{v:v \text{ prefers } \mu \text{ to } \mu'\}| \geq |\{v:v \text{ prefers } \mu' \text{ to } \mu'\}|. Any stable matching is popular, so pop(II) ≥s(I)\geq s(I). Conversely, popular matchings of II with men set MM and woman set WW can be mapped to stable matchings of an instance I′I', via a construction by Cseh and Kavitha [CK18]. Instance I′I' has 2n2n men M′={m0,m1:m∈M}M' = \{m_0, m_1 : m \in M\} and 2n2n women W′=W∪{d(m):m∈M}W' = W \cup \{d(m) : m \in M\}. Each woman’s ranks all acceptable m1m_1 men first, in her original order, followed by the m0m_0 men in the same order. For each m0m_0 its preference list places first the original women in mm’s list, followed by d(m)d(m); for m1m_1 start with d(m)d(m) and then the women in mm’s list; for d(m)d(m) put m0m_0 before m1m_1. There is a projection PP from the stable matchings of I′I' to the dominant matchings of II, obtained by deleting the dummy edges and replacing (mi,w)(m_i, w) by (m,w)(m, w). Here, a popular matching is dominant if it is more popular than any (not necessarily popular) matching of larger cardinality; let dom(I)\text{dom}(I) be the number of dominant matchings. Cseh and Kavitha [CK18] show PP to be surjective, so every dominant matching of II is the projection of some stable matching of I′I'. So pop(I)=dom(I)≤s(I′)\text{pop}(I) = \text{dom}(I) \leq s(I'). Every stable matching μ′\mu' of I′I' projects to a popular matching P(μ′)P(\mu') of the complete instance; the projection is therefore perfect. And every dummy woman d(m)d(m) is matched in any stable matching of I′I', otherwise (m1,d(m))(m_1, d(m)) would block, since d(m)d(m) is m1m_1’s top choice. Thus every stable matching of I′I' is perfect. We can complete the preference lists of I′I' by putting all previously unacceptable partners below every original acceptable partner, in arbitrary strict order. For the resulting instance I~′\tilde{I}', every stable matching of I′I' remains stable in I~′\tilde{I}': it is perfect and each new edge is worse at both endpoints than their current acceptable partners. Hence, s(I′)≤s(I~′)≤SM(2n)s(I') \leq s(\tilde{I}') \leq \text{SM}(2n). So pop(I)≤SM(2n)\text{pop}(I) \leq \text{SM}(2n). Defining PM(n)\text{PM}(n) as the maximum of pop(I)\text{pop}(I) over all instances with nn men and nn women shows PM(n)≤SM(2n)\text{PM}(n) \leq \text{SM}(2n), so Theorem 1 gives:

Corollary 1.2. Any popular matching instance with nn men and nn women has at most PM(n)≤7.90n\mathrm{PM}(n) \leq 7.90^n popular matchings.

Algorithmically, our bound on SM(n)\mathrm{SM}(n) reduces the run time O(SM(n)+2SM(n))O(\mathrm{SM}(n) + 2\sqrt{\mathrm{SM}(n)}) of Kavitha's algorithm [Kav25] for solving the popular roommates problem with strict preferences, from O(7.32n)O(7.32^n) to O(6.17n)O(6.17^n). Further, for many practical applications of stable matchings the assumption of having complete preference lists for each man and each woman, is too strong, say for instance because of lack of information about all persons of the opposite sex. Other applications demand relaxations on the structure of preference lists, which lead to relaxations of the notion of stability. Among those, Miyazaki and Tamaki [MT26] consider the MAX-SMTI problem in which preference lists can be incomplete, and need not be strict but can contain ties. A partial matching μ\mu is then a bijection between a subset of men and women. In their work, such a partial matching μ\mu is called weakly stable if there is no edge (m,w)(m,w) in the bipartite men-women graph, such that either both m,wm,w are unmatched in μ\mu (and thus (m,w)(m,w) can be added to μ\mu to give a larger matching), or both m,wm,w are matched in μ\mu but each prefers the other to their assigned partner. The objective in MAX-SMTI is to compute a weakly stable matching of maximum cardinality. They give an algorithm [MT26] to solve MAX-SMTI in time O∗((1+4⋅SM(n))2n)O^*\left(\left(1 + \sqrt{4 \cdot \mathrm{SM}(n)}\right)^{2n}\right). Using our bound on SM(n)\mathrm{SM}(n) from Theorem 1 within their algorithm, we thus improve its run time from O(22.74n)O(22.74^n) as follows:

Corollary 1.3. For any instance with nn men and nn women, whose preference lists may be incomplete or contain ties, a maximum-cardinality weakly stable matching can be found in time O(18.95n)O(18.95^n).