Unit 5: Backtracking and Approximation Algorithms - Practice Quiz

CSE408 — Design And Analysis Of Algorithms 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is the primary objective of the n-Queens problem?

Backtracking: n-Queens Problem Easy
A. To find the shortest path for a queen to traverse the entire board.
B. To place queens on a chessboard such that they cover all the squares.
C. To place queens on an chessboard such that no two queens attack each other.
D. To capture all queens on the chessboard using a single knight.

2 In the n-Queens problem, which of the following conditions constitutes an attack between two queens?

Backtracking: n-Queens Problem Easy
A. Being placed on the same color square.
B. Being in the same row, column, or diagonal.
C. Being placed in adjacent squares only.
D. Being exactly an -shape apart like a knight.

3 Is there a valid solution for the 2-Queens problem on a chessboard?

Backtracking: n-Queens Problem Easy
A. Yes, but only if they are of different colors.
B. Yes, there are two solutions.
C. Yes, there is exactly one solution.
D. No, there is no valid solution.

4 What is a Hamiltonian Circuit in a graph?

Hamiltonian Circuit Problem Easy
A. A tree that connects all the vertices in a graph with minimum total edge weight.
B. The shortest path between a designated source and destination.
C. A path that visits every edge exactly once and returns to the starting vertex.
D. A cycle that visits every vertex exactly once and returns to the starting vertex.

5 Which of the following algorithm design techniques is commonly used to find all Hamiltonian Circuits in a graph?

Hamiltonian Circuit Problem Easy
A. Greedy Method
B. Dynamic Programming
C. Divide and Conquer
D. Backtracking

6 What is the goal of the Subset-Sum Problem?

Subset-Sum Problem Easy
A. To find the sum of all elements in a given set.
B. To find a subset of a given set whose elements sum to a specified target value.
C. To find the subset with the maximum possible sum.
D. To divide a set into two subsets with the maximum possible difference in sums.

7 In a backtracking solution for the Subset-Sum problem, what represents a state in the state-space tree?

Subset-Sum Problem Easy
A. The maximum element in the subset.
B. A sorted array of the elements.
C. The total number of sets possible.
D. A sequence of decisions on whether to include or exclude specific items.

8 What is the primary difference between Branch-and-Bound and Backtracking?

Branch-and-Bound: Assignment Problem Easy
A. There is no difference; they are exactly the same.
B. Backtracking uses a bounding function, while Branch-and-Bound does not.
C. Branch-and-Bound is generally used for optimization problems and uses a bounding function, while Backtracking is used for finding all solutions.
D. Backtracking is only for graphs, while Branch-and-Bound is only for trees.

9 What is the objective of the Assignment Problem?

Branch-and-Bound: Assignment Problem Easy
A. To maximize the time taken to complete all tasks.
B. To assign jobs to workers such that the total cost is minimized.
C. To assign workers to jobs such that every worker gets at least two jobs.
D. To assign as many jobs as possible to a single worker.

10 In the context of Branch-and-Bound, which version of the Knapsack problem is typically solved?

Knapsack Problem Easy
A. Multiple Knapsack Problem
B. Fractional Knapsack Problem
C. Unbounded Knapsack Problem
D. 0/1 Knapsack Problem

11 For solving the 0/1 Knapsack problem using Branch-and-Bound, how is the upper bound typically calculated for a node?

Knapsack Problem Easy
A. By adding the weights of all items without checking capacity.
B. By taking the average profit of all items.
C. By assuming all remaining items have zero weight.
D. By solving the remaining capacity using the Fractional Knapsack greedy approach.

12 What is the objective of the Traveling Salesman Problem (TSP)?

Traveling Salesman Problem Easy
A. To find a path that uses the minimum number of edges regardless of weight.
B. To visit every city exactly once and return to the starting city with the minimum total cost.
C. To visit as many cities as possible within a given distance limit.
D. To find the shortest path between two specific cities.

13 Which of the following problems is the Traveling Salesman Problem most closely related to conceptually?

Traveling Salesman Problem Easy
A. Hamiltonian Circuit
B. Knapsack Problem
C. Graph Coloring
D. Minimum Spanning Tree

14 What defines a Vertex Cover in an undirected graph?

Vertex-Cover Problem and Set-Covering Problem Easy
A. A set of edges that connects all vertices.
B. A set of vertices such that every edge in the graph is incident to at least one vertex in the set.
C. The maximum number of vertices that share no edges.
D. A cycle that covers all the vertices in the graph.

15 The standard approximation algorithm for the Vertex-Cover problem achieves what approximation ratio?

Vertex-Cover Problem and Set-Covering Problem Easy
A. 1.5
B. 3
C.
D. 2

16 What is the goal of the Set-Covering Problem?

Vertex-Cover Problem and Set-Covering Problem Easy
A. To find the maximum number of disjoint sets in a collection.
B. To find the minimum number of subsets whose union contains all elements of the universe.
C. To sort a set of elements into ascending order.
D. To cover a graph with the minimum number of edges.

17 Which common heuristic is used to approximate the Set-Covering problem?

Vertex-Cover Problem and Set-Covering Problem Easy
A. Always pick the subset with the fewest elements.
B. A Greedy approach that iteratively picks the subset covering the most remaining uncovered elements.
C. Divide and Conquer to split the universe in half.
D. Dynamic Programming to test all possible subset combinations.

18 What is the objective of the 1D Bin Packing Problem?

Bin Packing Problems Easy
A. To minimize the number of bins of fixed capacity required to hold a set of items.
B. To maximize the value of items placed in a single bin.
C. To pack items into bins such that every bin has the exact same weight.
D. To pack a set of items into a single bin of unlimited capacity.

19 Which of the following is a standard approximation algorithm for the Bin Packing Problem?

Bin Packing Problems Easy
A. Kruskal's Algorithm
B. First Fit
C. Dijkstra's Algorithm
D. Floyd-Warshall Algorithm

20 In the context of the Bin Packing Problem, what does the 'Next Fit' heuristic do?

Bin Packing Problems Easy
A. It places the item in the current bin if it fits; otherwise, it closes the current bin and opens a new one.
B. It sorts the items in decreasing order before packing them.
C. It searches all previously opened bins for the tightest fit.
D. It tries to place the item in the bin with the most empty space.

21 In the n-Queens problem solved using backtracking, how is the diagonal conflict checked for two queens placed at positions and ?

Backtracking: n-Queens Problem Medium
A.
B.
C. or
D. or

22 What is the structure of the state-space tree for the 4-Queens problem if we restrict each row to contain exactly one queen?

Backtracking: n-Queens Problem Medium
A. A 4-ary tree of depth 4
B. A binary tree of depth 4
C. A tree where each node has varying children based on column availability
D. A complete graph of 4 vertices

23 When applying backtracking to find a Hamiltonian Circuit starting at vertex , when does the algorithm successfully record a solution?

Backtracking: Hamiltonian Circuit Problem Medium
A. When a cycle of any length is detected
B. When all edges of the graph have been traversed exactly once
C. When the path contains all vertices and there is an edge from the last vertex to
D. When the path reaches length

24 During the backtracking search for a Hamiltonian Circuit, which condition causes the algorithm to backtrack from the current vertex ?

Backtracking: Hamiltonian Circuit Problem Medium
A. The graph contains a bipartite subgraph
B. Vertex has a degree greater than 2
C. Vertex is adjacent to
D. No unvisited adjacent vertex can be found from

25 Let be the total sum of all elements, and be the target sum. If the elements are sorted in non-decreasing order, which condition justifies pruning the state space tree at node with current sum ?

Backtracking: Subset-Sum Problem Medium
A. Both A and B
B. Neither A nor B
C.
D.

26 If the subset-sum problem state space is represented as a binary tree, what does a left child and a right child typically represent at depth ?

Backtracking: Subset-Sum Problem Medium
A. Left child: smaller weight, Right child: larger weight
B. Left child: substitute , Right child: add
C. Left child: include , Right child: exclude
D. Left child: stop search, Right child: continue search

27 In the branch-and-bound approach to the Assignment Problem, how is the lower bound for a given node typically calculated?

Branch-and-Bound: Assignment Problem Medium
A. By using the Hungarian algorithm to solve the subproblem exactly
B. By finding the maximum element in each row and column
C. By subtracting the smallest element in each row and each column to reduce the cost matrix
D. By computing the sum of the diagonal elements

28 Consider an assignment problem matrix. If assigning worker 1 to job 1 results in a reduced matrix with a further reduction cost of , and the initial reduction cost was , what is the lower bound of the node representing this assignment?

Branch-and-Bound: Assignment Problem Medium
A.
B.
C.
D.

29 In the branch-and-bound solution for the 0/1 Knapsack Problem, how is the upper bound typically calculated for a specific node to prune branches?

Branch-and-Bound: Knapsack Problem Medium
A. By summing the values of all remaining items
B. By solving the remaining items using the Fractional Knapsack greedy approach
C. By discarding all items that exceed the remaining capacity
D. By taking the maximum value-to-weight ratio item and multiplying it by remaining capacity

30 When using Best-First Search (Branch-and-Bound) for a maximization problem like 0/1 Knapsack, which node is selected next from the priority queue?

Branch-and-Bound: Knapsack Problem Medium
A. The node with the lowest lower bound
B. The node at the deepest level of the tree
C. The node with the highest upper bound
D. The node with the smallest weight

31 In the Branch-and-Bound algorithm for TSP using the reduced cost matrix, what constraint must be added when an edge is included in the path?

Branch-and-Bound: Traveling Salesman Problem Medium
A. Set the entire matrix to zero except for row and column
B. Subtract the cost of from all other matrix elements
C. Set row and column to infinity, and set the reverse edge to infinity
D. Set row and column to infinity

32 For a complete graph with vertices, what is the maximum number of leaves in the state-space tree for the Traveling Salesman Problem if we fix the starting city?

Branch-and-Bound: Traveling Salesman Problem Medium
A.
B.
C.
D.

33 Consider the 2-approximation algorithm for the Vertex Cover problem that picks an arbitrary edge, adds both endpoints to the cover, and removes all incident edges. Why is the approximation ratio exactly 2?

Vertex-Cover Problem and Set-Covering Problem Medium
A. Because the optimal cover must contain at least one vertex from each chosen edge, while the algorithm picks both
B. Because the graph must be an Eulerian circuit
C. Because it selects exactly two vertices for every edge in the graph
D. Because it uses a bipartite matching algorithm that doubles the edges

34 The greedy approximation algorithm for the Set-Covering problem selects the set that covers the most uncovered elements at each step. What is its approximation ratio for a universe of size ?

Vertex-Cover Problem and Set-Covering Problem Medium
A.
B.
C.
D.

35 Which of the following describes the relationship between a Minimum Spanning Tree (MST) and a Metric TSP tour?

Branch-and-Bound: Traveling Salesman Problem Medium
A. The weight of the MST is an upper bound on the optimal TSP tour weight
B. The weight of the MST is a lower bound on the optimal TSP tour weight
C. The MST always contains the optimal TSP tour as a subgraph
D. The optimal TSP tour has exactly twice the weight of the MST

36 In the context of the 1D Bin Packing Problem, what is the competitive ratio of the First-Fit algorithm compared to the optimal offline solution?

Bin Packing Problems Medium
A. Exactly 1
B. At most
C. At most 2
D. At most

37 How does the First-Fit Decreasing (FFD) heuristic improve upon the standard First-Fit algorithm for Bin Packing?

Bin Packing Problems Medium
A. It sorts the bins by their remaining capacity
B. It sorts the items in non-increasing order of their sizes before packing
C. It processes items online without needing to see all items in advance
D. It allows items to be split across multiple bins

38 Which of the following statements is true regarding the Vertex-Cover and Set-Covering problems?

Vertex-Cover Problem and Set-Covering Problem Medium
A. Vertex-Cover is a special case of the Set-Covering problem
B. Both problems can be solved in polynomial time
C. Set-Covering is a special case of the Vertex-Cover problem
D. Neither problem admits any approximation algorithm

39 Consider a 0/1 Knapsack problem with a capacity of 10. You are at a node where current weight is 6 and current profit is 40. The remaining items are Item 3 (Weight 5, Profit 30) and Item 4 (Weight 4, Profit 20). Using the fractional knapsack bound, what is the upper bound of this node?

Branch-and-Bound: Knapsack Problem Medium
A.
B.
C.
D.

40 The Next-Fit (NF) heuristic for Bin Packing maintains only one open bin at a time. What is the asymptotic approximation ratio of Next-Fit?

Bin Packing Problems Medium
A. 1
B. 2.5
C. 1.5
D. 2

41 In the -Queens problem solved using backtracking, how many distinct valid configurations exist for , considering all symmetries as separate solutions?

Backtracking: n-Queens Problem Hard
A. 4
B. 14
C. 6
D. 10

42 Which of the following bounding functions correctly prunes the search tree in a bitwise backtracking solution for the -Queens problem?

Backtracking: n-Queens Problem Hard
A. Checking if left_diagonal & right_diagonal & column equals .
B. Checking if left_diagonal + right_diagonal == column.
C. Checking if left_diagonal | right_diagonal | column contains a at the candidate position.
D. Checking if left_diagonal ^ right_diagonal ^ column is at the candidate position.

43 Consider a bipartite graph where $|U|
eq |V|$. Which of the following is true regarding the Hamiltonian Circuit Problem on $G$?

Backtracking: Hamiltonian Circuit Problem Hard
A. The backtracking algorithm will always find a circuit in time.
B. A Hamiltonian Circuit exists if the minimum degree is at least 3.
C. The problem is solvable in polynomial time if the graph is planar.
D. A Hamiltonian Circuit cannot exist.

44 When applying backtracking to find a Hamiltonian cycle in a dense graph, what is the theoretical maximum depth of the state space tree?

Backtracking: Hamiltonian Circuit Problem Hard
A.
B.
C.
D.

45 In the Subset-Sum problem for a set of elements sorted in ascending order, let be the current sum and be the sum of remaining elements. Which of the following bounding conditions strictly prunes the search space efficiently?

Backtracking: Subset-Sum Problem Hard
A. or
B.
C. or
D.

46 Given the set where , how many nodes are explored by the standard backtracking algorithm (with optimal pruning) to find the subset sum ?

Backtracking: Subset-Sum Problem Hard
A.
B.
C.
D.

47 In the Branch-and-Bound approach for the Assignment Problem using the Hungarian algorithm to compute lower bounds, what is the tightest lower bound for a node in the state-space tree?

Branch-and-Bound: Assignment Problem Hard
A. The cost of the partial assignment multiplied by the remaining dimension.
B. The sum of the minimum elements of the unassigned columns.
C. The cost of the partial assignment plus the solution to the relaxed assignment problem on the remaining matrix.
D. The sum of the minimum elements of the unassigned rows.

48 Which of the following correctly differentiates Branch-and-Bound from Backtracking in solving the Assignment Problem?

Branch-and-Bound: Assignment Problem Hard
A. Backtracking cannot be applied to optimization problems.
B. Branch-and-Bound explores the search space using BFS or Best-First Search guided by a cost bound, whereas Backtracking uses DFS.
C. Backtracking computes a heuristic lower bound at each node to prune the search space.
D. Branch-and-Bound guarantees a polynomial time complexity.

49 For the 0/1 Knapsack problem using Branch-and-Bound, let elements be sorted by descending value-to-weight ratio. How is the upper bound at a node typically calculated?

Branch-and-Bound: Knapsack Problem Hard
A. By adding the values of remaining items that fit entirely, plus the fractional value of the first item that doesn't fit.
B. By adding the maximum values of the remaining items irrespective of weight.
C. By evaluating the remaining items using dynamic programming in time.
D. By taking the sum of the values of all remaining items.

50 In a Best-First Branch-and-Bound approach for the 0/1 Knapsack Problem, what can cause the state-space tree to degenerate into an exhaustive search?

Branch-and-Bound: Knapsack Problem Hard
A. When all items have the same weight but different values.
B. When the knapsack capacity is infinitely large.
C. When all items have identical value-to-weight ratios.
D. When the items are sorted in ascending order of weights.

51 In the Branch-and-Bound solution for the Traveling Salesman Problem (TSP), a common lower bound is computed by halving the sum of the two minimum weight edges incident to each vertex. Why is this bound mathematically valid?

Branch-and-Bound: Traveling Salesman Problem Hard
A. Because the TSP tour is a collection of disjoint cycles.
B. Because it equals the weight of the Minimum Spanning Tree.
C. Because it ignores the weights of edges not in the tour.
D. Because every vertex in a TSP tour must have exactly degree 2.

52 If the cost matrix of a TSP instance satisfies the triangle inequality, how does the 1-tree relaxation bound compare to the fractional 2-factor bound?

Branch-and-Bound: Traveling Salesman Problem Hard
A. Both bounds always equal the optimal tour cost.
B. The fractional 2-factor bound is undefined for metric spaces.
C. The 1-tree bound is generally weaker or equal to the Held-Karp (fractional 2-factor) bound.
D. The 1-tree bound is always strictly greater.

53 A standard 2-approximation algorithm for Vertex-Cover selects an arbitrary edge, adds both endpoints to the cover, and removes all incident edges. What is the worst-case tight bound of this approximation ratio?

Vertex-Cover Problem and Set-Covering Problem Hard
A. Exactly
B. Exactly
C. Exactly
D. Exactly

54 Consider the greedy approximation algorithm for the Set-Covering Problem. If the size of the optimal set cover is and the universe has elements, the greedy algorithm guarantees a solution of size at most:

Vertex-Cover Problem and Set-Covering Problem Hard
A.
B.
C.
D.

55 Which of the following statements distinguishes the approximability of the Vertex-Cover problem from the Set-Covering problem?

Vertex-Cover Problem and Set-Covering Problem Hard
A. Neither problem can be approximated within a factor of .
B. Both problems admit a Fully Polynomial Time Approximation Scheme (FPTAS).
C. Vertex-Cover can be approximated within a constant factor, while Set-Cover cannot be approximated within a constant factor unless .
D. Set-Cover can be approximated within a constant factor, while Vertex-Cover cannot.

56 In the context of the Bin Packing Problem, what is the asymptotic approximation ratio of the First Fit Decreasing (FFD) heuristic?

Bin Packing Problems Hard
A.
B.
C.
D.

57 For the online Bin Packing problem, what is the competitive ratio of the Next Fit algorithm?

Bin Packing Problems Hard
A. (exactly )
B.
C.
D.

58 Consider an instance of the Bin Packing problem where all item sizes satisfy . Which algorithm is guaranteed to produce an optimal packing?

Bin Packing Problems Hard
A. Next Fit
B. Random Fit
C. No polynomial-time algorithm can guarantee optimality unless .
D. First Fit Decreasing

59 During the execution of a Branch-and-Bound algorithm for an Assignment Problem using a reduced cost matrix for bounding, suppose a node at depth has a lower bound . If a valid assignment is completed from this node, what is the minimum cost of that assignment?

Branch-and-Bound: Assignment Problem Hard
A.
B.
C.
D.

60 If the Subset-Sum Problem is modified such that elements can be negative, which standard pruning technique in the state-space tree immediately becomes invalid?

Backtracking: Subset-Sum Problem Hard
A. Pruning when the current sum exceeds the target sum .
B. Storing previously visited states to avoid redundant computation.
C. Sorting the array by absolute values.
D. Pruning when the remaining elements cannot bridge the gap to .