Prove NP-Completeness clique + independent set graph - algorithm

"Prove that it is NP-Complete to determine given input G and k whether G has both a clique of size k and an independent set of size k. Note that this is 1 problem, not 2; the answer is yes if and only if G has both of these subsets."
We were given this problem in my algorithms course and a large group of students could not figure it out. Here is what we have so far...
We know that both the clique and independent set problems are NP-Complete in of themselves. We also know that the verification of this problem, given some "certificate" is in NP.
The problem is somehow performing a reduction on the above problem (which contains both independent sets and cliques) to either a problem consisting entirely of cliques or independent sets (at least that's what we think we need to do). We don't know how to perform this reduction without losing information needed to reduce the reduction back to its original form.

Hint: Reduce CLIQUE to this problem, by adding some vertices.

Thanks to "Moron" and "Rafal Dowgird" for the hints! Based on that I think I've got a solution. Please correct me if I am incorrect:
Since we already know the the clique and independent-set problems are NP-Complete, we can use that as a foundation for proving our problem. Let's call our problem the Combination Clique Independent Set problem (CCIS).
Suppose we are given a graph G which has a clique C of size k. We can reduce this graph into a graph G' (read: G prime) which has both a clique C' of size k' and independent-set I of size k' by attaching k vertices to each vertex in C. This reduction occurs in polynomial time since the addition of the vertices takes O(n*k) time (n vertices in the graph and k vertices attached to each node).
Note that C=C' and k=k'.
Now suppose we are given a graph G' which has a clique C' of size k' and independent-set I of size k' which is determined to be true. The reduction to the clique problem is trivial since we don't need to modify the graph at all to find only a clique.

Related

Polynomial time algorithm for finding clique of size Ω(logn)

I have a homework question asking for a polynomial algorithm to find a clique of size Ω(logn).
My current implementation is as follows:
Divide the graph into n^logn microsets (subgraphs) of size logn and store them as adjacency matrices
For each subgraph, brute force check if S is a clique of size logn
If S is a clique, return it.
If we finish iterating without finding a clique, return None (no logn cliques in graph, which is the worst case)
Building the subgraphs will take n^k time. To check if a subgraph is a clique of size logn will take O((logn)^2), as each vertex in the subgraph will have k^2 edges (where k is the clique size, which in this case is logn). This must be done for all n^logn subgaphs, so the total runtime would be O(n^logn +(n^(logn))((logn)^2)).
My questions are:
Is this polynomial, or does the k as an exponent make it exponential
Is my logic sound?
What does the runtime reduce to?
Thanks y'all!
EDIT 1: I realize that the only way to do this in polynomial time is going to involve not creating n^k subgraphs, but rather dividing the graph into n/k components. If I do this, however, there is no way to guarantee that any of my microsets will actually have a k-sized clique even if one is guaranteed in the graph. Is there any way around this?
EDIT 2: One VERY important thing that I failed to mention or consider earlier was that we are given that G has a clique size of n/2.
Because of this, we know that the worst case for separating G into n/logn subsets of size logn will result when the maximum clique of n/2 is evenly separated into size logn/2 cliques into each subgraph. This guarantees that we find at least one clique of size logn/2, which satisfies finding a clique of size Ω(logn). This is also polynomial, as it runs in O(n/logn * n^(log2(3)/3) time. Apologies for not providing this earlier!

Is this bipartite graph optimization task NP-complete?

I have been trying to find out a polynomial-time algorithm to solve this problem, but in vain. I'm not familiar with the NP-complete thing. Just wondering whether this problem is actually NP-complete, and I should not waste any further effort trying to come up with a polynomial-time algorithm.
The problem is easy to describe and understand. Given a bipartite graph, what is the minimum number of vertices you have to select from one vertex set, say A, so that each vertex in B is adjacent to at least one selected vertex.
Unfortunately, this is NP-hard; there's an easy reduction from Set Cover (in fact it's arguably just a different way of expressing the same problem). In Set Cover we're given a ground set F, a collection C of subsets of F, and a number k, and we want to know if we can cover all n ground set elements of F by choosing at most k of the sets in C. To reduce this to your problem: Make a vertex in B for each ground element, and a vertex in A for each set in C, and add an edge uv whenever ground element v is in set u. If there was some algorithm to efficiently solve the problem you describe, it could solve the instance I just described, which would immediately give a solution to the original Set Cover problem (which is known to be NP-hard).
Interestingly, if we are allowed to choose vertices from the entire graph (rather than just from A), the problem is solvable in polynomial time using bipartite maximum matching algorithms, due to Kőnig's Theorem.

Proving inapproximability for minimum cycle covering

Consider the problem of cycle covering: Given a graph G, we look for a set C of cycles such that all vertex of V(G) are in at least one cycle of C and the number of cycles in C is minimum.
My task is to show that this problem does not admit an absolute approximation, i.e., there cannot be an algorithm H such that for all instances I of the problem, H(I) <= OPT(I) + k, where OPT(I) is the optimal value for I and k is a number greater or equal to 1. The usual technique is to show that if this algorithm existed, we could solve in polinomial time some NP-hard problem.
Does anyone know which problem could be used for that?
Suppose there is an algorithm H such that there is a positive integer k such that for every graph G, H(G)<=OPT(G)+k holds, where OPT(G) denotes the minimum number of cycles necessary to cover all nodes of G and the runtime of H is polynomially bounded in n, where n is the number of nodes of G.
Given any graph G, create a graph G' which consists out of k+1 isomorphic copies of G; note that the number of nodes in G' is (k+1)n, which is polynomially bounded in n. The following two cases can occur:
If G contains a Hamiltonian cycle, then OPT(G')=k+1 and H(G')<=OPT(G')+k=k+1+k=2k+1.
If G does not contain a Hamiltonian cycle, then OPT(G')>=2k+2>2k+1 hence H(G')>2k+1.
In total, H can be used to decide in a runtime bound ponlynomially bounded in n whether G contains a Hamiltonian cycle; however, as the decision whether G has a Hamiltonian cycle is an NP-complete decision problem, this is impossible unless P=NP holds.
Note: This approach is called 'gap creation', as instances are transformed in such a way that there is a gap in the objective value of
optimal solutions of yes-instances;
suboptimal solutions of yes-instances and feasible solutions of no-instances.

Verification algorithm for minimum vertex cover?

We know that the minimum vertex cover is NP complete, which means that it is in the set of problems that can be verified in polynomial time.
As I understand it, the verification process would require the following:
Verify that the solution is a vertex cover at all
Verify that the solution is the smallest possible subset of the source graph that satisfies condition #1
I'm finding it hard to establish that step #2 can be done in polynomial time. Can anyone explain how it is?
The minimum vertex cover is NP-hard. It is only NP-complete if it is restated as a decision problem which can be verified in polynomial time.
The minimum vertex cover problem is the optimization problem of finding a smallest vertex cover in a given graph.
INSTANCE: Graph G
OUTPUT: Smallest number k such that G has a vertex cover of size k.
If the problem is stated as a decision problem, it is called the vertex cover problem:
INSTANCE: Graph G and positive integer k.
QUESTION: Does G have a vertex cover of size at most k?
Restating a problem as a decision problem is a common way to make problems NP-complete. Basically you turn an open-ended problem of the form "find the smallest solution k" into a yes/no question, "for a given k, does a solution exist?"
For example, for the travelling salesman problem, verifying that a proposed solution the shortest path between all cities is NP-hard. But if the problem is restated as only having to find a solution shorter than k total distance for some k, then verifying a solution is easy. You just find the length of the proposed solution and check that it's less than k.
The decision problem formulation can be easily used to solve the general formulation. To find the shortest path all you have to do is ratchet down the value of k until there are no solutions found.

Question about NP-Completeness of the Independent Set Problem

I thought that, when proving that a problem P is NP-Complete, we were supposed to reduce a known NPC problem to P. But, looking at the solution to the Independent Set problem, it seems to not go this way.
To prove that Independent Set is NP-Complete, you take a graph G, find its inverse G', and then compute CLIQUE(G'). But, this is doing the other way around: it's taking a problem P I DON'T know if it's NPC and then reduces it to a know NPC problem.
Here's an example of the solution.
What am I missing here? Isn't this wrong, since it's doing it the other way around?
To prove that P is NP-complete, we need to show two things:
That P exists in NP.
That there's a polytime reduction algorithm to reduce some NP-complete problem Q to P.
If we know that CLIQUE is in NPC, then we can easily prove that IS is in NPC.
We can verify IS trivially in polytime. Iterate vertices, ensure that each has an edge not in the candidate solution.
We now need to reduce CLIQUE to IS. Given a graph G and an integer n, for CLIQUE we want to check if there's a CLIQUE of size n. Let H be the inverse of G. If you find an IS in H of size n, you have a CLIQUE of size n in G with the same vertices. We've reduced CLIQUE to IS.
If you were to reduce IS to CLIQUE, you wouldn't prove that either is in NPC unless you could reduce some other problem in NPC to IS.
I think this page may help you http://mlnotes.com/2013/04/29/npc.html

Resources