IITKGP MidsemPaper
IITKGP MidsemPaper
Date of Examination:
Session (FN/AN):
Duration: 2 hours
Full Marks: 60
Subject No: CS60007
Subject: ALGORITHM DESIGN AND ANALYSIS
Department/Center/School: COMPUTER SCIENCE AND ENGINEERING
Specific charts, graph paper, log book etc., required: NO
Special instruction (if any): NA
(a) For each vertex u in A, |{v ∈ B : (u, v) ∈ M}| ∈ {0, r}, i.e., each vertex in A is matched to
either no vertex in B, or exactly r vertices in B,
(b) For each vertex v in B, |{u ∈ A : (u, v) ∈ M}| ∈ {0, 1}, i.e., each vertex in B is matched to
at most one vertex in A.
[15 Marks]
2. Let G be an undirected weighted graph. Each edge f in G has a real weight w(f) which
could possibly be negative. Let T1 and T2 be two different minimum spanning trees of G. Let
e = (u, v) be an edge that is in T1 but not in T2 . Let P be the unique path between u and v in
T2 . Show that P has an edge e 0 such that w(e 0 ) = w(e).
[15 Marks]
3. Given two strings x and y of lengths m and n respectively over an alphabet Σ, design an
algorithm with worst case running time O(mn) to find the edit distance between x and y.
The edit distance between any two strings x and y is the minimum number of operations one
needs to perform to transform x into y. The following operations are allowed.
(i) Insertion: any symbol from Σ can be inserted at any position in a string.
(ii) Deletion: any symbol from a string can be deleted.
(iii) Substitution: any symbol from a string can be replaced with another symbol.
[15 Marks]
4. A vertex cover of an undirected graph G = (V, E) is a set of vertices U ⊆ V such that each edge
has one of its endpoints in U, i.e., for each edge (u, v) ∈ E, we have u ∈ U or v ∈ U (or both).
Prove using linear programming duality that if G is bipartite then the size of its maximum
matching is equal to the size of its minimum vertex cover.
[15 Marks]
[15 Marks]