Assignment 5
Assignment 5
Q2. Explain the notion of NP Complete and NP Hard Problems with examples. 6
Let S be an NP-complete problem and Q and R be two other problems not
known to be in NP. Q is polynomial time reducible to S and S is polynomial-
time reducible to R. Classify P, Q, and R as either NP-complete or NP-hard.
Q3. Consider the following algorithm to determine whether or not an undirected 6
graph has a clique of size k. First, generate all subsets of the vertices containing
exactly k vertices. Next, check whether any of the sub-graphs induced by these
subsets is complete (i.e. forms a clique). Why is this not a polynomial-time
algorithm for the clique problem?
Q4. Explain Travelling Salesman Problem (TSP) with suitable example. Explain the 6
basic steps that are to be followed to solve TSP using branch and bound for the
given graph.
Q5. Using Rabin Karp algorithm find the spurious hits in the given pattern 6
and text: