Unit 5 - Practice Quiz

CSE408 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 capture all queens on the chessboard using a single knight.
B. To find the shortest path for a queen to traverse the entire board.
C. To place queens on an chessboard such that no two queens attack each other.
D. To place queens on a chessboard such that they cover all the squares.

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 in adjacent squares only.
B. Being in the same row, column, or diagonal.
C. Being exactly an -shape apart like a knight.
D. Being placed on the same color square.

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

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

4 What is a Hamiltonian Circuit in a graph?

Hamiltonian Circuit Problem Easy
A. A path that visits every edge exactly once and returns to the starting vertex.
B. A tree that connects all the vertices in a graph with minimum total edge weight.
C. The shortest path between a designated source and destination.
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. Backtracking
B. Greedy Method
C. Divide and Conquer
D. Dynamic Programming

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

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

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

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

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. Branch-and-Bound is generally used for optimization problems and uses a bounding function, while Backtracking is used for finding all solutions.
C. Backtracking is only for graphs, while Branch-and-Bound is only for trees.
D. Backtracking uses a bounding function, while Branch-and-Bound does not.

9 What is the objective of the Assignment Problem?

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

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 assuming all remaining items have zero weight.
C. By taking the average profit of all items.
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 visit every city exactly once and return to the starting city with the minimum total cost.
B. To find a path that uses the minimum number of edges regardless of weight.
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. Minimum Spanning Tree
B. Hamiltonian Circuit
C. Knapsack Problem
D. Graph Coloring

14 What defines a Vertex Cover in an undirected graph?

Vertex-Cover Problem and Set-Covering Problem Easy
A. A set of vertices such that every edge in the graph is incident to at least one vertex in the set.
B. A set of edges that connects all vertices.
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.
B. 3
C. 1.5
D. 2

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

Vertex-Cover Problem and Set-Covering Problem Easy
A. To find the minimum number of subsets whose union contains all elements of the universe.
B. To sort a set of elements into ascending order.
C. To find the maximum number of disjoint sets in a collection.
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. Dynamic Programming to test all possible subset combinations.
B. A Greedy approach that iteratively picks the subset covering the most remaining uncovered elements.
C. Always pick the subset with the fewest elements.
D. Divide and Conquer to split the universe in half.

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

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

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

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

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

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

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. or
B.
C. or
D.

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 tree where each node has varying children based on column availability
B. A 4-ary tree of depth 4
C. A binary tree of depth 4
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 all edges of the graph have been traversed exactly once
B. When the path reaches length
C. When the path contains all vertices and there is an edge from the last vertex to
D. When a cycle of any length is detected

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. No unvisited adjacent vertex can be found from
B. Vertex is adjacent to
C. Vertex has a degree greater than 2
D. The graph contains a bipartite subgraph

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. Neither A nor B
B.
C.
D. Both A and B

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: include , Right child: exclude
B. Left child: stop search, Right child: continue search
C. Left child: substitute , Right child: add
D. Left child: smaller weight, Right child: larger weight

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 subtracting the smallest element in each row and each column to reduce the cost matrix
B. By using the Hungarian algorithm to solve the subproblem exactly
C. By computing the sum of the diagonal elements
D. By finding the maximum element in each row and column

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 discarding all items that exceed the remaining capacity
C. By taking the maximum value-to-weight ratio item and multiplying it by remaining capacity
D. By solving the remaining items using the Fractional Knapsack greedy approach

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 smallest weight
B. The node with the lowest lower bound
C. The node at the deepest level of the tree
D. The node with the highest upper bound

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. Subtract the cost of from all other matrix elements
B. Set row and column to infinity
C. Set the entire matrix to zero except for row and column
D. Set row and column to infinity, and set the reverse edge 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 it selects exactly two vertices for every edge in the graph
C. Because the graph must be an Eulerian circuit
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 MST always contains the optimal TSP tour as a subgraph
B. The optimal TSP tour has exactly twice the weight of the MST
C. The weight of the MST is a lower bound on the optimal TSP tour weight
D. The weight of the MST is an upper bound on the optimal TSP tour weight

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. At most
B. At most 2
C. At most
D. Exactly 1

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 items in non-increasing order of their sizes before packing
B. It processes items online without needing to see all items in advance
C. It sorts the bins by their remaining capacity
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. Both problems can be solved in polynomial time
B. Neither problem admits any approximation algorithm
C. Set-Covering is a special case of the Vertex-Cover problem
D. Vertex-Cover is a special case of the Set-Covering problem

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. $40$
B. $70$
C. $64$
D. $90$

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. 2
B. 2.5
C. 1
D. 1.5

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. 6
B. 10
C. 4
D. 14

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 is $0$ at the candidate position.
B. Checking if left_diagonal | right_diagonal | column contains a $1$ at the candidate position.
C. Checking if left_diagonal + right_diagonal == column.
D. Checking if left_diagonal & right_diagonal & column equals $0$.

43 Consider a bipartite graph where $|U|
eq |V|G$?

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

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 sum of the minimum elements of the unassigned rows.
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 cost of the partial assignment multiplied by the remaining dimension.

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 computes a heuristic lower bound at each node to prune the search space.
B. Backtracking cannot be applied to optimization problems.
C. Branch-and-Bound guarantees a polynomial time complexity.
D. Branch-and-Bound explores the search space using BFS or Best-First Search guided by a cost bound, whereas Backtracking uses DFS.

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 taking the sum of the values of all remaining items.
B. By adding the values of remaining items that fit entirely, plus the fractional value of the first item that doesn't fit.
C. By evaluating the remaining items using dynamic programming in time.
D. By adding the maximum values of the remaining items irrespective of weight.

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 all items have identical value-to-weight ratios.
C. When the knapsack capacity is infinitely large.
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 every vertex in a TSP tour must have exactly degree 2.
B. Because it ignores the weights of edges not in the tour.
C. Because it equals the weight of the Minimum Spanning Tree.
D. Because the TSP tour is a collection of disjoint cycles.

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 1-tree bound is generally weaker or equal to the Held-Karp (fractional 2-factor) bound.
C. The 1-tree bound is always strictly greater.
D. The fractional 2-factor bound is undefined for metric spaces.

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 $1$
B. Exactly
C. Exactly
D. Exactly $2$

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. $2$
C.
D.

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

Bin Packing Problems Hard
A. $2$
B. $1$
C. $1.5$
D. $1.7$ (exactly )

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. No polynomial-time algorithm can guarantee optimality unless .
C. Random Fit
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. Sorting the array by absolute values.
B. Pruning when the remaining elements cannot bridge the gap to .
C. Pruning when the current sum exceeds the target sum .
D. Storing previously visited states to avoid redundant computation.