You are on page 1of 4

UNIT-5

BACKTRACKING
2 MARKS QUESTIONS
1) What is Backtracking?
A. As the name suggests we backtrack to find the solution. We start with one possible move
out of many available moves and try to solve the problem.If we are able to solve the problem
with the selected move,then we will print the solution else we will backtrack and select some
other move and try to solve it. If none if the moves work out we will claim that there is no
solution for the problem.
Example: N-Queens problem
2) Write a generalised algorithm for Backtracking?
A) Pick a starting point
while (Problem is not solved)
For each path from the starting point
check if selected path is safe
and make recursive call to the rest of the problem.
If recursive calls returns true, then return true.
else undo the current move and return false.
End For
If none of the move works out, return False ,NO SOLUTION.
3) What are explicit constraints in Backtracking?
A. These are the rules which restrict each xi to take on the values from a given set
Example: In N-Queens problem the N-Queens can be placed in nxn chessboard.
4) What are implicit constraints in Backtracking?
A. These are the rules which of the tuples in the solution space satisfy the criterion function.
Example: In N-Queens problem implicit constraints are no two queens placed in same
row same column and diagonal
.

5) What is State Space Tree? Or How to represent solution in Backtracking?


A. If we represent solution phase in the form of tree then the tree is referred as State Space
Tree.
6) Give the applications of Backtracking?
A. The applications of Backtracking are
1. Sum of Subsets problem
2. Hamiltonian problem
7) What is Sum of Subsets problem?
A. If there are n positive numbers given in a set, then the desire is to find all possible subsets
of this set , whose contents add onto a predefined value M.
8) What is a Hamiltonian circuit?
A. Hamiltonian circuit:
It is a round trip path along n edges of graph G that visits every vertex once and
returns to its starting point.
9) What is Branch and Bound?
A. Branch and bound is a systematic method for solving optimization problems. B&B is a
rather general optimization technique that applies where the greedy method and dynamic
programming fail. The general idea of B&B is a BFS-like search for the optimal solution,
but not all nodes get expanded . Rather, a carefully selected criterion determines which node
to expand and when, and another criterion tells the algorithm when an optimal solution has
been found.
Example: Travelling Sales Problem.
10) What are the searching strategies in Branch and Bound?
A. The Branch and Bound searches a State Space Tree using mechanisms such as :
1. FIFO
2. LIFO
3. LC Search(Least Cost Search)
11) What is assignment problem?
A. The goal of the assignment problem is to minimize the cost or time of completing a
number of jobs by a number of persons. An important characteristic of the assignment

problem is the number of sources is equal to the number of destinations .It is explained in the
following way.
1. Only one job is assigned to person.
2. Each person is assigned with exactly one job.
Ex: A manager has five persons for five separate jobs and the cost of assigning each job to
each person is given. His goal is to assign one and only job to each person in such a way that
the total cost of assignment is minimized.
12) What are the types in Assignment problems?
A. The Assignment problem is of further two types
1. Balanced Assignment problem(sources=destinations)
2. Unbalanced Assignment problem(sources destinations). So, here a dummy source or
destination is created. Dummy variable have zero cost.

13) Define Reduced Cost Matrix(RCM) in TSP?


A. The first step in a branch and bound solution is to find the reduced cost matrix. The
reduced cost matrix gives the additional cost of including an edge in the tour relative to a
lower bound. The lower bound is computed by taking the sum of the cheapest way to enter
and leave each city.
14) Compare Backtracking and Branch & Bound?
A. Similarity:
Both use State Space Tree.
Difference:
The Branch & Bound algorithm doesnt limit us to any particular way of traversing
the tree and is used only for optimization problems.
The Backtracking requires DFS traversal and is used for non-optimization problems.
15) Given the terminology of State Space Tree?
A. Live Node:
A node which has been generated and all of whose children arenot yet been generated.
E-Node: Node being expanded
The live node whose children are currently being generated.
Dead Node:
A node that is either not to be expanded further or for which all of its children have been
generated.

16) Why assignment problem and TSP are applications of Branch and Bound?
17) To which problems Branch and Bound is applicable and why?

You might also like