You are given a bipartite graph G=(U,V,E), and an integer K. U and V are the two bipartitions of the graph such that |U| = |V| = N , and E is the edge set. The vertices of U are {1,2,...,N } and that...


You are given a bipartite graph G=(U,V,E), and an integer K. U and V are the two bipartitions of the graph such that |U| = |V| = N , and E is the edge set. The vertices of U are {1,2,...,N } and that of V are {N+1,N+2,...,2N }. You need to find out whether the total number of different perfect matchings in G is strictly greater than K or not. Recall that a perfect matching is a subset of E such that every vertex of the graph belongs to exactly one edge in the subset. Two perfect matchings are considered to be different even if one edge is different. Write a program in C++ programming language that prints a single line containing “Perfect” if the number of perfect matchings is greater than K, and “Not perfect” in other cases.
Sample Input:
3 5 2
1 4
2 6
2 5
3 5
3 5
Output:
Not Perfect



Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here