Presentation is loading. Please wait. # 1 Perfect Matchings in Bipartite Graphs An undirected graph G=(U  V,E) is bipartite if U  V=  and E  U  V. A 1-1 and onto function f:U  V is a perfect.

## Presentation on theme: "1 Perfect Matchings in Bipartite Graphs An undirected graph G=(U  V,E) is bipartite if U  V=  and E  U  V. A 1-1 and onto function f:U  V is a perfect."— Presentation transcript:

1 Perfect Matchings in Bipartite Graphs An undirected graph G=(U  V,E) is bipartite if U  V=  and E  U  V. A 1-1 and onto function f:U  V is a perfect matching if for any u  U, (u,f(u))  E.

2 Finding Perfect Matchings is Easy Matching as a flow problem

3 What About Counting Them? § Let A=(a(i,j)) 1  i,j  n be the adjacency matrix of a bipartite graph G=({u 1,...,u n }  {v 1,...,v n },E), i.e. - permanent sum over the permutations of {1,...,n} §The number of perfect matchings in the graph is

4 Cycle-Covers Given an undirected bipartite graph G=({u 1,...,u n }  {v 1,...,v n },E), the corresponding directed graph is G’=({w 1,...,w n },E), where (w i,w j )  E iff (u i,v j )  E. Definition: Given a directed graph G=(V,E), a set of node-disjoint cycles that together cover V is called a cycle-cover of G. Observation: Every perfect matching in G corresponds to a cycle-cover in G’ and vice- versa.

5 Three Ways To View Our Problem 1) Counting the number of Perfect Matchings in a bipartite graph. 2) Computing the Permanent of a 0-1 matrix. 3) Counting the number of Cycle-Covers in a directed graph.

6 #P - A Complexity Class of Counting Problems L  NP iff there is a polynomial time decidable binary relation R, s.t. f  #P iff f(x)=| { y | R(x,y) } | where R is a relation associated with some NP problem. We say a #P function is #P-Complete, if every #P function Cook-reduces to it. It is well known that #SAT (i.e - counting the number of satisfying assignments) is #P- Complete. some polynomial

7 On the Hardness of Computing the Permanent Claim [Val79]: Counting the number of cycle- covers in a directed graph is #P-Complete. Proof: By a reduction from #SAT to a generalization of the problem.

8 The Generalization: Integer Permanent 2 3 1 2 §Activity: an integer weight attached to each edge (u,v)  E, denoted (u,v). §The activity of a matching M is (M)=  (u,v)  M (u,v). §The activity of a set of matchings S is (M)=  M  S (M). §The goal is to compute the total activity. 2 2 3 1

9 Integer Permanent Reduces to 0-1 Permanent 2 the rest of the graph 1 1 We would have loved to do something of this sort...

10 Integer Permanent Reduces to 0-1 Permanent the rest of the graph So instead we do:

11 But this is really cheating! The integers may be exponentially large, but we are forbidden to add an exponential number of nodes!

12 The Solution the rest of the graph...

13 What About Negative Numbers? § W.l.og, let us assume the only negative numbers are -1’s. § We can reduce the problem to calculating the Permanent modulo (big enough) N of a 0-1 matrix by replacing each -1 with (N-1). § Obviously, Perm mod N is efficiently reducible to calculating the Permanent.

14 Continuing With The Hardness Proof § We showed that computing the permanent of an integer matrix reduces to computing the permanent of a 0-1 matrix. § It remains to prove the reduction from #SAT to integer Permanent. § We start by presenting a few gadgets.

15 The Choice Gadget Observation: in any cycle-cover the two nodes must be covered by either the left cycle (true) or the right cycle (false). x= truex= false

16 The Clause Gadget Observation: §no cycle-cover of this graph contains all three external edges. §However, for every proper subset of the external edges, there is exactly one cycle- cover containing it. each external edge corresponds to one literal

17 The Exclusive-Or Gadget § The Perm. of the whole matrix is 0. § The Perm. of the matrix resulting if we delete the first (last) row and column is 0. § The Perm. of the matrix resulting if we delete the first (last) row and the last (first) column is 4. 2 3

18 Plugging in the XOR-Gadget Observe a cycle-cover of the graph with a XOR-gadget plugged as in the below figure. §If e is traversed but not t (or vice versa), the Perm. is multiplied by 4. § Otherwise, the Perm. is added 0. e t

19 Putting It All Together § One choice gadget for every variable. § One Clause gadget for every clause. x= truex= false if the literal is x x= truex= false if the literal is  x

20 Sum Up § Though finding a perfect matching in a bipartite graph can be done in polynomial time, §counting the number of perfect matchings is #P-Complete, and hence believed to be impossible in polynomial time.

Download ppt "1 Perfect Matchings in Bipartite Graphs An undirected graph G=(U  V,E) is bipartite if U  V=  and E  U  V. A 1-1 and onto function f:U  V is a perfect."

Similar presentations

Ads by Google