cs6234 16 Pds
cs6234 16 Pds
Perfect Matching
Abdelhak Bentaleb1
1 School of Computing
2016
Independent Set Matchings
Outline
Independent Set
Independent Set
Matchings
Matchings
Independent Set Matchings
Outline
Independent Set
Independent Set
Matchings
Matchings
Independent Set Matchings
Independent Set
• S ← ∅, G the graph
• While G not empty do IN PARALLEL
1
• Mark each vertex v independently with probability
2d(v )
(always mark isolated nodes)
• For every edge with both nodes marked, unmark the node with
the lowest degree (break ties arbitrarily)
• Let C be the set of all marked nodes, S ← S ∪ C
• Remove from G the vertices C ∪ N(C) and all incident edges
Independent Set Matchings
Outline
Independent Set
Independent Set
Matchings
Matchings
Independent Set Matchings
Matchings
Theorem
det(A) 6= 0 ⇔ G has a perfect matching
Consequence
Deciding whether a graph G has a perfect matching is in RNC
(Random Nick’s Class (NC)).
Note: the class NC (for ”Nick’s Class”) is the set of decision problems decidable in polylogarithmic time on a
parallel computer with a polynomial number of processors. In other words, a problem is in NC if there exist
constants c and k such that it can be solved in time O(logc n) using O(nk ) parallel processors
Independent Set Matchings
Isolating Lemma
3rd 2 5 12 2 10 4 {3,4,6}
{1,2,3}&{3,
4th 2 10 3 3 9 9
4,6}
5th 3 10 8 11 10 10 {1,2,3}
6th 10 9 1 2 4 6 {3,4,6}
Simple Idea about Proof
• For element 𝑥𝑖 ,let 𝑊𝑖 be the weight of a minimum
weight set containing 𝑥𝑖 and 𝑊𝑖 be the weight of a
minimum weight set which do not contain 𝑥𝑖 .
• Only when 𝑤 𝑥𝑖 = 𝑊𝑖 − 𝑊𝑖 , there will not be an
unique minimum weight set.
• The probability of 𝑤 𝑥𝑖 = 𝑊𝑖 − 𝑊𝑖 is no more than
1/2m.
• Since we have m element. The probability that there is
a unique minimum weight set should at most
1 1
𝑚× = .
2𝑚 2
• According to Isolating Lemma, we can assign a
random weight to each edge and, with high
probability, that graph would have unique
minimum weight perfect matching.
• Example:
𝑥11 𝑥12 0
If Tutte Matrix 𝐴 = 𝑥21 0 𝑥23
0 𝑥32 0
2𝑤11 2𝑤12 0
Then 𝐵 = 2𝑤21 0 2𝑤23
0 2𝑤32 0
Lemma
• There is a unique minimum weight perfect
matching and that its weight is W ⇔ The highest
power of 2 that divides det(B) is 22𝑊
• Proof:
• Similar to previous proof.
Lemma
• Let M be the unique minimum weight perfect
matching in G, and let its weight be W. An edge (i,j)
belongs to M if and only if
det 𝐵𝑖𝑗 2𝑤𝑖𝑗
22𝑊
• is odd.
• Proof:
• det 𝐵𝑖𝑗 is related the perfect matching of G/(i,j).
Parallel Perfect Matching
• 1. for all edges (i,j), in parallel do
Choose random weight 𝑤𝑖𝑗 .
• 2. compute the Tutte matrix B from w.
• 3. compute det(B).
• 4. compute W such that 22𝑊 is the largest power of 2
dividing det(B).
• 5. compute 𝑎𝑑𝑗 𝐵 =𝑖𝑗 det 𝐵 × 𝐵−1 whose (j,i) entry has
absolute value det(𝐵 ).
• 6. for all edges (i,j) in parallel do
Compute 𝑟𝑖𝑗 = det 𝐵𝑖𝑗 2𝑤𝑖𝑗 /22𝑊 .
• 7. for all edges (i,j) in parallel do
If 𝑟𝑖𝑗 is odd then add (i,j) to M
Byzantine Generals
● “The Byzantine Generals Problem”, by Lamport, Shostak, Pease, In ACM
Transactions on Programming Languages and Systems, July 1982
Commander
attack
L1 L2
retreat
Commander
attack attack
L1 L2
retreat
Commander
attack retreat
L1 L2
retreat
• All the good people should agree on the same decision at the end
• Only bad people can distinguish bad people from good people
• Final decision of all the good people should be the same value
• If initial value of all the good people is same, final decision should be
the initial value
How do bad people violate the protocol
• Good people broadcast same value to all other people in each round
• It is assumed that number of bad people (t) is less than n/8 (n is the
total number of people)
Terms
• L= (5n)/8 + 1 (lower threshold)
• H= (3n)/4 + 1 (higher threshold)
• G= (7n)/8
• L ≥ n/2 + t + 1 (why?)
• H ≥ L + t (why?)
Algorithm
Example I
• Suppose 8 players (L=6, H=7, G=7)
1 2 3 4 5 6 7 8 Tally
1 1 1 1 1 1 1 1 1 8
2 1 1 1 1 1 1 1 0 7
3 1 1 1 1 1 1 1 1 8
4 1 1 1 1 1 1 1 0 7
5 1 1 1 1 1 1 1 1 8
6 1 1 1 1 1 1 1 0 7
7 1 1 1 1 1 1 1 1 8
8 1 1 1 1 1 1 1 0 7
• Intuition – only bad players can make this change, the difference is
bounded, nearly balanced vote can be changed
1 2 3 4 5 6 7 8 Tally
1 1 1 1 1 0 0 0 1 5
2 1 1 1 1 0 0 0 0 4
3 1 1 1 1 0 0 0 1 5
4 1 1 1 1 0 0 0 0 4
5 1 1 1 1 0 0 0 1 5
6 1 1 1 1 0 0 0 0 4
7 1 1 1 1 0 0 0 1 5
8 1 1 1 1 0 0 0 0 4
Can there be two tally values for two vectors, t1 ≤ L and t2 > H in this
case? (Remember H ≥ L + t )
Example 3 (contd)
• all tally values ≤ L,H (same as Example I)
or
• all tally values ≤ H
or
• all tally values > L
1 2 3 4 5 6 7 8 tally
1 1 1 1 1 1 1 0 1 7
2 1 1 1 1 1 1 0 0 6
3 1 1 1 1 1 1 0 1 7
4 1 1 1 1 1 1 0 0 6
5 1 1 1 1 1 1 0 1 7
6 1 1 1 1 1 1 0 0 6
7 1 1 1 1 1 1 0 1 7
8 1 1 1 1 1 1 0 0 6
2. If not all the good players get same bit value for majority vote - line
8 -> vote = 0, line 9 in next round
3. Else if, all the good players get same bit value for majority vote
line 7 , line 8, line 9 next round
Expected running time
• Constant