This action might not be possible to undo. Are you sure you want to continue?

BooksAudiobooksComicsSheet Music### Categories

### Categories

### Categories

Editors' Picks Books

Hand-picked favorites from

our editors

our editors

Editors' Picks Audiobooks

Hand-picked favorites from

our editors

our editors

Editors' Picks Comics

Hand-picked favorites from

our editors

our editors

Editors' Picks Sheet Music

Hand-picked favorites from

our editors

our editors

Top Books

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Audiobooks

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Comics

What's trending, bestsellers,

award-winners & more

award-winners & more

Top Sheet Music

What's trending, bestsellers,

award-winners & more

award-winners & more

Welcome to Scribd! Start your free trial and access books, documents and more.Find out more

HOME WORK: #2 School: LSE Department: CSE/IT

Part-A 1. Find a vertex cover of the minimum size of the following undirected graph. Prove that the problem is NP-Hard

Ans:- NP-hard, in computational complexity theory, is a class of problems that are, informally, "at least as hard as the hardest problems in NP". A problem H is NP-hard if and only if there is an NP-complete problem L that is polynomial time Turing-reducible to H (i.e., L ≤ TH). In other words, L can be solved in polynomial time by an oracle machine with an oracle for H. Informally, we can think of an algorithm that can call such an oracle machine as a subroutine for solving H, and solves L in polynomial time, if the subroutine call takes only one step to compute. NP-hard problems may be of any type: decision problems, search problems, or optimization problems.

2. Consider the following set cover problem U={a,b,c,d,e,f},S={a,b,c},{b,c,f},{b,c,d,e}

{d,e,f},{a,c,d,e},{a,c,d,e,f}.cost of the elements of S are 12,,7,19,18,20,35 respectively.find an approximately minimum set cover. Ans :-The set covering problem is a classical question in computer science and complexity theory. It is a problem "whose study has led to the development of fundamental techniques for the entire field" of approximation algorithms. Given a set of elements {1,2,...,m} (called the universe) and n sets whose union comprises the universe, the set cover problem is to identify the smallest number of sets whose union still contains all elements in the universe.

where L1 and L2 are languages in NP with verifiers V1 and V2 as in the solution for the previous part. 2. verifies whether c is actually a certificate for x ∈ Li. Suppose |x| = n.complete for undirected graph Prove that: . c) = V1(x. c) = 1 or V2(x.Let L1 and L2 be languages in NP. for i = 1. Thus.To show that L3 = L1 ∪ L2 is also in NP. Find an approximation solution for a TSP having the following distance matrix 0 3 5 9 3 0 6 7 5 6 0 9 9 7 9 0 Ans:. and the problem is NPhard. No general method of solution is known. Since both L1 and L2 are both in NP. Since a certificate c for L3 will have the property that either V1(x. c) be an algorithm that. Also. Notice also that the new verifier V3 will run in time O(2(| x|d)). . . We can define V4(x. c) for a string x and the possible certificate c. 1. Clearly then x ∈ L3 if and only if there is a certificate c such that V3(x. Vi(x.NP under union and concatenation. for a string x and a possible certificate c. c) ∨ V2(x. let Vi(x.time verifier V3 for L3. c) = 0 otherwise. we know that Vi(x. Given that the Hamiltonian cycle problem is NP. Again. and V1(x1 ・ ・ ・ xk. Therefore. c) = 1 if certificate c verifies x ∈ Li. c). c) = 1. so NP is closed under union. c) = 1. . which is polynomial. our goal is to construct a polynomial-time verifier V4(x. where # is a new symbol. z) = 1. Part-B 1.3. n}. Ans:. Now we will show that L4 = L1◦L2 is in NP. y) = 1 and V2(xk+1 ・ ・ ・ xn.A problem in graph theory requiring the most efficient Hamiltonian cycle a salesman can take through each of cities. 2. . we can easily construct a verifier V3(x. and Vi(x. we will construct a polynomial. c) terminates in polynomial time O(|x|d) for some constant d. k ∈ {0. c) = 1 if and only if c = k#y#z. the union L3 of two languages in NP is also in NP. Examine closure of the classes P.

Ans:. Unweighted simple longest-path problem for directed graph in NP. b. Hamiltonian cycle problem for directed graphs is NP-complete. as follows: for each edge in G that joins vertices u and v. then pi must be a shortest path from u to w. Ans:. from u to w with fewer edges than p1..we can decompose the path u 4 IJ into subpaths u 3 w 3 u. then we could cut out pI and paste in pi to produce a path u -+ w 3 u with fewer edges than p . let D contain two directed edges | one from u to v and one from v to u. say p i . Why? We use a “cut-and-paste” argument: if there were another path.a. which has the same vertex set as G. 3.The ordering of vertices prodeuced by TOPOLOGICAL-Sort is as given below:- . thus contradicting p’s optimality.Let G be an undirected graph. Clearly.e.complete. We claim that if p is an optimal (i. Show the ordering of vertices produced by TOPOLOGICAL-SORT of the following directed graph Ans:.. shortest) path from u to u. the number of edges in p is equal to the sum of the number of edges in p1 and the number of edges in p2. We de_ne a directed graph D.

Are you sure?

This action might not be possible to undo. Are you sure you want to continue?

We've moved you to where you read on your other device.

Get the full title to continue

Get the full title to continue listening from where you left off, or restart the preview.

scribd