Isolating weights and the Mulmuley–Vazirani–Vazirani matching algorithm #
The algebraic and probabilistic core of the parallel matching algorithm of Mulmuley, Vazirani and
Vazirani [MVV87] Motwani and Raghavan, Section 12.4,
for a bipartite graph G : V × V → Bool. Give each edge (i, j) a weight w (i, j) and let B
be the Edmonds matrix at the values 2 ^ w (i, j)
(Cslib.Algorithms.Matching.weightedEdmonds G w, a matrix over ℤ). Each perfect matching σ
contributes ± 2 ^ (weight of σ) to det B. When the minimum-weight perfect matching σ₀ is
unique, of weight W, every other term is divisible by 2 ^ (W + 1), so
2 ^ Wdividesdet Band2 ^ (W + 1)does not (Cslib.Algorithms.Matching.two_pow_dvd_det_weightedEdmonds,Cslib.Algorithms.Matching.not_two_pow_succ_dvd_det_weightedEdmonds), soWis the2-adic valuation ofdet B(Cslib.Algorithms.Matching.matchingWeight_eq_padicValInt_det);σ₀matchesitojexactly when2 ^ (W + 1)does not divideB i j * adj(B) j i(Cslib.Algorithms.Matching.apply_eq_iff_not_two_pow_succ_dvd_mul_adjugate), since that product is the signed sum over the perfect matchings that matchitoj.
MVV state these lemmas for the Tutte matrix of a general graph, where the power is 2 ^ (2 W);
the statements here are their bipartite (Edmonds-matrix) form. The procedure
Cslib.Algorithms.Matching.mvvOutput G w computes W from det B and outputs the pairs (i, j)
passing the divisibility test; on isolating weights it outputs exactly σ₀
(Cslib.Algorithms.Matching.mvvOutput_iff_apply_eq).
The isolation lemma makes the minimum unique with probability at least 1 / 2 when the edge
weights are independent and uniform on {1, …, N} with N ≥ 2 |E|
(Cslib.Algorithms.Matching.half_le_dens_exists_isUniqueMinMatching, from
Cslib.Probability.half_le_dens_minWeightSets_card_eq_one). Together, the procedure returns a
perfect matching of G with probability at least 1 / 2
(Cslib.Algorithms.Matching.half_le_dens_mvv). Probabilities are proportions of the weight
functions, as in the isolation lemma. The parallel (NC) computation of the determinant and the
adjugate is not formalized.
Main definitions #
Cslib.Algorithms.Matching.weightedEdmonds: the Edmonds matrix at powers of two.Cslib.Algorithms.Matching.IsUniqueMinMatching: a unique minimum-weight perfect matching.Cslib.Algorithms.Matching.mvvOutput: the pairs output by the procedure.Cslib.Algorithms.Matching.MVVSucceeds: the output is a perfect matching.
Main results #
Cslib.Algorithms.Matching.matchingWeight_eq_padicValInt_det: the weight of the isolated matching is the2-adic valuation of the determinant.Cslib.Algorithms.Matching.apply_eq_iff_not_two_pow_succ_dvd_mul_adjugate: reading off the matching.Cslib.Algorithms.Matching.mvvOutput_iff_apply_eq: the procedure is correct on isolating weights.Cslib.Algorithms.Matching.half_le_dens_exists_isUniqueMinMatching: the isolation lemma for perfect matchings.Cslib.Algorithms.Matching.half_le_dens_mvv: the procedure succeeds with probability at least1 / 2.
References #
Signed sums of powers of two with a unique smallest exponent #
The weighted Edmonds matrix #
The weight ∑ v, w (v, σ v) of the perfect matching σ.
The weight of a perfect matching is the sum of the weights of its pairs.
The perfect matchings of G, as permutations.
Membership in perfectMatchings.
The term of σ in the Leibniz expansion of the weighted Edmonds matrix: 2 to the weight of
σ for a perfect matching, 0 otherwise.
The determinant of the weighted Edmonds matrix as a signed sum over the perfect matchings.
The entry B i j of the weighted Edmonds matrix times the cofactor adj(B) j i is the signed
sum over the perfect matchings that match i to j.
Reading off a unique minimum-weight perfect matching #
σ₀ is the unique minimum-weight perfect matching of the bipartite graph G under w.
Instances For
σ₀ is the unique minimum-weight perfect matching when it is a perfect matching and every
other perfect matching is strictly heavier.
Being the unique minimum-weight perfect matching is decidable.
The weight of the isolated matching divides the determinant: if σ₀ is the unique
minimum-weight perfect matching of the bipartite graph G, of weight W, then 2 ^ W divides
the determinant of the weighted Edmonds matrix. With not_two_pow_succ_dvd_det_weightedEdmonds,
this is the bipartite (Edmonds-matrix) form of the determinant lemma of
[MVV87], which is stated for the Tutte matrix of a general graph, where the
power is 2 ^ (2 W); see Motwani and Raghavan, Section 12.4.
If σ₀ is the unique minimum-weight perfect matching of the bipartite graph G, of weight
W, then 2 ^ (W + 1) does not divide the determinant of the weighted Edmonds matrix. So W is
the exponent of the largest power of two dividing it (matchingWeight_eq_padicValInt_det).
The determinant of the weighted Edmonds matrix is nonzero when the minimum-weight perfect matching is unique.
If σ₀ is the unique minimum-weight perfect matching of the bipartite graph G, of weight
W, then 2 ^ W divides B i j * adj(B) j i for all i, j, where B is the weighted Edmonds
matrix.
Reading off the isolated matching: if σ₀ is the unique minimum-weight perfect matching of
the bipartite graph G, of weight W, then σ₀ matches i to j exactly when 2 ^ (W + 1)
does not divide B i j * adj(B) j i, where B is the weighted Edmonds matrix. This is the
bipartite (Edmonds-matrix) form of the edge test of [MVV87], which is
stated for the Tutte matrix of a general graph; see
Motwani and Raghavan, Section 12.4.
The weight of the unique minimum-weight perfect matching is the exponent of the largest power of two dividing the determinant of the weighted Edmonds matrix.
The output of the procedure #
The output of the Mulmuley–Vazirani–Vazirani procedure on the bipartite graph G with
weights w: with B the weighted Edmonds matrix and W the exponent of the largest power of two
dividing det B, the pair (i, j) is output when 2 ^ (W + 1) does not divide
B i j * adj(B) j i.
Instances For
The defining divisibility test of mvvOutput.
The output of the procedure is decidable, by an executable test. Mathlib's padicValInt is
noncomputable, so the instance decides the same divisibility with the executable padicValNat,
which Nat.padicValNat_def identifies with the multiplicity that padicValInt unfolds to.
The procedure is correct on isolating weights: if σ₀ is the unique minimum-weight perfect
matching of the bipartite graph G under w, the procedure outputs exactly the pairs of σ₀.
The procedure succeeds on the bipartite graph G with weights w: its output is a perfect
matching of G.
Instances For
The procedure succeeds when its output is the graph of a perfect matching.
Success of the procedure is decidable, by searching the permutations with the executable
test for mvvOutput.
The procedure succeeds whenever the minimum-weight perfect matching is unique.
Isolating weights #
The edges of the perfect matching σ.
An edge (i, j) belongs to the matching σ when σ i = j.
Distinct perfect matchings have distinct edge sets.
The isolation-lemma weight of the edges of a perfect matching is its matching weight under the extended weights.
The isolation lemma for bipartite perfect matchings [MVV87]: if the
bipartite graph G has a perfect matching and its edges get independent uniform weights from
{1, …, N} with N ≥ 2 |E|, then with probability at least 1 / 2 the minimum-weight perfect
matching is unique.
The Mulmuley–Vazirani–Vazirani algorithm for bipartite graphs, algebraic core
[MVV87] Motwani and Raghavan, Section 12.4: if the
bipartite graph G has a perfect matching and its edges get independent uniform weights w from
{1, …, N} with N ≥ 2 |E|, then with probability at least 1 / 2 the procedure mvvOutput
outputs a perfect matching of G.