Question 1
Based on the above data, answer the given subquestions.
Consider the following graph. A triangle-free subset of seven vertices is highlighted. Find the size of the largest triangle-free subset of vertices in this graph.
7
8
9
10

The IIT Madras BS Advanced Algorithms (Advanced Algorithms) Quiz 2 paper sat on 4 Aug 2024, in the May 2024 term: 21 questions for 50 marks in 120 minutes. Every question is below with its answer. Take it as a timed mock test to be marked, or read it through first.
Based on the above data, answer the given subquestions.
Consider the following graph. A triangle-free subset of seven vertices is highlighted. Find the size of the largest triangle-free subset of vertices in this graph.
7
8
9
10
Correct answer
8
Based on the above data, answer the given subquestions.
The TRIANGLE-FREEDOM problem is the following: the input is a simple undirected graph G and a positive integer k. An instance (G, k) is a YES-instance if and only if G has a subset S of at least k vertices that are triangle-free.
What can you say about TRIANGLE-FREEDOM? Check all that apply.
It is in P.
It is in NP.
It is NP-hard.
It is NP-complete.
Correct answers
It is in NP.
It is NP-hard.
It is NP-complete.
Finding a Hamiltonian cycle in a graph is as hard as determining the answer to the Marbles Elimination question; i.e, there is a reduction from the problem of Marbles Elimination to the problem of finding a Hamiltonian cycle.
Determining the answer to the Marbles Elimination question is as hard as finding a Hamiltonian cycle in a graph; i.e, there is a reduction from the Hamiltonian cycle problem to the problem of Marbles Elimination.
Marbles Elimination is in P by a reduction to the Max Flow problem.
Correct answer
Determining the answer to the Marbles Elimination question is as hard as finding a Hamiltonian cycle in a graph; i.e, there is a reduction from the Hamiltonian cycle problem to the problem of Marbles Elimination.
Recall the max-flow problem: for a directed graph with non-negative capacities for every and two special vertices (source, with no incoming edges) and (sink, with no outgoing edges), a flow in is an assignment such that for every edge and for every vertex . The task is to find a maximum flow i.e., a flow such that is maximized.
Given an instance , we attempt here to design a LP whose optimal value is equal to the maximum flow in the graph . There is a variable for all . Note that for any pair of vertices that is not an edge, we do not introduce any variable corresponding to it.
Is the LP above a valid formulation for computing the maximum flow in ?
Yes, this is a valid set of constraints.
No, the sum in the objective function should be taken only over neighbors of u.
No, the sum in the second constraint should be taken only over in-neighbors of v and out-neighbors of v, respectively.
Correct answer
Yes, this is a valid set of constraints.
Statement 1
Statement 2
Both statements
Neither statements
Correct answer
Neither statements
Consider the following statements and answer the given subquestions if they are true or false.
The worst-case running time and expected running time are equal to within constant factors for any randomized algorithm.
TRUE
FALSE
Correct answer
FALSE
Consider the following statements and answer the given subquestions if they are true or false.
An adversary can provide randomized quicksort with an input array of length that forces the algorithm to run in time on that input. (If you are not familiar with the asymptotic notation, it roughly translates as “at least’ ’. For example, we can say that it is possible to come up with an input that forces insertion sort to run for steps.)
TRUE
FALSE
Correct answer
FALSE
It is in P.
It is in NP.
It is NP-hard.
It is NP-complete.
Correct answers
It is in P.
It is in NP.
Recall that in the vertex cover problem, we are trying to find a smallest subset of vertices in a graph such that is an independent set; in other words, for every edges in the graph , we have that is non-empty.
Consider the algorithm that repeats the following steps as long as the graph has at least one edge available: select a vertex of maximum degree (say ), and include in the solution; thereafter, delete and all edges incident to .
Based on the above data, answer the given subquestions.
Is it true that the algorithm always outputs a vertex cover?
Yes
No
Correct answer
Yes
Recall that in the vertex cover problem, we are trying to find a smallest subset of vertices in a graph such that is an independent set; in other words, for every edges in the graph , we have that is non-empty.
Consider the algorithm that repeats the following steps as long as the graph has at least one edge available: select a vertex of maximum degree (say ), and include in the solution; thereafter, delete and all edges incident to .
Based on the above data, answer the given subquestions.
Consider the algorithm in the given question. Does the algorithm always output an optimal vertex cover?
Yes
No
Correct answer
No
Recall that in the vertex cover problem, we are trying to find a smallest subset of vertices in a graph such that is an independent set; in other words, for every edges in the graph , we have that is non-empty.
Consider the algorithm that repeats the following steps as long as the graph has at least one edge available: select a vertex of maximum degree (say ), and include in the solution; thereafter, delete and all edges incident to .
Based on the above data, answer the given subquestions.
Consider the algorithm in the given question. Does the algorithm always output a 2-approximate vertex cover?
Yes
No
Correct answer
No
Recall that in the vertex cover problem, we are trying to find a smallest subset of vertices in a graph such that is an independent set; in other words, for every edges in the graph , we have that is non-empty.
Consider the algorithm that repeats the following steps as long as the graph has at least one edge available: select a vertex of maximum degree (say ), and include in the solution; thereafter, delete and all edges incident to .
Based on the above data, answer the given subquestions.
Recall that the size of an optimal vertex cover is at most twice the size of a maximum matching of a graph G. Are there examples of graphs where the size of the optimal vertex cover is exactly equal to twice the size of its maximum matching? For example, this is not true for a path on three vertices: the size of both the maximum matching and minimum vertex cover is 1.
Yes
No
Correct answer
Yes
Based on the above data, answer the given subquestions.
TRUE
FALSE
Correct answer
TRUE
Based on the above data, answer the given subquestions.
TRUE
FALSE
Correct answer
TRUE
Based on the above data, answer the given subquestions.
TRUE
FALSE
Correct answer
FALSE
Based on the above data, answer the given subquestions.
The construction described here is a valid reduction from 3-SAT to 3-Coloring.
TRUE
FALSE
Correct answer
FALSE
Based on the above data, answer the given subquestions.
The construction described here is a valid reduction from 3-Coloring to 3-SAT.
TRUE
FALSE
Correct answer
FALSE
Based on the above data, answer the given subquestions.
Argue that to solve SCS, it is sufficient to find:
Correct answer
Based on the above data, answer the given subquestions.
Observe that for a given , the length of the corresponding superstring , which is obtained by writing the input strings in the order and merging adjacent strings, is given by:
The compression of is the sum of the overlaps of adjacent strings in the permutation . Finding a shortest superstring is equivalent to:
Correct answer
Based on the above data, answer the given subquestions.
We define an overlap graph associated with as follows: is a complete directed graph (that is, for every there are edges and ), where , and the weight of an edge is .
Let us say that an edge dominates another edge , if they share head or tail (that is, or ) and .
In terms of the overlap graph, the greedy algorithm goes through a list of all edges in in the nonincreasing order of their overlap and includes some of them in a solution. Specifically, the greedy algorithm does not include another edge if and only if
R1. it is dominated by an already chosen edge,
R2. it is not dominated but it would form a cycle.
What is the structure of the set of edges returned by the greedy algorithm?
A Hamiltonian cycle, i.e, a cycle that visits every vertex in the graph exactly once
A Hamiltonian path, i.e, a path that visits every vertex in the graph exactly once
A regular graph, i.e, a graph where every vertex has the same degree
Correct answer
A Hamiltonian path, i.e, a path that visits every vertex in the graph exactly once
Based on the above data, answer the given subquestions.
Does the greedy algorithm always produce the right answer?
Yes
No
Correct answer
No