The Edmonds matrix and the randomized perfect-matching test #
A bipartite graph G on left and right vertices both indexed by a finite type V has the
Edmonds matrix Cslib.Algorithms.Matching.edmondsMatrix G: its entry (i, j) is the
indeterminate X (i, j) when (i, j) is an edge and 0 otherwise. Its determinant, a polynomial
in the variables V × V, is nonzero exactly when G has a perfect matching
(Cslib.Algorithms.Matching.det_edmondsMatrix_ne_zero_iff), over every nontrivial commutative
ring. In the Leibniz expansion every permutation σ gives the monomial ∏ v, X (v, σ v) when its
pairs are all edges and 0 otherwise. Without a perfect matching every term vanishes. With one,
σ, evaluating at the indicator of the pairs (v, σ v) turns the matrix into the permutation
matrix of σ, of determinant sign σ ≠ 0. This is Edmonds' observation [Edm67b] that
underlies Lovász's randomized matching algorithm [Lov79a]
Motwani and Raghavan, Section 7.3.
The randomized test substitutes values r : V × V → R for the indeterminates
(Cslib.Algorithms.Matching.edmondsEval G r) and checks whether the determinant is nonzero. Its
error is one-sided. Without a perfect matching the determinant is always 0
(Cslib.Algorithms.Matching.det_edmondsEval_eq_zero). With one, over an integral domain and with
the values drawn independently and uniformly from a finite set S, the determinant vanishes with
probability at most |V| / |S|
(Cslib.Algorithms.Matching.card_det_edmondsEval_eq_zero_div_le), by the Schwartz–Zippel lemma,
since the determinant has total degree at most |V|.
Main definitions #
Cslib.Algorithms.Matching.edmondsMatrix: the Edmonds matrix of a bipartite graph.Cslib.Algorithms.Matching.edmondsEval: the Edmonds matrix at given values.
Main results #
Cslib.Algorithms.Matching.det_edmondsMatrix_ne_zero_iff: the determinant is nonzero exactly when the graph has a perfect matching.Cslib.Algorithms.Matching.det_edmondsEval_eq_zero: no false positives.Cslib.Algorithms.Matching.card_det_edmondsEval_eq_zero_div_le: false negatives with probability at most|V| / |S|.Cslib.Algorithms.Matching.exists_det_edmondsEval_ne_zero: values from any set of more than|V|elements detect a perfect matching.
References #
Evaluating the Edmonds matrix at the indicator of the pairs (v, σ v) of a perfect matching
σ gives the permutation matrix of σ.
The determinant of the Edmonds matrix at values is the determinant polynomial evaluated at them.
Without a perfect matching, the determinant of the Edmonds matrix is the zero polynomial:
every term of the Leibniz expansion has a factor 0.
No false positives: without a perfect matching, the Edmonds matrix has determinant 0 at
all values.
With a perfect matching, the determinant of the Edmonds matrix is a nonzero polynomial.
Edmonds' criterion [Edm67b]: over a nontrivial commutative ring, the determinant of the Edmonds matrix of a bipartite graph is a nonzero polynomial exactly when the graph has a perfect matching.
The determinant of the Edmonds matrix has total degree at most |V|.
The randomized perfect-matching test: for a bipartite graph with a perfect matching, over
an integral domain, the Edmonds matrix at values drawn independently and uniformly from a finite
set S is singular with probability at most |V| / |S|.
Values from any set of more than |V| elements of an integral domain detect a perfect
matching: some choice of them makes the Edmonds matrix nonsingular.