Algorithm Search⌘K

Proofs: Randomized parallel perfect matching

These are the human proofs of Randomized parallel perfect matching, at full length.

The MVV algorithm returns only perfect matchings and finds one with probability at least 1/2 per trial full

This proof shows: correctness, termination.

Let G=(V,E)G = (V, E) be a general graph with V={1,…,n}V = \{1, \ldots, n\} and m=∣E∣m = |E|. For weights w:E→{1,2,…}w : E \to \{1, 2, \ldots\}, let BB be the skew-symmetric matrix with Bij=2w(ij)B_{ij} = 2^{w(ij)} and Bji=−2w(ij)B_{ji} = -2^{w(ij)} for each edge ijij with i<ji < j, and 0 elsewhere. For a perfect matching MM write w(M)=∑e∈Mw(e)w(M) = \sum_{e \in M} w(e). For a nonzero integer DD, ν2(D)\nu_2(D) is the exponent of 2 in DD.

Termination. Line L1 runs at most kk trials, and each trial does a bounded amount of exact arithmetic. So the algorithm stops. □\square

Lemma 1 (only checked output). If the algorithm returns a set MM, then MM is a perfect matching of GG. If GG has no perfect matching, the algorithm returns "none".

Proof. Line L8 returns MM only after it checks that M⊆EM \subseteq E and that every vertex is on exactly one edge of MM. If GG has no perfect matching, no set passes this check, so line L9 is reached. □\square

Lemma 2 (isolation lemma). Let F\mathcal F be a nonempty family of subsets of a finite set SS with ∣S∣=m|S| = m. Choose w(e)w(e) uniformly and independently from {1,…,N}\{1, \ldots, N\} for each e∈Se \in S. Then the probability that two different sets of F\mathcal F both have the least weight is at most m/Nm / N.

Proof. Call e∈Se \in S ambiguous if some set of least weight contains ee and some set of least weight does not. If two different sets of least weight exist, some element is in one and not in the other, and it is ambiguous. So it is enough to show Pr⁡[e is ambiguous]≤1/N\Pr[e \text{ is ambiguous}] \le 1/N for each ee, and then take the union over the mm elements.

Fix ee and fix the weights of all other elements. Let aa be the least weight of a set of F\mathcal F that does not contain ee (a=∞a = \infty if there is none), and let bb be the least value of w(F)−w(e)w(F) - w(e) over sets F∈FF \in \mathcal F that contain ee (b=∞b = \infty if there is none). Neither aa nor bb depends on w(e)w(e). The least weight of a set containing ee is b+w(e)b + w(e). If b+w(e)<ab + w(e) < a, every set of least weight contains ee; if b+w(e)>ab + w(e) > a, none does. So ee is ambiguous only if w(e)=a−bw(e) = a - b, which has probability at most 1/N1/N over the choice of w(e)w(e). Averaging over the other weights gives the bound. □\square

Lemma 3 (Pfaffian). For a skew-symmetric matrix BB of even order nn, det⁡B=Pf⁡(B)2\det B = \operatorname{Pf}(B)^2, where

Pf⁡(B)=∑Msgn⁡(M)∏{i<j}∈MBij,\operatorname{Pf}(B) = \sum_{M} \operatorname{sgn}(M) \prod_{\{i < j\} \in M} B_{ij},

the sum over all perfect matchings MM of the complete graph on VV, with a sign sgn⁡(M)∈{±1}\operatorname{sgn}(M) \in \{\pm 1\} that depends only on MM. For odd nn, det⁡B=0\det B = 0. Also, for i≠ji \ne j the cofactor of BB at (i,j)(i, j) is ±Pf⁡(B)⋅Pf⁡(Bij)\pm \operatorname{Pf}(B) \cdot \operatorname{Pf}(B^{ij}), where BijB^{ij} is BB with rows and columns ii and jj removed. Finally, the expansion of the Pfaffian along row ii gives Pf⁡(B)=∑j≠i±BijPf⁡(Bij)\operatorname{Pf}(B) = \sum_{j \ne i} \pm B_{ij} \operatorname{Pf}(B^{ij}).

These are standard facts about Pfaffians (see Lovász and Plummer, Matching Theory, Chapter 8, and Motwani and Raghavan, Randomized Algorithms, Chapter 12). For odd nn, det⁡B=det⁡BT=det⁡(−B)=(−1)ndet⁡B=−det⁡B\det B = \det B^{T} = \det(-B) = (-1)^n \det B = -\det B. □\square

In our BB, a product ∏Bij\prod B_{ij} is nonzero only when every pair of MM is an edge of GG, so

Pf⁡(B)=∑M perfect matching of G±2w(M).(1)\operatorname{Pf}(B) = \sum_{M \text{ perfect matching of } G} \pm 2^{w(M)}. \tag{1}

In the same way, Pf⁡(Bij)=∑M′±2w(M′)\operatorname{Pf}(B^{ij}) = \sum_{M'} \pm 2^{w(M')} over perfect matchings M′M' of G−i−jG - i - j. For an edge ijij, the sets M′∪{ij}M' \cup \{ij\} are exactly the perfect matchings of GG that contain ijij, so

2w(ij)Pf⁡(Bij)=∑M∋ij±2w(M).(2)2^{w(ij)} \operatorname{Pf}(B^{ij}) = \sum_{M \ni ij} \pm 2^{w(M)}. \tag{2}

Lemma 4 (one isolated matching is read correctly). Suppose GG has a perfect matching and exactly one perfect matching M0M_0 has the least weight WW. Then the trial does not stop at lines L4 and L5, ν2(det⁡B)=2W\nu_2(\det B) = 2W, and line L7 computes M=M0M = M_0.

Proof. Every term of (1) other than the term of M0M_0 is ±2w(M)\pm 2^{w(M)} with w(M)≥W+1w(M) \ge W + 1, so it is divisible by 2W+12^{W+1}. So Pf⁡(B)=2W(±1+2t)\operatorname{Pf}(B) = 2^W (\pm 1 + 2t) for an integer tt, which is 2W2^W times an odd number and is not 0. By Lemma 3, det⁡B=Pf⁡(B)2=22W⋅(odd)\det B = \operatorname{Pf}(B)^2 = 2^{2W} \cdot (\text{odd}), so det⁡B≠0\det B \ne 0 and ν2(det⁡B)=2W\nu_2(\det B) = 2W, which is even. Lines L4 and L5 pass, with W2=2WW_2 = 2W.

The adjugate entry AjiA_{ji} is the cofactor of BB at (i,j)(i, j), so by Lemma 3 and (2),

∣Aji∣⋅2w(ij)=∣Pf⁡(B)∣⋅∣∑M∋ij±2w(M)∣=2W⋅(odd)⋅∣∑M∋ij±2w(M)∣.|A_{ji}| \cdot 2^{w(ij)} = |\operatorname{Pf}(B)| \cdot \Bigl| \sum_{M \ni ij} \pm 2^{w(M)} \Bigr| = 2^W \cdot (\text{odd}) \cdot \Bigl| \sum_{M \ni ij} \pm 2^{w(M)} \Bigr|.

If ij∈M0ij \in M_0, the sum contains the term of M0M_0 and all other terms are divisible by 2W+12^{W+1}, so the sum is 2W⋅(odd)2^W \cdot (\text{odd}), and the whole product is 22W⋅(odd)2^{2W} \cdot (\text{odd}). Divided by 2W2=22W2^{W_2} = 2^{2W}, it is an odd integer, and line L7 puts ijij in MM. If ij∉M0ij \notin M_0, every perfect matching that contains ijij has weight at least W+1W + 1, so the sum is divisible by 2W+12^{W+1} (it may be 0). The product is divisible by 22W+12^{2W+1}, and divided by 22W2^{2W} it is an even integer, so line L7 does not put ijij in MM. So M=M0M = M_0. □\square

Theorem. A set returned by the algorithm is a perfect matching of GG, and "none" is returned whenever GG has no perfect matching. If GG has a perfect matching, each trial returns one with probability at least 1/21/2, so the algorithm returns "none" with probability at most 2−k2^{-k}.

Proof. The first two claims are Lemma 1. Suppose GG has a perfect matching, so m≥1m \ge 1 or n=0n = 0. If n=0n = 0, the empty matching passes line L8 in the first trial, as det⁡\det of the empty matrix is 1 and ν2(1)=0\nu_2(1) = 0. Otherwise apply Lemma 2 to S=ES = E, F\mathcal F the perfect matchings of GG, and N=2mN = 2m: with probability at least 1−m/(2m)=1/21 - m/(2m) = 1/2 the least-weight perfect matching M0M_0 is unique. Then by Lemma 4 line L7 computes M0M_0, which passes line L8. The trials use independent weights, so all kk fail with probability at most 2−k2^{-k}. ■\blacksquare

Back to Randomized parallel perfect matching