Given two sets A and B of sizes |A| = n and |B| = m, where m >= n. There are edges from set A to set B. I need to find the number of matchings where all of vertices in set A have been matched with one vertex in set B. Is it possible to caclulate this quantity ?

(I have very little knowledge of Graph Thory and Bipartite Matching or how it is computed)


1 Answer 1


A matching in which all the vertices in $A$ are matched is known as a perfect matching. When $n = m$, you need to compute the permanent of the bipartite adjacency matrix (defined in the same way as the determinant, only without the signs). This is conjectured to be rather difficult unfortunately, even in this special case in which the matrix in question is zero-one. The permanent-vs.-determinant question is analogous to the more famous P-vs.-NP question.

When $m > n$, you can add $m-n$ dummy vertices to $A$ and connect them to all vertices in $B$. The number of perfect matchings in the new graph is exactly $(m-n)!$ times the number of perfect matchings in the old graph.

  • $\begingroup$ Thanks Yuval. Went through the link. It seems the computation for a permanent has a complexity of O(n*2^n). Far beyond the Complexiy I require. I guess I will just have to think of a different approach to my problem :) $\endgroup$
    – Kyuubi
    Commented Dec 25, 2013 at 14:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.