uiz Space

May 2024 term · Advanced Algorithms · BSCS4021

Advanced Algorithms Quiz 1: 7 July 2024 (May 2024 term)

The IIT Madras BS Advanced Algorithms (Advanced Algorithms) Quiz 1 paper sat on 7 Jul 2024, in the May 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.

Questions
26
Marks
50
Duration
120 min
Numerical
9
MSQ
1
MCQ
16

Updated

Official paper: IIT M DEGREE AN EXAM QDB2 7 July 2024 · No negative marking.

Question 1

+2 marksNumerical answer

There are 2n2n positive integers written on a whiteboard. Here is a one-player game with these numbers: You start with a score of 0 . You will increase your score by performing the following move exactly nn times:

  • Choose two integers xx and yy that are written on the whiteboard.
  • Add min⁡(x,y)\min(x, y) to your score.
  • Erase xx and yy from the whiteboard.

Note that after performing the move nn times, there will be no more integers written on the whiteboard. In general, our goal is to find the maximum final score you can achieve if you optimally perform the nn moves.

We will refer to this value as the answer.

Based on the above data answer the given subquestions.

What is the answer if the input is 1 1 2 1?

Show answer

Correct answer: 2

Question 2

+2 marksNumerical answer

There are 2n2n positive integers written on a whiteboard. Here is a one-player game with these numbers: You start with a score of 0 . You will increase your score by performing the following move exactly nn times:

  • Choose two integers xx and yy that are written on the whiteboard.
  • Add min⁡(x,y)\min(x, y) to your score.
  • Erase xx and yy from the whiteboard.

Note that after performing the move nn times, there will be no more integers written on the whiteboard. In general, our goal is to find the maximum final score you can achieve if you optimally perform the nn moves.

We will refer to this value as the answer.

Based on the above data answer the given subquestions.

What is the answer if the input is 1 2 3 4 5 6 7 8 9 10?

Show answer

Correct answer: 25

Question 3

+2 marksNumerical answer

There are 2n2n positive integers written on a whiteboard. Here is a one-player game with these numbers: You start with a score of 0 . You will increase your score by performing the following move exactly nn times:

  • Choose two integers xx and yy that are written on the whiteboard.
  • Add min⁡(x,y)\min(x, y) to your score.
  • Erase xx and yy from the whiteboard.

Note that after performing the move nn times, there will be no more integers written on the whiteboard. In general, our goal is to find the maximum final score you can achieve if you optimally perform the nn moves.

We will refer to this value as the answer.

Based on the above data answer the given subquestions.

What is the answer if 2n = 50 and the input is the set of all even numbers between 1 and 100? (Hint: you might want to use the fact that the sum of the first n odd numbers is n².)

Show answer

Correct answer: 1250

Question 4

+2 marksOne or more correct options

There are 2n2n positive integers written on a whiteboard. Here is a one-player game with these numbers: You start with a score of 0 . You will increase your score by performing the following move exactly nn times:

  • Choose two integers xx and yy that are written on the whiteboard.
  • Add min⁡(x,y)\min(x, y) to your score.
  • Erase xx and yy from the whiteboard.

Note that after performing the move nn times, there will be no more integers written on the whiteboard. In general, our goal is to find the maximum final score you can achieve if you optimally perform the nn moves.

We will refer to this value as the answer.

Based on the above data answer the given subquestions.

What is the general strategy for solving this problem? Select all strategies that are correct.

Select all that apply.

  1. A

    Pick the two smallest available numbers in every step.

  2. B

    Pair the smallest and largest numbers in every step.

  3. C

    Pair the smallest number with the median element in every step.

  4. D

    Pair the largest number with the median element in every step.

  5. E

    Pick the two largest available numbers in every step.

Show answer

Correct answers

  • A

    Pick the two smallest available numbers in every step.

  • E

    Pick the two largest available numbers in every step.

Question 5

+2 marksOne correct option

Alice and Bob play the following game using an array aa of nn integers:

  1. Players take turns, Alice moves first.
  2. Each turn a player chooses any element and removes it from the array.
  3. If Alice chooses even value, then she adds it to her score. If the chosen value is odd, Alice's score does not change.
  4. Similarly, if Bob chooses odd value, then he adds it to his score. If the chosen value is even, then Bob's score does not change.

If there are no numbers left in the array, then the game ends. The player with the highest score wins. If the scores of the players are equal, then a draw is declared.

For example, if n=4n = 4 and a=[5,2,7,3]a = [5, 2, 7, 3], then the game could go as follows (there are other options):

  1. On the first move, Alice chooses 2 and get two points. Her score is now 2 . The array aa is now [5,7,3][5, 7, 3].
  2. On the second move, Bob chooses 5 and get five points. His score is now 5. The array aa is now [7,3].
  3. On the third move, Alice chooses 7 and get no points. Her score is now 2. The array aa is now [3].
  4. On the last move, Bob chooses 3 and get three points. His score is now 8 . The array aa is empty now.
  5. Since Bob has more points at the end of the game, he is the winner.

You want to find out who will win if both players play optimally.

Note that there may be duplicate numbers in the array.

To play optimally means to play to force a win whenever possible.
Based on the above data answer the given subquestions.

  1. A

    Alice

  2. B

    Bob

  3. C

    Draw

Show answer

Correct answer

  • A

    Alice

Question 6

+2 marksOne correct option

Alice and Bob play the following game using an array aa of nn integers:

  1. Players take turns, Alice moves first.
  2. Each turn a player chooses any element and removes it from the array.
  3. If Alice chooses even value, then she adds it to her score. If the chosen value is odd, Alice's score does not change.
  4. Similarly, if Bob chooses odd value, then he adds it to his score. If the chosen value is even, then Bob's score does not change.

If there are no numbers left in the array, then the game ends. The player with the highest score wins. If the scores of the players are equal, then a draw is declared.

For example, if n=4n = 4 and a=[5,2,7,3]a = [5, 2, 7, 3], then the game could go as follows (there are other options):

  1. On the first move, Alice chooses 2 and get two points. Her score is now 2 . The array aa is now [5,7,3][5, 7, 3].
  2. On the second move, Bob chooses 5 and get five points. His score is now 5. The array aa is now [7,3].
  3. On the third move, Alice chooses 7 and get no points. Her score is now 2. The array aa is now [3].
  4. On the last move, Bob chooses 3 and get three points. His score is now 8 . The array aa is empty now.
  5. Since Bob has more points at the end of the game, he is the winner.

You want to find out who will win if both players play optimally.

Note that there may be duplicate numbers in the array.

To play optimally means to play to force a win whenever possible.
Based on the above data answer the given subquestions.

  1. A

    Alice

  2. B

    Bob

  3. C

    Draw

Show answer

Correct answer

  • B

    Bob

Question 7

+2 marksOne correct option

Alice and Bob play the following game using an array aa of nn integers:

  1. Players take turns, Alice moves first.
  2. Each turn a player chooses any element and removes it from the array.
  3. If Alice chooses even value, then she adds it to her score. If the chosen value is odd, Alice's score does not change.
  4. Similarly, if Bob chooses odd value, then he adds it to his score. If the chosen value is even, then Bob's score does not change.

If there are no numbers left in the array, then the game ends. The player with the highest score wins. If the scores of the players are equal, then a draw is declared.

For example, if n=4n = 4 and a=[5,2,7,3]a = [5, 2, 7, 3], then the game could go as follows (there are other options):

  1. On the first move, Alice chooses 2 and get two points. Her score is now 2 . The array aa is now [5,7,3][5, 7, 3].
  2. On the second move, Bob chooses 5 and get five points. His score is now 5. The array aa is now [7,3].
  3. On the third move, Alice chooses 7 and get no points. Her score is now 2. The array aa is now [3].
  4. On the last move, Bob chooses 3 and get three points. His score is now 8 . The array aa is empty now.
  5. Since Bob has more points at the end of the game, he is the winner.

You want to find out who will win if both players play optimally.

Note that there may be duplicate numbers in the array.

To play optimally means to play to force a win whenever possible.
Based on the above data answer the given subquestions.

  1. A

    Alice

  2. B

    Bob

  3. C

    Draw

Show answer

Correct answer

  • A

    Alice

Question 8

+2 marksOne correct option

Alice and Bob play the following game using an array aa of nn integers:

  1. Players take turns, Alice moves first.
  2. Each turn a player chooses any element and removes it from the array.
  3. If Alice chooses even value, then she adds it to her score. If the chosen value is odd, Alice's score does not change.
  4. Similarly, if Bob chooses odd value, then he adds it to his score. If the chosen value is even, then Bob's score does not change.

If there are no numbers left in the array, then the game ends. The player with the highest score wins. If the scores of the players are equal, then a draw is declared.

For example, if n=4n = 4 and a=[5,2,7,3]a = [5, 2, 7, 3], then the game could go as follows (there are other options):

  1. On the first move, Alice chooses 2 and get two points. Her score is now 2 . The array aa is now [5,7,3][5, 7, 3].
  2. On the second move, Bob chooses 5 and get five points. His score is now 5. The array aa is now [7,3].
  3. On the third move, Alice chooses 7 and get no points. Her score is now 2. The array aa is now [3].
  4. On the last move, Bob chooses 3 and get three points. His score is now 8 . The array aa is empty now.
  5. Since Bob has more points at the end of the game, he is the winner.

You want to find out who will win if both players play optimally.

Note that there may be duplicate numbers in the array.

To play optimally means to play to force a win whenever possible.
Based on the above data answer the given subquestions.

  1. A

    Alice

  2. B

    Bob

  3. C

    Draw

Show answer

Correct answer

  • C

    Draw

Question 9

+2 marksOne correct option

Alice and Bob play the following game using an array aa of nn integers:

  1. Players take turns, Alice moves first.
  2. Each turn a player chooses any element and removes it from the array.
  3. If Alice chooses even value, then she adds it to her score. If the chosen value is odd, Alice's score does not change.
  4. Similarly, if Bob chooses odd value, then he adds it to his score. If the chosen value is even, then Bob's score does not change.

If there are no numbers left in the array, then the game ends. The player with the highest score wins. If the scores of the players are equal, then a draw is declared.

For example, if n=4n = 4 and a=[5,2,7,3]a = [5, 2, 7, 3], then the game could go as follows (there are other options):

  1. On the first move, Alice chooses 2 and get two points. Her score is now 2 . The array aa is now [5,7,3][5, 7, 3].
  2. On the second move, Bob chooses 5 and get five points. His score is now 5. The array aa is now [7,3].
  3. On the third move, Alice chooses 7 and get no points. Her score is now 2. The array aa is now [3].
  4. On the last move, Bob chooses 3 and get three points. His score is now 8 . The array aa is empty now.
  5. Since Bob has more points at the end of the game, he is the winner.

You want to find out who will win if both players play optimally.

Note that there may be duplicate numbers in the array.

To play optimally means to play to force a win whenever possible.
Based on the above data answer the given subquestions.

  1. A

    Alice

  2. B

    Bob

  3. C

    Draw

Show answer

Correct answer

  • B

    Bob

Question 10

+2 marksOne correct option

Alice and Bob play the following game using an array aa of nn integers:

  1. Players take turns, Alice moves first.
  2. Each turn a player chooses any element and removes it from the array.
  3. If Alice chooses even value, then she adds it to her score. If the chosen value is odd, Alice's score does not change.
  4. Similarly, if Bob chooses odd value, then he adds it to his score. If the chosen value is even, then Bob's score does not change.

If there are no numbers left in the array, then the game ends. The player with the highest score wins. If the scores of the players are equal, then a draw is declared.

For example, if n=4n = 4 and a=[5,2,7,3]a = [5, 2, 7, 3], then the game could go as follows (there are other options):

  1. On the first move, Alice chooses 2 and get two points. Her score is now 2 . The array aa is now [5,7,3][5, 7, 3].
  2. On the second move, Bob chooses 5 and get five points. His score is now 5. The array aa is now [7,3].
  3. On the third move, Alice chooses 7 and get no points. Her score is now 2. The array aa is now [3].
  4. On the last move, Bob chooses 3 and get three points. His score is now 8 . The array aa is empty now.
  5. Since Bob has more points at the end of the game, he is the winner.

You want to find out who will win if both players play optimally.

Note that there may be duplicate numbers in the array.

To play optimally means to play to force a win whenever possible.
Based on the above data answer the given subquestions.

What is the general strategy for Alice?

  1. A

    Pick the largest even number available.

  2. B

    Pick the largest odd number available.

  3. C

    Pick the largest number available.

  4. D

    Pick the smallest even number available.

  5. E

    Pick the smallest odd number available.

  6. F

    Pick the smallest number available.

Show answer

Correct answer

  • C

    Pick the largest number available.

Question 11

+1 markOne correct option

Based on the above data answer the given subquestions.

  1. A

    TRUE

  2. B

    FALSE

Show answer

Correct answer

  • A

    TRUE

Question 12

+2 marksOne correct option

Based on the above data answer the given subquestions.

  1. A

    TRUE

  2. B

    FALSE

Show answer

Correct answer

  • A

    TRUE

Question 13

+2 marksOne correct option

Based on the above data answer the given subquestions.

  1. A

    TRUE

  2. B

    FALSE

Show answer

Correct answer

  • A

    TRUE

Question 14

+2 marksNumerical answer

There are NN flowers arranged in a row. For each i(1≤i≤n)i(1 \leq i \leq n), the height and the beauty of the ii-th flower from the left is hih_i and aia_i, respectively.

Here, h1,h2,…,hnh_1, h_2, \ldots, h_n are all distinct.

You are pulling out some flowers so that the following condition is met:

The heights of the remaining flowers are monotonically increasing from left to right.

The goal is to remove flowers in a manner that maximizes the sum of the beauties of the remaining flowers.

The optimal solution to a given instance of this problem is the maximum obtainable sum of beauties under the constraint that the heights have to be monotonically increasing from left to right.

Based on the above data answer the given subquestions.

What is the answer if there are four flowers with heights 3, 1, 4, 2 and beauties 10, 20, 30, 40, respectively?

Show answer

Correct answer: 60

Question 15

+2 marksNumerical answer

There are NN flowers arranged in a row. For each i(1≤i≤n)i(1 \leq i \leq n), the height and the beauty of the ii-th flower from the left is hih_i and aia_i, respectively.

Here, h1,h2,…,hnh_1, h_2, \ldots, h_n are all distinct.

You are pulling out some flowers so that the following condition is met:

The heights of the remaining flowers are monotonically increasing from left to right.

The goal is to remove flowers in a manner that maximizes the sum of the beauties of the remaining flowers.

The optimal solution to a given instance of this problem is the maximum obtainable sum of beauties under the constraint that the heights have to be monotonically increasing from left to right.

Based on the above data answer the given subquestions.

What is the answer if there are four flowers with heights 4, 3, 2, 1 and beauties 10, 20, 30, 40, respectively?

Show answer

Correct answer: 40

Question 16

+3 marksNumerical answer

There are NN flowers arranged in a row. For each i(1≤i≤n)i(1 \leq i \leq n), the height and the beauty of the ii-th flower from the left is hih_i and aia_i, respectively.

Here, h1,h2,…,hnh_1, h_2, \ldots, h_n are all distinct.

You are pulling out some flowers so that the following condition is met:

The heights of the remaining flowers are monotonically increasing from left to right.

The goal is to remove flowers in a manner that maximizes the sum of the beauties of the remaining flowers.

The optimal solution to a given instance of this problem is the maximum obtainable sum of beauties under the constraint that the heights have to be monotonically increasing from left to right.

Based on the above data answer the given subquestions.

What is the answer if there are nine flowers with heights 4, 2, 5, 8, 3, 6, 1, 7, 9 and beauties 6, 8, 8, 4, 6, 3, 5, 7, 5, respectively?

Show answer

Correct answer: 31

Question 17

+2 marksOne correct option

There are NN flowers arranged in a row. For each i(1≤i≤n)i(1 \leq i \leq n), the height and the beauty of the ii-th flower from the left is hih_i and aia_i, respectively.

Here, h1,h2,…,hnh_1, h_2, \ldots, h_n are all distinct.

You are pulling out some flowers so that the following condition is met:

The heights of the remaining flowers are monotonically increasing from left to right.

The goal is to remove flowers in a manner that maximizes the sum of the beauties of the remaining flowers.

The optimal solution to a given instance of this problem is the maximum obtainable sum of beauties under the constraint that the heights have to be monotonically increasing from left to right.

Based on the above data answer the given subquestions.

Consider the following greedy algorithm for the problem: scan the flowers left to right. If the current flower violates the monotonicity condition with respect to the sequence we have so far, remove it. Otherwise, keep it. Is this algorithm correct?

  1. A

    Yes

  2. B

    No

Show answer

Correct answer

  • B

    No

Question 18

+2 marksOne correct option

There are NN flowers arranged in a row. For each i(1≤i≤n)i(1 \leq i \leq n), the height and the beauty of the ii-th flower from the left is hih_i and aia_i, respectively.

Here, h1,h2,…,hnh_1, h_2, \ldots, h_n are all distinct.

You are pulling out some flowers so that the following condition is met:

The heights of the remaining flowers are monotonically increasing from left to right.

The goal is to remove flowers in a manner that maximizes the sum of the beauties of the remaining flowers.

The optimal solution to a given instance of this problem is the maximum obtainable sum of beauties under the constraint that the heights have to be monotonically increasing from left to right.

Based on the above data answer the given subquestions.

Consider the following greedy algorithm for the problem:
Phase 1. scan the flowers left to right. If the current flower violates the monotonicity condition (increasing heights) with respect to the sequence we have so far, remove it. Otherwise, keep it. At the end, suppose the total beauty of the remaining flowers is p.
Phase 2. Starting with the original set of flowers again, scan them right to left. If the current flower violates the monotonicity condition (decreasing heights) with respect to the sequence we have so far, remove it. Otherwise, keep it. At the end, suppose the total beauty of the remaining flowers is q.
Return max(p, q). Is this algorithm correct?

  1. A

    Yes

  2. B

    No

Show answer

Correct answer

  • B

    No

Question 19

+2 marksOne correct option

There are NN flowers arranged in a row. For each i(1≤i≤n)i(1 \leq i \leq n), the height and the beauty of the ii-th flower from the left is hih_i and aia_i, respectively.

Here, h1,h2,…,hnh_1, h_2, \ldots, h_n are all distinct.

You are pulling out some flowers so that the following condition is met:

The heights of the remaining flowers are monotonically increasing from left to right.

The goal is to remove flowers in a manner that maximizes the sum of the beauties of the remaining flowers.

The optimal solution to a given instance of this problem is the maximum obtainable sum of beauties under the constraint that the heights have to be monotonically increasing from left to right.

Based on the above data answer the given subquestions.

Consider the following greedy algorithm for the problem. Initially, all flowers are unmarked. Repeat until a monotonically increasing sequence is obtained: keep and mark the most beautiful unmarked flower, and remove all flowers taller than it to its left and shorter than it to its right. Is this algorithm correct?

  1. A

    Yes

  2. B

    No

Show answer

Correct answer

  • B

    No

Question 20

+1 markOne correct option

There are NN flowers arranged in a row. For each i(1≤i≤n)i(1 \leq i \leq n), the height and the beauty of the ii-th flower from the left is hih_i and aia_i, respectively.

Here, h1,h2,…,hnh_1, h_2, \ldots, h_n are all distinct.

You are pulling out some flowers so that the following condition is met:

The heights of the remaining flowers are monotonically increasing from left to right.

The goal is to remove flowers in a manner that maximizes the sum of the beauties of the remaining flowers.

The optimal solution to a given instance of this problem is the maximum obtainable sum of beauties under the constraint that the heights have to be monotonically increasing from left to right.

Based on the above data answer the given subquestions.

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • B

Question 21

+1 markOne correct option

There are NN flowers arranged in a row. For each i(1≤i≤n)i(1 \leq i \leq n), the height and the beauty of the ii-th flower from the left is hih_i and aia_i, respectively.

Here, h1,h2,…,hnh_1, h_2, \ldots, h_n are all distinct.

You are pulling out some flowers so that the following condition is met:

The heights of the remaining flowers are monotonically increasing from left to right.

The goal is to remove flowers in a manner that maximizes the sum of the beauties of the remaining flowers.

The optimal solution to a given instance of this problem is the maximum obtainable sum of beauties under the constraint that the heights have to be monotonically increasing from left to right.

Based on the above data answer the given subquestions.

  1. A
  2. B
  3. C
  4. D
  5. E
Show answer

Correct answer

  • C

Question 22

+3 marksOne correct option

There are NN flowers arranged in a row. For each i(1≤i≤n)i(1 \leq i \leq n), the height and the beauty of the ii-th flower from the left is hih_i and aia_i, respectively.

Here, h1,h2,…,hnh_1, h_2, \ldots, h_n are all distinct.

You are pulling out some flowers so that the following condition is met:

The heights of the remaining flowers are monotonically increasing from left to right.

The goal is to remove flowers in a manner that maximizes the sum of the beauties of the remaining flowers.

The optimal solution to a given instance of this problem is the maximum obtainable sum of beauties under the constraint that the heights have to be monotonically increasing from left to right.

Based on the above data answer the given subquestions.

  1. A
  2. B
  3. C
  4. D
  5. E
Show answer

Correct answer

  • D

Question 23

+1 markNumerical answer

The notion of treewidth can be defined in several ways. One way to frame the definition of treewidth is by using the following game called the cops-and-robber game. The game consists of a set of cops trying to catch a robber. The robber lives in the graph and can move with infinite speed along the edges of the graph. He cannot, however, move through a vertex should a cop be guarding it. The cops move about in helicopters, the point being that they are not constrained to move along the edges of the graph, but they have finite speed. The game proceeds as follows. Initially, the robber occupies some vertex of the graph. The cops announce their positions (a set of vertices) and move towards them with finite speed. Seeing their positions, the robber announces his position (a vertex) and moves to that vertex instantaneously. Not all cops need land on vertices at once and not all cops need change positions, that is, if a cop occupies a vertex, it may continue occupying that vertex in the next move of the game. The cops catch the robber when one of them lands on a vertex occupied by him.
For example, on a cycle of length more than three, the robber can always escape a single cop. We are interested in finding the smallest number of cops we need to deploy to ensure that the robber can be caught in a finite number of rounds of this game.
Based on the above data answer the given subquestions.

How many cops are necessary and sufficient to catch the robber on a path?

Show answer

Correct answer: 1

Question 24

+2 marksNumerical answer

The notion of treewidth can be defined in several ways. One way to frame the definition of treewidth is by using the following game called the cops-and-robber game. The game consists of a set of cops trying to catch a robber. The robber lives in the graph and can move with infinite speed along the edges of the graph. He cannot, however, move through a vertex should a cop be guarding it. The cops move about in helicopters, the point being that they are not constrained to move along the edges of the graph, but they have finite speed. The game proceeds as follows. Initially, the robber occupies some vertex of the graph. The cops announce their positions (a set of vertices) and move towards them with finite speed. Seeing their positions, the robber announces his position (a vertex) and moves to that vertex instantaneously. Not all cops need land on vertices at once and not all cops need change positions, that is, if a cop occupies a vertex, it may continue occupying that vertex in the next move of the game. The cops catch the robber when one of them lands on a vertex occupied by him.
For example, on a cycle of length more than three, the robber can always escape a single cop. We are interested in finding the smallest number of cops we need to deploy to ensure that the robber can be caught in a finite number of rounds of this game.
Based on the above data answer the given subquestions.

How many cops are necessary and sufficient to catch the robber on a tree?

Show answer

Correct answer: 1

Question 25

+2 marksNumerical answer

The notion of treewidth can be defined in several ways. One way to frame the definition of treewidth is by using the following game called the cops-and-robber game. The game consists of a set of cops trying to catch a robber. The robber lives in the graph and can move with infinite speed along the edges of the graph. He cannot, however, move through a vertex should a cop be guarding it. The cops move about in helicopters, the point being that they are not constrained to move along the edges of the graph, but they have finite speed. The game proceeds as follows. Initially, the robber occupies some vertex of the graph. The cops announce their positions (a set of vertices) and move towards them with finite speed. Seeing their positions, the robber announces his position (a vertex) and moves to that vertex instantaneously. Not all cops need land on vertices at once and not all cops need change positions, that is, if a cop occupies a vertex, it may continue occupying that vertex in the next move of the game. The cops catch the robber when one of them lands on a vertex occupied by him.
For example, on a cycle of length more than three, the robber can always escape a single cop. We are interested in finding the smallest number of cops we need to deploy to ensure that the robber can be caught in a finite number of rounds of this game.
Based on the above data answer the given subquestions.

How many cops are necessary and sufficient to catch the robber on a cycle?

Show answer

Correct answer: 2

Question 26

+2 marksOne correct option

The notion of treewidth can be defined in several ways. One way to frame the definition of treewidth is by using the following game called the cops-and-robber game. The game consists of a set of cops trying to catch a robber. The robber lives in the graph and can move with infinite speed along the edges of the graph. He cannot, however, move through a vertex should a cop be guarding it. The cops move about in helicopters, the point being that they are not constrained to move along the edges of the graph, but they have finite speed. The game proceeds as follows. Initially, the robber occupies some vertex of the graph. The cops announce their positions (a set of vertices) and move towards them with finite speed. Seeing their positions, the robber announces his position (a vertex) and moves to that vertex instantaneously. Not all cops need land on vertices at once and not all cops need change positions, that is, if a cop occupies a vertex, it may continue occupying that vertex in the next move of the game. The cops catch the robber when one of them lands on a vertex occupied by him.
For example, on a cycle of length more than three, the robber can always escape a single cop. We are interested in finding the smallest number of cops we need to deploy to ensure that the robber can be caught in a finite number of rounds of this game.
Based on the above data answer the given subquestions.

How many cops are definitely enough to catch the robber on a graph of treewidth k?

  1. A
  2. B
  3. C
  4. D
Show answer

Correct answer

  • D