NP-Hardness Flashcards
Hitting Set definition
Given a set S={a,b,c,d,ef,g,h,….} and subset C of S –> C={(a,b,c), (b,c,e),(f,d),(a)….}; find a set H={…} of S of size <= k such that H intersect C is non empty.
For example here H={a,b}
To prove X is NP-hard
Don’t think how to change X to graph of vertex cover or independent set ; instead take an instance(نموذج) of vertex cover/independent set and transform it to an instance(نموذج) of X
How to write the proof
Consider an instance (G,V,E,K) of vertex cover , the instance (S,C,K’) of hitting set is constructed as follows:
S
Do not forget to say that this reduction take a polynomial time
True
Clique
Complete subgraph
Subgraph Isomorphism
Given 2 graphs G1 and G2; G1 is subgraph Ismorphic to G2 –> G2 contains a subgraph Isomorphic (same) to G1.
Prove NP-Hard for subgraph isomorhism
Consider an instance (G,K) of clique , an instance (G1,G2) of subgraph isomorphism is constructed as follows:
G1
Prove NP-Hardness for Independent set
Done by 3 SAT
Prove NP- Hardness for vertex cover
Consider an instance (G,K) of independent set , and instance (G,K’) of vertex cover is constructed as follows:
K’
Graph complement or graph inverse
In graph theory, the complement or inverse of a graph G is a graph H on the same vertices such that two distinct vertices of H are adjacent if and only if they are not adjacent in G
Prove of NP-completeness
Consider an instance (G,K) of Independent Set, an instance (G’,K’) of clique is constructed as follows:
G’