Approximate counting and entropy of perfect matchings

A fast coin-flipping method estimates the number of perfect matchings in any network, to any chosen accuracy.

2 papers September 23, 2026 Explained by AI

A perfect matching pairs up every point of a network using allowed links. Counting them exactly is believed to be hard, and fast estimates were known only for two-sided networks. This paper proves a fast coin-flipping method that estimates the count in any network, within any chosen error. A companion paper proves a 2018 conjecture. It bounds how spread out a random perfect matching can be, given each link's probability.

First step
1989
Mark Jerrum and Alistair Sinclair, who raised the general-graph question
Significance
Major
If the proofs hold, they answer a counting question open since 1989 and a 2018 entropy conjecture.
Trust
Formal proof listed
Field
Theoretical computer science
2 papers

The explanation

Six people need to pair off for a dance. If anyone may dance with anyone, there are 15 ways. The first person has 5 choices of partner, the next unpaired person has 3, and the last two have 1. With 20 people the count is 654,729,075. With 100 people it is about 2.7 × 10^78. Each complete pairing is called a perfect matching. It pairs every point of a network, using only allowed pairs.

Real networks allow only some pairs, and then no simple formula exists. Finding one perfect matching is easy. Jack Edmonds gave a fast method for that in 1965. Counting them all exactly is another matter. In 1979, Leslie Valiant showed that exact counting is #P-complete, even for bipartite networks. Bipartite means the points form two sides and every allowed pair crosses between them. The label #P-complete means as hard as a broad class of counting problems with no known fast method.

So researchers aimed for good estimates instead. An FPRAS (fully polynomial randomized approximation scheme) is a method that flips coins. You pick an error, such as 1 percent, and a failure chance, such as one in a million. The method must land within that error, except with at most that failure chance. Its running time may grow only like a fixed power of the input size and of 1 over the error. The failure chance costs even less: only its logarithm enters.

In 1989, Mark Jerrum and Alistair Sinclair gave an FPRAS for counting all matchings, of every size. Their method for perfect matchings needed a promise. Near-perfect matchings, which leave two points unpaired, could not outnumber perfect ones too badly. In 2004, Jerrum, Sinclair and Eric Vigoda removed that promise for bipartite networks. General networks stayed open. Jerrum and Sinclair had raised that question explicitly in 1989.

The one obstacle was that the bipartite method does not stretch. These methods take a long random walk through possible matchings, then read off statistics. In 2018, Daniel Štefankovič, Vigoda and John Wilmes built networks that defeat every walk of the 2004 type. On them, the walk either almost never visits a perfect matching or takes exponentially long to spread out. The new paper walks through a different space. It keeps several perfect matchings at once, on a larger network with colored links. A move swaps a closed loop of links between two of them. The count starts from the network where every pair is allowed, which is easy to count. Then the missing links are weakened step by step, and the changes are multiplied together.

The first paper proves that this gives an FPRAS for every finite network without repeated links or weights. If no perfect matching exists, it returns zero every time. The time bound holds on every run, even unlucky ones. It is a guarantee about growth, not a practical program. The paper says its constants favour clear estimates over speed.

The companion paper studies spread. Take four people, with all 6 pairs allowed. There are 3 perfect matchings. Ask each pair to appear with probability 1/3. Only one random choice fits: each matching with chance 1/3. Its entropy, a measure of how spread out a random choice is, equals ln 3, about 1.10. The paper compares this with two sums built from the pair probabilities alone. Here they are F ≈ 2.20 and B ≈ 1.62. With m = 2 pairs, its theorem says F − (2 − 2/m)·B ≤ entropy ≤ F. That reads 0.58 ≤ 1.10 ≤ 2.20. Turned back into counts, the bounds say between about 1.78 and 9 matchings. The true count is 3.

The upper bound was already known, from Shearer's entropy inequality. The lower bound is the new part. For bipartite networks, work of Schrijver and Gurvits implies the stronger F − B. The paper shows this fails in general, with an eight-point example. In 2018, Nima Anari, Shayan Oveis Gharan and Cynthia Vinzant asked a related question for their counting framework. Does their entropy objective exceed the log of the count by only a linear amount? The paper claims yes: the excess is at most 3m − 2. The bound holds at every feasible set of probabilities, including edge cases where some are 0 or 1. It also proves a fast method that never flips coins. That method is only accurate within a factor of 512^n for n points. It also claims a sharp count about the shape of the set of feasible probabilities.

How sure is this? A computer proof checker called Lean has checked formal versions of the main statements. These are the FPRAS, the entropy bounds, and the 512^n method. Each is matched against a fixed reference statement by a tool called Comparator. The paper's sharp shape count is outside that check. No specialist review of either paper has been published.

What it doesn't show. This does not give a practical program: the running time is a polynomial guarantee with large constants.

Where it came from

This result comes from an unreleased OpenAI model, published in the openai/math release on 6 October 2026.

Hype check

Major if the proofs hold. Lean formalizations are listed for the counting method and the entropy bounds. No specialist review is published. The method is a theoretical guarantee, not a fast program.

Words used

Perfect matching
A way to pair up every point of a network, using only allowed links.
Bipartite network
A network whose points form two sides, with every link crossing between them.
#P-complete
As hard as a broad class of counting problems that no one knows how to solve fast.
FPRAS
A coin-flipping method that estimates a count within any chosen error, with high confidence, in time growing like a fixed power.
Random walk (Markov chain)
A process that moves between states by random local changes, used to sample objects.
Entropy
A measure of how spread out a random choice is; for k equally likely options it is ln k.
Comparator
A tool that checks a Lean proof proves exactly a fixed reference statement, using only standard axioms.

The original papers (2)

All quoted lines (11)

  1. The sampler below uses a different state space: a product of perfect-matching spaces on an enlarged colored graph, with exchanges of alternating cycles between coordinates.
    A Fully Polynomial Randomized Approximation Scheme for Perfect Matchings in General Graphs Back to text
  2. The counting algorithm starts with the complete graph, whose perfect matchings are easy to count, and gradually suppresses the nonedges of GG by decreasing their positive activities.
    A Fully Polynomial Randomized Approximation Scheme for Perfect Matchings in General Graphs Back to text
  3. If Z(G)=0Z(G)=0, the output is zero with certainty. The worst-case bit running time is polynomial in the input encoding length, ε−1\eps^{-1}, and log⁡δ−1\log\delta^{-1}.
    A Fully Polynomial Randomized Approximation Scheme for Perfect Matchings in General Graphs Back to text
  4. The main theorem retains the finite simple undirected input model; it does not assert a counting algorithm for compressed edge multiplicities or for singleton-covering loops.
    A Fully Polynomial Randomized Approximation Scheme for Perfect Matchings in General Graphs Back to text
  5. We prove the following theorem, including a bound on the time of every execution.
    A Fully Polynomial Randomized Approximation Scheme for Perfect Matchings in General Graphs Back to text
  6. Every polynomial has an absolute degree; the constants are chosen for transparent estimates rather than practical efficiency.
    A Fully Polynomial Randomized Approximation Scheme for Perfect Matchings in General Graphs Back to text
  7. The upper bound H≤FH\le F is a direct instance of Shearer's entropy inequality: each edge occurs in two vertex stars, and a matching chooses exactly one edge at each vertex.
    Entropy and Face Dimension of the Perfect-Matching Polytope Back to text
  8. Our contribution to... is its lower comparison.
    Entropy and Face Dimension of the Perfect-Matching Polytope Back to text
  9. In Section … we give a simple eight-vertex nonbipartite graph with a feasible mean for which H<F−BH<F-B.
    Entropy and Face Dimension of the Perfect-Matching Polytope Back to text
  10. This bound holds throughout the polytope, including its boundary.
    Entropy and Face Dimension of the Perfect-Matching Polytope Back to text
  11. The degree of this polynomial is large; the theorem gives a complexity guarantee, not a practical running-time benchmark.
    Entropy and Face Dimension of the Perfect-Matching Polytope Back to text

Other sources

  1. L. G. Valiant, “The complexity of computing the permanent”, Theoretical Computer Science 8(2) (1979), 189–201
  2. J. Edmonds, “Paths, trees, and flowers”, Canadian Journal of Mathematics 17 (1965), 449–467
  3. M. Jerrum and A. Sinclair, “Approximating the permanent”, SIAM Journal on Computing 18(6) (1989), 1149–1178
  4. M. Jerrum, A. Sinclair and E. Vigoda, “A polynomial-time approximation algorithm for the permanent of a matrix with nonnegative entries”, Journal of the ACM 51(4) (2004), 671–697
  5. D. Štefankovič, E. Vigoda and J. Wilmes, “On counting perfect matchings in general graphs”, LATIN 2018, LNCS 10807, 873–885; arXiv:1712.07504
  6. N. Anari, S. Oveis Gharan and C. Vinzant, “Log-Concave Polynomials, Entropy, and a Deterministic Approximation Algorithm for Counting Bases of Matroids”, FOCS 2018, 35–46
  7. openai/math release notes (2026): model provenance and review status manuscripts and supporting proof artifacts produced by an internal OpenAI model