Assignment 6 Foundation of Algorithms: Chinmay Kulkarni (ck1166)
Assignment 6 Foundation of Algorithms: Chinmay Kulkarni (ck1166)
FOUNDATION OF ALGORITHMS
CHINMAY KULKARNI
(ck1166)
1. Given 2 graphs G1 and G2, we need to prove that <GraphIsomorphism> for < G 1,
G2>, which checks whether the 2 graphs are isomorphs of each other is NP problem.
Suppose there is an algorithm which verifies that G 1 and G2 follow isomorphism or
not. It can be done by checking whether the graph G 1 and G2 are permutations of
each other. If yes, then return the following permutation, and if no then graphs G 1
and G2 are not isomorphic.
Once we get the permutation, we apply that permutation to one of the graph and
check whether that graph is identical to other graph.
To get the permutation the algorithm requires O(m 2), where m is number of vertices,
and to check whether the permutation applied to a graph generates an identical
graph to other graph has O(m+n) time complexity.
Overall the algorithms complexity is O(m2), hence it belongs to NP.
P and
hence
X conP. (1)
For X
coNP, X ' P and since P is closed under complement thats why X P and therefore
NP (2).
3.
(X3 (X1
X2
X3))
(X3
(X1
X2))
(X1
X2
X3)
And we apply all the combinations of values to X1, X2, X3 we always get a value of 0:
X1
X2
X3
Output
4. A Disjunctive normal form consists of Sum of products i.e. it is in the form of:
(X1
X2
X3)
(X4
X5
X6)
(X7
X8
X9)
S.
From our Set S we take A list of numbers, then <A,t> is subset sum and sum of
numbers in A is given as
A = A
(p 2t).
If there exists a subset A in S whose sum is t then, hence the remaining numbers in
S will have sum
(p - t), therefore there is partition in A such that both have sum as (p-t).
And now if there is partition in A such that both contain sum p-t, then one of the
partition will contain p-2t, and removing this give us the set of numbers who have
sum as t.
Hence we have reduced Subset sum problem to Partition problem, and as we know
that Subset sum is NP complete, therefore we can say that PARTITION IS NP
complete.
6.c. The complexity of dynamic programming algorithm for 0-1 knapsack problem is
O(n(targetW)), where n is number of choices of weights and values.
6.d. NO PNP, because we cannot generalize solution of 1 NP complete solution to all the NP
problems.
Because, there are large number of NP Problems of different kinds ,we can reduce all Np Problems to
Np complete problems . The NP complete problems can be verified in polynomial time but cannot be
solved in polynomial time.