Perfect Matchings in Bipartite Graphs

Slides:



Advertisements
Similar presentations
Theory of Computing Lecture 18 MAS 714 Hartmut Klauck.
Advertisements

NP-Completeness: Reductions
Department of Computer Science & Engineering
Complexity 25-1 Complexity Andrei Bulatov #P-Completeness.
CSC5160 Topics in Algorithms Tutorial 2 Introduction to NP-Complete Problems Feb Jerry Le
Complexity 11-1 Complexity Andrei Bulatov NP-Completeness.
Computability and Complexity 15-1 Computability and Complexity Andrei Bulatov NP-Completeness.
Computability and Complexity 16-1 Computability and Complexity Andrei Bulatov NP-Completeness.
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.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 23 Instructor: Paul Beame.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 24 Instructor: Paul Beame.
1 On the Computation of the Permanent Dana Moshkovitz.
Toward NP-Completeness: Introduction Almost all the algorithms we studies so far were bounded by some polynomial in the size of the input, so we call them.
The Theory of NP-Completeness 1. What is NP-completeness? Consider the circuit satisfiability problem Difficult to answer the decision problem in polynomial.
1 The Theory of NP-Completeness 2012/11/6 P: the class of problems which can be solved by a deterministic polynomial algorithm. NP : the class of decision.
Nattee Niparnan. Easy & Hard Problem What is “difficulty” of problem? Difficult for computer scientist to derive algorithm for the problem? Difficult.
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Complexity 25-1 Complexity Andrei Bulatov Counting Problems.
EMIS 8373: Integer Programming NP-Complete Problems updated 21 April 2009.
May 9, New Topic The complexity of counting.
1 Chapter 8 NP and Computational Intractability Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
Additional NP-complete problems
NP-COMPLETE PROBLEMS. Admin  Two more assignments…  No office hours on tomorrow.
NP-Complete problems.
NPC.
CSC 413/513: Intro to Algorithms
Complexity 24-1 Complexity Andrei Bulatov Counting Problems.
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
1 The Theory of NP-Completeness 2 Review: Finding lower bound by problem transformation Problem X reduces to problem Y (X  Y ) iff X can be solved by.
TU/e Algorithms (2IL15) – Lecture 10 1 NP-Completeness, II.
ICS 353: Design and Analysis of Algorithms NP-Complete Problems King Fahd University of Petroleum & Minerals Information & Computer Science Department.
The Theory of NP-Completeness
The NP class. NP-completeness
NP-Completeness (2) NP-Completeness Graphs 4/13/2018 5:22 AM x x x x x
More NP-Complete and NP-hard Problems
More NP-complete problems
P & NP.
Chapter 10 NP-Complete Problems.
Richard Anderson Lecture 26 NP-Completeness
More NP-complete Problems
SUBSET-SUM Instance: A set of numbers denoted S and a target number t.
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness (2) NP-Completeness Graphs 7/23/ :02 PM x x x x
NP-Completeness Proofs
Richard Anderson Lecture 26 NP-Completeness
NP-Completeness Yin Tat Lee
CMU Graduate Complexity Lecture 20
CS154, Lecture 16: More NP-Complete Problems; PCPs
ICS 353: Design and Analysis of Algorithms
NP-Completeness (2) NP-Completeness Graphs 11/23/2018 2:12 PM x x x x
More NP-complete Problems
Analysis of Algorithms
Richard Anderson Lecture 25 NP-Completeness
Additional NP-complete problems
Review: Reduction A problem A can be reduced to another problem B if any instance of A can be rephrased to an instance of B, the solution to which provides.
NP-Complete Problems.
NP-Completeness Yin Tat Lee
NP-Completeness Yin Tat Lee
Lecture 4-4 #P-complete Problems
CS154, Lecture 16: More NP-Complete Problems; PCPs
CS21 Decidability and Tractability
Umans Complexity Theory Lectures
Trevor Brown DC 2338, Office hour M3-4pm
The Polynomial Hierarchy Enumeration Problems 7.3.3
Instructor: Aaron Roth
Instructor: Aaron Roth
NP-Completeness (2) NP-Completeness Graphs 7/9/2019 6:12 AM x x x x x
CHAPTER 7 Time complexity
Lecture 23 NP-Hard Problems
Presentation transcript:

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.

Finding Perfect Matchings is Easy Matching as a flow problem

What About Counting Them? Let A=(a(i,j))1i,jn be the adjacency matrix of a bipartite graph G=({u1,...,un}{v1,...,vn},E), i.e. - The number of perfect matchings in the graph is כמה זיווגים מושלמים יכולים להיות לכל היותר? permanent sum over the permutations of {1,...,n}

Cycle-Covers Given an undirected bipartite graph G=({u1,...,un}{v1,...,vn},E), the corresponding directed graph is G’=({w1,...,wn},E), where (wi,wj)E iff (ui,vj)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.

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.

#P - A Complexity Class of Counting Problems LNP iff there is a polynomial time decidable binary relation R, s.t. some polynomial 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.

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.

The Generalization: Integer Permanent 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. 3 1 2 2 3 2 1

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

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

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

The Solution the rest of the graph ...

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.

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.

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= true x= false

each external edge corresponds to one literal The Clause Gadget each external edge corresponds to one literal 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.

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. -1 -1 2 3 -1

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

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

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.