Question 1
Based on the above data answer the given subquestions.

The IIT Madras BS Advanced Algorithms (Advanced Algorithms) Quiz 2 paper sat on 1 Dec 2024, in the September 2024 term: 26 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.
Correct answer
Based on the above data answer the given subquestions.
Consider the following reduction from 3-PARTITION to 2-PARTITION: let be the instance of 3-PARTITION where . Now consider the instance of 2-PARTITION made of the numbers:
i.e, the reduced instance consists of the first numbers of the original problem, and new numbers formed by taking the difference between each of the input numbers and the common sum . This reduction:
Correct answers
Based on the above data answer the given subquestions.
Consider the following reduction from 3-PARTITION to 2-PARTITION: let be the instance of 3-PARTITION where . Now consider the instance of 2-PARTITION made of the numbers:
i.e, the reduced instance simply consists of the first numbers of the 3-PARTITION instance. This reduction:
Correct answer
Based on the above data answer the given subquestions.
Correct answer
We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.
Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)
Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.
The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.
In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, is Alice, is Science, is Bio 101 and is Bob.
(Note: this example may not be satisfiable.)
Based on the above data answer the given subquestions.
Correct answer
We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.
Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)
Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.
The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.
In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, is Alice, is Science, is Bio 101 and is Bob.
(Note: this example may not be satisfiable.)
Based on the above data answer the given subquestions.
Correct answer
We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.
Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)
Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.
The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.
In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, is Alice, is Science, is Bio 101 and is Bob.
(Note: this example may not be satisfiable.)
Based on the above data answer the given subquestions.
Correct answer
We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.
Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)
Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.
The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.
In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, is Alice, is Science, is Bio 101 and is Bob.
(Note: this example may not be satisfiable.)
Based on the above data answer the given subquestions.
Correct answer
We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.
Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)
Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.
The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.
In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, is Alice, is Science, is Bio 101 and is Bob.
(Note: this example may not be satisfiable.)
Based on the above data answer the given subquestions.
Correct answer
We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.
Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)
Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.
The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.
In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, is Alice, is Science, is Bio 101 and is Bob.
(Note: this example may not be satisfiable.)
Based on the above data answer the given subquestions.
Correct answer
We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.
Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)
Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.
The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.
In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, is Alice, is Science, is Bio 101 and is Bob.
(Note: this example may not be satisfiable.)
Based on the above data answer the given subquestions.
Correct answer: 4
We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.
Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)
Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.
The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.
In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, is Alice, is Science, is Bio 101 and is Bob.
(Note: this example may not be satisfiable.)
Based on the above data answer the given subquestions.
Correct answer: 2
We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.
Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)
Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.
The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.
In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, is Alice, is Science, is Bio 101 and is Bob.
(Note: this example may not be satisfiable.)
Based on the above data answer the given subquestions.
Correct answer: 1
We are given a list of students and classes they are requesting. Each class has a capacity and each student must sign up for some number of courses. Further, each student needs to sign up for a set number of science courses and humanities courses.
Concretely, suppose you have this input: The classes are Bio101, Bio201, Phil101, and Phil201 (Bio classes are all science and Phil are humanties). The students are Alice and Bob. Every class has a capacity of 3 and each student MUST take exactly 2 science and 2 humanities (4 courses total)
Alice is interested in Bio101, Phil101, and Phill201. Bob is interested in Bio101, Bio201, and Phil101.
The flow network below is the beginning of a reduction to max-flow. The subquestions will ask you to label the graph to finish the reduction and answer a question about the reduction.
In particular, label each node with what it represents in the context of the input above. Some of these labels have been given to you to get you started: e.g, is Alice, is Science, is Bio 101 and is Bob.
(Note: this example may not be satisfiable.)
Based on the above data answer the given subquestions.
Correct answer: 3
Based on the above data answer the given subquestions.
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?
Correct answer
Based on the above data answer the given subquestions.
Correct answer
Correct answer: 13
Correct answer
Correct answer
Correct answer
Correct answer: 1
Correct answer: 1
Correct answer
Correct answer