找到你要的答案

Q:Is finding whether k different perfect matchings exist in a bipartite graph co-NP?

Q:发现无论是在一个二分图co-NP-存在k个不同的完美匹配?

Few definitions first. The co-NP problem is a decision problem where the answer "NO" can be verified in polynomial time. The perfect matching in a bipartite graph is a set of pairs of nodes (a pair is an edge in the graph) and where every node occurs in this set exactly once.

I am given an n x n bipartite graph, and I am trying to find out if the problem of finding whether k different perfect matchings exist in the graph, where k= polynomial(n), is a co-NP problem.

Work done so far

To initially simplify the problem, I believe that if k=2, then this is a co-NP problem. I think this is true, because the bipartite graph does not have 2 different perfect matchings, if there does not exist an exchange of neighbors between 2 nodes. I define the exchange of neighbors as the following. Let G1 be the first set in the graph, and G2 be the second set in the graph. The exchange occurs when we have a subset of G1, S1={A,B}, and a second subset of G2, S2={X,Y}, where {(A,X),(A,Y),(B,X),(B,Y)} belongs to the set of edges E. I call it exchange because if A was initially matched with X, and B with Y, then when A gets paired with Y, and B with X, A and B have exchanged their neighbors. I believe that the only way to have 2 different perfect matchings is to have at least one such exchange.

Now, we can verify that no such exchange exist in polynomial time. This is true since getting all the possible subsets S1 and S2 has O(n^4) time complexity. This because we need (n choose 2) from G1 multiplied by (n choose 2) from G2, and this gives us an upper bound of n^4.

很少定义第一。合作NP问题是一个决策问题,在多项式时间内的答案“否”可以验证。在二部图中的完美匹配是一组对节点(一对是图中的边),每个节点恰好在这个集合中发生一次。

给我一个n×n的二部图,我试图找出如果发现是否存在不同的K图完美匹配问题,其中k =多项式(N),是一种有限的NP问题。

迄今为止所做的工作

为了初步简化问题,我相信,如果k = 2,那么这是一个合作NP问题。我认为这是真的,因为偶图不有2种不同的完美匹配,如果不存在之间的2个节点的邻居交换。我定义邻居的交换如下。让G1是图中的第一集,和G2是图中的第二集。交换发生时,我们有G1的一个子集,S1 = {一},B,和一个第二子集的G2、S2 = { x,y },在{(A,X),(a,y),(b,x),(b,y)}属于边缘我叫它交换的因为如果最初是与X,Y和B,那么当一个获取搭配Y,X和B,A和B交换了他们的邻居。我认为,有2种不同的完美匹配的唯一方法是至少有一个这样的交换。

现在,我们可以验证在多项式时间内不存在这样的交换。这是真的因为得到所有可能的子集S1和S2 O(n ^ 4)的时间复杂度。这是因为我们需要(N选2)从G1乘以(N选2)从G2,这为我们提供了N ^ 4上限。

answer1: 回答1:

I am not sure if this is a co-NP problem, but it is NP for certain. I think you have a little mixed up the definition of "verifying an answer". In complexity theory verify an answer means that you provide a certificate that proves that your answer is correct, and such certificate may be checked (verified) in polynomial time.

For example, in the case of your problem, if you have a set k different perfect matchings, that will be a good certificate, verifying it means checking that it is indeed a set of perfect matchings in your input graph. You can check this in polynomial time by checking that all edges are in you graph and in each matching no two edges share a vertex, and all of them are different. Since the number of edges in a matching is linear, then verifying each matching can be done in polynomial time, then, since k is polynomial, we verify that property for all matchings also in polynomial time. Finaly, checking that all are different can be done in k square times something polynomial on n, yielding a polynomial complexity. So yes, your problem can be verified in polynomial time, and thus it is in NP.

Now, if you can find such certificate in polynomial time that will be proof enough that you problem is in P, and all problems in P are in NP and in co-NP. So I see two possible ways to solve this, you may prove that your problem is in P, that will yield a yes answer to your question, or you may prove that your problem is NP-complete, that will prove that your answer is no, since all NP-complete problems are not in co-NP (unless P = NP).

Any other way of proving that your problem is or is not in co-NP, might be very difficult and confusing, in fact the work you have done so far was moving towards proving that you can decide negative cases in polynomial time which is a different thing as verifying them, that would prove that it is co-NP, but because you proved that it is in P.

我不知道这是否是一个NP问题,但它是NP一定。我想你有点混淆了“验证答案”的定义。在复杂性理论中,验证一个答案意味着你提供了一个证明你的答案是正确的证书,并且这种证书可以在多项式时间内被检查(验证)。

例如,在你的问题的情况下,如果你有一套不同的K完美匹配,那将是一个很好的证明,这意味着检查验证它确实是在你输入一组完美匹配图。你可以在多项式时间内检查这一点,检查所有的边缘都在你的图形,在每个匹配没有两个边共享一个顶点,它们都是不同的。因为在一个匹配的边数是线性的,然后验证每个匹配可以在多项式时间内完成,然后,由于K是多项式,我们确认产权所有匹配也在多项式时间。最后,检查所有的不同可以在时代广场的东西K n行产生一个多项式,多项式复杂性。所以,是的,你的问题可以在多项式时间内验证,因此它是在NP。

现在,如果你能找到这样的证书在多项式时间,这将足以证明你的问题是在P,所有的问题在P是NP和NP。因此,我看到两种可能的方法来解决这个问题,你可以证明你的问题是在P,这将产生一个是你的问题的答案,或者你可以证明你的问题是NP-完全的,这将证明你的答案是否定的,因为所有NP完全问题不是在合作NP(除非P = NP)。

任何其他方式证明你的问题是不是在有限的NP,可能非常困难和混乱,事实上你做的工作到目前为止是走向证明你可以在多项式时间内这是一个不同的东西作为验证的决定负的情况下,这将证明它是合作NP,但因为你证明了它是P.

algorithm  graph-algorithm  matching  np  bipartite