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 in one row so that all can attack each other
B. Place queens on different boards with equal dimensions
C. Place queens on an board using only the main diagonal
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. Hashing
C. Binary search
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 the array is already sorted
B. Whether all elements have equal values
C. Whether a subset has a specified sum
D. Whether two subsets have equal sizes

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

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

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

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

7 What is the usual objective of the Assignment Problem?

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

8 What is maximized in the standard Knapsack Problem?

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

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 minimum-cost tour visiting every city once
C. A route that avoids returning to its start
D. A maximum-cost route using every road

11 Why are approximation algorithms used?

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

12 What does an approximation ratio describe?

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

13 What property must a vertex cover satisfy?

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

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

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

15 What is minimized in the standard Bin Packing Problem?

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

16 What do complexity classes generally group together?

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

17 What does the complexity class P contain?

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

18 What is a defining feature of problems in NP?

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

19 Which statement correctly describes an NP-Hard problem?

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

20 When is a decision problem called NP-Complete?

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

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 NP-hard
B. The problem is outside
C. The problem is NP-complete
D. The problem is in

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

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

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

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

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

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

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

NP-Complete Problems Medium
A. is not NP-hard
B. is undecidable
C. is NP-complete
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 a unique Hamiltonian circuit
B. necessarily contains an Eulerian circuit
C. necessarily contains a Hamiltonian circuit
D. necessarily has minimum degree at least

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. Only the node with bound
D. The nodes with bounds and

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 the numeric objective value and guarantees an additive error of
C. It runs pseudopolynomially in input length and returns an exact optimum when
D. It runs polynomially in input length for each fixed but may be exponential in

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 only when is maximum
C. is a minimum vertex cover and
D. is a 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 is optimal whenever the graph is connected
B. The selected cover has weight at most the LP optimum
C. The selected cover has weight at most twice the optimum
D. The selected cover has weight at most of 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 cost per newly covered element; obtain an approximation
B. Maximize newly covered elements; obtain an exact solution
C. Maximize set cardinality per cost; obtain a constant-factor approximation
D. Minimize total set cost; obtain a 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. becomes complete only for coNP
B. is also NP-complete
C. is necessarily outside NP
D. is necessarily in

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.
B. is NP-complete
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. , because every certificate can be checked efficiently
C. , because no-instances reject all certificates
D. is NP-hard, because certificates encode solutions

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

NP-Hard Hard
A. It may lie outside NP and may even be undecidable
B. It must be reducible to every problem in NP
C. It must be a decidable decision problem in NP
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-hard but not in NP
B. is NP-complete
C. is in coNP but need not be NP-hard
D. is in P because 3SAT reduces to it

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 exponential only because is encoded in binary
B. NP-completeness applies only when every number is encoded in unary
C. is pseudopolynomial because binary encoding may make exponential in input length
D. The dynamic program solves only the fractional version of Subset-Sum

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 decide the source problem in polynomial time by comparing its output with
B. It would provide only a randomized test with one-sided error
C. It would distinguish the cases only when the optimum is integral
D. It would yield a PTAS without implying an exact decision algorithm