Unit 6: Backtracking, Approximation, and Complexity Classes - Practice Quiz

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

1 What is the goal of the n-Queens Problem?

n-Queens Problem Easy
A. Place queens on different boards with equal dimensions
B. Place queens on an board using only the main diagonal
C. Place queens in one row so that all can attack each other
D. Place queens on an board so that none attack each other

2 Which technique is commonly used to solve the n-Queens Problem?

n-Queens Problem Easy
A. Merge sort
B. Binary search
C. Hashing
D. Backtracking

3 What is a Hamiltonian circuit in a graph?

Hamiltonian Circuit Easy
A. A tree that contains every graph vertex
B. A cycle that uses every edge exactly once
C. A path that starts and ends at different vertices
D. A cycle that visits every vertex exactly once

4 What does the Subset-Sum Problem ask?

Subset-Sum Problem Easy
A. Whether two subsets have equal sizes
B. Whether all elements have equal values
C. Whether the array is already sorted
D. Whether a subset has a specified sum

5 What is the main purpose of a bound in Branch and Bound?

Branch and Bound Easy
A. To estimate a node's best possible result
B. To sort all candidate solutions
C. To convert the problem into a graph
D. To guarantee that every node is expanded

6 When is a node commonly pruned in Branch and Bound?

Branch and Bound Easy
A. When it is the root node
B. When its solution is written as an array
C. When it cannot improve the current best solution
D. When it has exactly two children

7 What is the usual objective of the Assignment Problem?

Assignment Problem Easy
A. Arrange workers by their identification numbers
B. Place all jobs with a single worker
C. Assign every job to every worker
D. Assign jobs to workers at minimum total cost

8 What is maximized in the standard Knapsack Problem?

Knapsack Problem Easy
A. The total value of selected items
B. The capacity of the knapsack
C. The number of rejected items
D. The total item weight

9 In the Knapsack Problem, how many times may each item be selected?

Knapsack Problem Easy
A. Zero or one time
B. Any positive number of times
C. Exactly two times
D. Any fractional amount

10 What does the Traveling Salesman Problem seek?

Traveling Salesman Problem Easy
A. A shortest path between two fixed cities
B. A maximum-cost route using every road
C. A route that avoids returning to its start
D. A minimum-cost tour visiting every city once

11 Why are approximation algorithms used?

Approximation Algorithms Easy
A. To obtain near-optimal solutions efficiently
B. To make every input value identical
C. To remove all constraints from a problem
D. To prove every problem belongs to P

12 What does an approximation ratio describe?

Approximation Algorithms Easy
A. The number of optimal solutions available
B. The quality of an approximate solution
C. The running time of a sorting algorithm
D. The number of variables in the input

13 What property must a vertex cover satisfy?

Vertex-Cover Easy
A. It must form a cycle through every vertex
B. It must contain only isolated vertices
C. It must contain every edge of the graph
D. It must include an endpoint of every edge

14 What is the objective of the Set-Covering Problem?

Set-Covering Easy
A. Choose all subsets having the same size
B. Choose the largest subset from the universe
C. Choose the fewest subsets that cover the universe
D. Choose subsets that contain no common elements

15 What is minimized in the standard Bin Packing Problem?

Bin Packing Problems Easy
A. The number of bins used
B. The capacity of every bin
C. The weight of each item
D. The number of items packed

16 What do complexity classes generally group together?

Complexity Classes Easy
A. Algorithms producing the same output values
B. Problems with related computational requirements
C. Programs written in the same language
D. Graphs containing the same number of edges

17 What does the complexity class P contain?

P Easy
A. Problems solvable in polynomial time
B. Problems verifiable only with exponential time
C. Problems having no known algorithms
D. Problems solvable only with exponential memory

18 What is a defining feature of problems in NP?

NP Easy
A. They always require exponential space for verification
B. Their proposed solutions must be found in constant time
C. Their proposed solutions can be verified in polynomial time
D. They cannot be solved by any computational method

19 Which statement correctly describes an NP-Hard problem?

NP-Hard Easy
A. It can only be a graph problem
B. It must always belong to P
C. It must have a polynomial-time algorithm
D. It is at least as hard as every problem in NP

20 When is a decision problem called NP-Complete?

NP-Complete Problems Easy
A. When it is both in NP and NP-Hard
B. When it can be solved only by backtracking
C. When it is in P but not in NP
D. When it is NP-Hard but not in NP

21 Queens have already been placed at positions and on a board. In which column can a queen be safely placed in row without immediately attacking either queen?

n-Queens Problem Medium
A. Column
B. Column
C. Column
D. Column

22 Each list gives the column positions of queens in rows through . Which list represents a valid solution to the -Queens problem?

n-Queens Problem Medium
A.
B.
C.
D.

23 An undirected graph has vertices and edges . Which sequence forms a Hamiltonian circuit?

Hamiltonian Circuit Medium
A.
B.
C.
D.

24 For the set , which target cannot be obtained as the sum of a subset of ?

Subset-Sum Problem Medium
A.
B.
C.
D.

25 For a minimization assignment problem, a lower bound is computed by adding the minimum entry of each row while ignoring column conflicts. For the cost matrix , what is this lower bound?

Branch and Bound Medium
A.
B.
C.
D.

26 In a minimization problem, the current best complete solution has cost . Which live node can be safely pruned based only on its lower bound?

Branch and Bound Medium
A. A node with bound
B. A node with bound
C. A node with bound
D. A node with bound

27 Three workers must be assigned distinct jobs . Their cost matrix is . What is the minimum total assignment cost?

Assignment Problem Medium
A.
B.
C.
D.

28 A knapsack has capacity . Items have pairs , , , and . What is the maximum obtainable value?

Knapsack Problem Medium
A.
B.
C.
D.

29 For cities , the symmetric distances are , , , , , and . Starting at , what tour is produced by the nearest-neighbor heuristic, and what is its cost?

Traveling Salesman Problem Medium
A. , cost
B. , cost
C. , cost
D. , cost

30 A minimization algorithm has an approximation ratio of . If the optimal solution has cost , what is the largest cost guaranteed for the algorithm's solution?

Approximation Algorithms Medium
A.
B.
C.
D.

31 The standard -approximation algorithm for Vertex Cover finds a maximal matching and selects both endpoints of every matched edge. If the matching contains edges, how many vertices does the algorithm select?

Vertex-Cover Medium
A. vertices
B. vertices
C. vertices
D. vertices

32 Let and let , , , and . Which sets are selected by the greedy Set-Cover algorithm?

Set-Covering Medium
A. and
B. and
C. and
D. and

33 Bins have capacity . How many bins does First Fit Decreasing use for items with sizes ?

Bin Packing Problems Medium
A. bins
B. bins
C. bins
D. bins

34 Which relationship between standard complexity classes is known to be true?

Complexity Classes Medium
A.
B.
C.
D.

35 A decision problem has a deterministic algorithm whose running time is . What can be concluded from this information?

P Medium
A. The problem is outside
B. The problem is NP-hard
C. The problem is in
D. The problem is NP-complete

36 For the Hamiltonian Circuit decision problem, which object serves as an appropriate polynomial-size certificate for a yes-instance?

NP Medium
A. An ordering of all vertices
B. A list of all graph subsets
C. A proof of graph connectivity
D. A table of shortest paths

37 If a problem is NP-hard, which statement follows from the definition of NP-hardness?

NP-Hard Medium
A. reduces to every problem in
B. has a polynomial-time algorithm
C. Every problem in reduces to
D. has a polynomial-time verifier

38 Which pair of conditions is sufficient to classify a decision problem as NP-complete?

NP-Complete Problems Medium
A. is in and is undecidable
B. is in and is exponential
C. is in and is NP-hard
D. is in and is NP-hard

39 Suppose is NP-complete, , and belongs to . What can be concluded about ?

NP-Complete Problems Medium
A. is NP-complete
B. is undecidable
C. is not NP-hard
D. is necessarily in

40 What would follow if a deterministic polynomial-time algorithm were discovered for any one NP-complete problem?

NP-Complete Problems Medium
A.
B.
C.
D. becomes undecidable

41 In an -Queens backtracking search, queens have been placed at , , , and , where each pair denotes . Which columns are currently legal for the queen in row ?

n-Queens Problem Hard
A. Columns and
B. Columns and
C. Columns and
D. Columns and

42 Let be a simple graph with vertices. For every pair of nonadjacent vertices and , suppose . What follows from this condition?

Hamiltonian Circuit Hard
A. necessarily contains an Eulerian circuit
B. necessarily has minimum degree at least
C. necessarily contains a Hamiltonian circuit
D. necessarily contains a unique Hamiltonian circuit

43 An exact meet-in-the-middle algorithm solves Subset-Sum by dividing numbers into two equal-sized groups and generating all subset sums of each group. Ignoring polynomial factors, what are its typical time and space complexities?

Subset-Sum Problem Hard
A. time and space
B. time and space
C. time and space
D. time and space

44 A branch-and-bound algorithm minimizes an objective and currently has an incumbent solution of cost . Three live nodes have valid lower bounds , , and . If only solutions strictly better than the incumbent matter, which nodes may be pruned immediately?

Branch and Bound Hard
A. The nodes with bounds and
B. All three live nodes
C. The nodes with bounds and
D. Only the node with bound

45 For the assignment cost matrix what lower bound is obtained by first subtracting each row minimum and then subtracting each resulting column minimum?

Assignment Problem Hard
A.
B.
C.
D.

46 In a knapsack branch-and-bound node, the current solution has weight and profit , while capacity is . Remaining items, ordered by profit-to-weight ratio, are . What fractional-knapsack upper bound applies to this node?

Knapsack Problem Hard
A.
B.
C.
D.

47 For metric TSP, an algorithm doubles a minimum spanning tree, takes an Euler tour, and shortcuts repeated vertices. Which inequality justifies its approximation guarantee?

Traveling Salesman Problem Hard
A.
B.
C.
D.

48 Which statement correctly characterizes a fully polynomial-time approximation scheme for an optimization problem?

Approximation Algorithms Hard
A. It runs polynomially in input length and with a guarantee
B. It runs polynomially in input length for each fixed but may be exponential in
C. It runs polynomially in the numeric objective value and guarantees an additive error of
D. It runs pseudopolynomially in input length and returns an exact optimum when

49 Let be any maximal matching in an unweighted graph, and let contain both endpoints of every edge in . Which statement is always true?

Vertex-Cover Hard
A. is independent and
B. is a vertex cover and
C. is a vertex cover only when is maximum
D. is a minimum vertex cover and

50 For weighted Vertex-Cover, consider the LP relaxation with for every edge and . If all vertices satisfying are selected, what guarantee follows?

Vertex-Cover Hard
A. The selected cover has weight at most of optimum
B. The selected cover is optimal whenever the graph is connected
C. The selected cover has weight at most the LP optimum
D. The selected cover has weight at most twice the optimum

51 For weighted Set-Cover on universe , which greedy rule and worst-case guarantee form the standard approximation algorithm?

Set-Covering Hard
A. Minimize total set cost; obtain a approximation
B. Maximize newly covered elements; obtain an exact solution
C. Minimize cost per newly covered element; obtain an approximation
D. Maximize set cardinality per cost; obtain a constant-factor approximation

52 Bins have capacity , and item sizes are . What are, respectively, the numbers of bins used by First-Fit Decreasing and by an optimal packing?

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

53 Assume . If is NP-complete under polynomial-time many-one reductions, which conclusion is necessarily valid?

Complexity Classes Hard
A. is necessarily in
B. becomes complete only for coNP
C. is necessarily outside NP
D. is also NP-complete

54 A language has a deterministic polynomial-time verifier, and every certificate has length at most for a constant , where is the input length. Which classification follows unconditionally?

P Hard
A. is NP-complete
B.
C.
D. is NP-hard but undecidable

55 Suppose a decision language has polynomial-length certificates verifiable in deterministic polynomial time for every yes-instance. What can be concluded from this fact alone?

NP Hard
A. , but neither membership in P nor NP-hardness follows
B. is NP-hard, because certificates encode solutions
C. , because no-instances reject all certificates
D. , because every certificate can be checked efficiently

56 Which statement about an NP-hard problem under polynomial-time many-one reductions is correct?

NP-Hard Hard
A. It must be reducible to every problem in NP
B. It must be a decidable decision problem in NP
C. It may lie outside NP and may even be undecidable
D. It must have polynomially verifiable yes-certificates

57 A decision problem satisfies , and has a polynomial-time verifier with polynomial-length certificates. What is the strongest justified conclusion?

NP-Complete Problems Hard
A. is NP-complete
B. is in P because 3SAT reduces to it
C. is NP-hard but not in NP
D. is in coNP but need not be NP-hard

58 To reduce Hamiltonian Circuit on an -vertex graph to metric-free TSP decision, construct a complete graph with edge weight for edges of and weight for nonedges. Which threshold makes the reduction correct?

Traveling Salesman Problem Hard
A. A tour of cost at most
B. A tour of cost at most
C. A tour of cost at most
D. A tour of cost at most

59 Subset-Sum has a dynamic program running in time, where is the target, yet its decision version is NP-complete. Which explanation resolves this apparent contradiction?

Subset-Sum Problem Hard
A. is pseudopolynomial because binary encoding may make exponential in input length
B. is exponential only because is encoded in binary
C. The dynamic program solves only the fractional version of Subset-Sum
D. NP-completeness applies only when every number is encoded in unary

60 For a minimization problem, a polynomial reduction creates instances satisfying: yes-instances have , while no-instances have , for a fixed . What would a polynomial-time -approximation imply?

Approximation Algorithms Hard
A. It would provide only a randomized test with one-sided error
B. It would distinguish the cases only when the optimum is integral
C. It would decide the source problem in polynomial time by comparing its output with
D. It would yield a PTAS without implying an exact decision algorithm