
A distributed blossom algorithm
for minimum-weight perfect matching
Eric C. Peterson∗
Eigenware
Berkeley, CA, USA
peterson.eric.c@gmail.com
Peter J. Karalekas∗
Eigenware
Berkeley, CA, USA
peter@karalekas.com
ABSTRACT
We describe a distributed, asynchronous variant of Edmonds’s
exact algorithm for producing perfect matchings of minimum
weight [
Edm65a
]. The development of this algorithm is driven
by an application to online error correction in quantum com-
puting, rst envisioned by Fowler [
FWH12
]; we analyze the
performance of our algorithm as applied to this domain in a
sequel [PK].
1 INTRODUCTION
Edmonds’s now-classic results on maximum matchings lie at
the intersection of computer science, combinatorics, and inte-
ger linear programming: starting from a known polynomial-
time algorithm for producing maximum matchings in bipar-
tite graphs [
CCPS09
, Proposition 5.7], he showed rst that a
polynomial-time modication could be used to handle a non-
bipartite graph [
Edm65b
], then that in the presence of edge
weights another polynomial-time modication could be used
to produce a minimum-weight representative among maxi-
mum matchings [
Edm65a
]. These are respectively called the
“blossom algorithm” and the “weighted blossom algorithm”.
These landmark results set in motion broad research programs
in several domains: there are theoretical consequences in both
computer science and mathematics; the algorithmic technique
itself admits both generalizations and eciency improvements;
and it opened the door to a host of applications.
As an example of such an application, minimum-weight per-
fect matchings (MWPMs) attracted the attention of quantum
computer scientists, who showed that an MWPM solver can be
used as an approximation algorithm for decoding syndromes
appearing in quantum error correction, with approximation
ratio dependent on the physical properties of the underlying
quantum device [
DKLP02
]. This idea has taken such hold with
designers of quantum computers that it has appeared in a vari-
ety of surveys on the subject (see, e.g., [
FMMC12
,
CNAA+20
])
as a solved problem. However, in order to deploy this on a live
quantum device, Fowler showed that one must make use of a
“parallelized” MWPM solver [
FWH12
], and work has stopped
short of producing (or referencing) such an algorithm.
Careful consideration of the intended application indicates
that the “parallelized” implementation must actually be dis-
tributed with only local information available to each worker,
online so as to cope with a dynamic problem graph, and ideally
asynchronous to best match lab hardware. Meanwhile, though
state of the art in MWPM solvers has advanced substantially
since the ’60s, they have had other concerns top of mind: it
∗All work was done prior to joining Amazon Web Services.
is easy to show that the worst-case complexity of an exact
solution to the matching problem on a cycle graph has runtime
polynomial in the diameter [
Lin92
], which has encouraged the
development of approximation algorithms instead ([
WW04
],
[LPR09], [LPP15], and many others).
In this paper, driven by the extra structure available on the
problem graphs in our intended application, we return to the
exact setting: we describe an exact, asynchronous distributed
blossom algorithm suitable for fullling Fowler’s claim and
prove its correctness. As part of extending Edmonds’s algo-
rithm to operate on alternating forests rather than trees, we
draw the reader’s attention to a new, naturally-occurring forest
operation which we call multireweight, which does not arise
during serial execution and which is crucial to the correctness
of the distributed algorithm. We also provide an implemen-
tation of the algorithm,
anatevka
[
ana
,
Ale49
], as part of a
simulation testbed for distributed systems described in a pre-
vious paper [
PK20
,
aet
]. We make no reference to quantum
computing outside of this introduction, since the existence and
behavior of this algorithm is entirely a matter of distributed
computing. Instead, we direct interested readers to the se-
quel paper [
PK
] for the further modications necessary to the
application and the performance analysis in that context.
2 THE SERIAL ALGORITHM
Our distributed algorithm is most easily cast as a piecewise
modication of Edmonds’s serial blossom algorithm, with one
extra operation. To facilitate such a description, and to put
the unfamiliar reader at ease, we rst review the details of the
serial algorithm. The inputs and output of the problem are:
Denition 1.
Amatching
𝑀
on a graph
𝐺
is a set of edges
with no repeated vertices. A matching is maximum when it is
of maximum cardinality. A maximum matching on
𝐺
is perfect
when
𝐺
has an even number of vertices. For edge-weighted
𝐺
, a matching is said to be minimum weight if there is no
equal-sized matching with smaller edge weight sum.
The goal is to produce minimum-weight perfect matchings.
Remark 2 (Standing assumptions on
𝐺
).Initially, we will as-
sume
𝐺
to be unweighted and bipartite, though we will drop
these assumptions as our discussion progresses. Between any
pair of vertices in
𝐺
, we permit there to be no edges, one edge,
or several edges—but since a loop can never be a match edge,
it is harmless to assume that
𝐺
is loopless. For the purposes of
our description, it is convenient to permit the case of multiple
edges, but it is not necessary: the algorithm will behave as if
there is at most one edge between any pair of vertices (viz.,
the one of least weight). In the weighted setting, one can also
arXiv:2210.14277v1 [cs.DC] 25 Oct 2022