0% found this document useful (0 votes)
11 views11 pages

Module 5 Very Important Questions This Questions Are Not Available in Model Question Paper

Uploaded by

SHASHI N
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views11 pages

Module 5 Very Important Questions This Questions Are Not Available in Model Question Paper

Uploaded by

SHASHI N
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

MODULE V

1. What is Decision tree? Obtain decision tree to find minimum of three numbers(8)
2. With the help of a state space tree, solve the following salesman problem for graph
given using branch and bound algorithm (8)

3. Solve the following instances of assignment problem using branch and bound(10)

4. Apply backtracking to the problem of finding a Hamiltonian circuit in the graph


shown below(8)
Module V

1. What is Decision tree? Obtain decision tree to find minimum of three numbers (8)

 Each internal node of a binary decision tree represents a key comparison indicated in
the node,e.g., k < k.
 The node’s left subtree contains the information about subsequent comparisons made
if k < k, and its right subtree does the same for the case of k >k
 Each leaf represents a possible outcome of the algorithm’s run on some input of size
n. Note that the number of leaves can be greater than the number of outcomes because,
for some algorithms, the same outcome can be arrived at through a different chain of
comparisons.
 An important point is that the number of leaves must be at least as large as the
number of possible outcomes

 The algorithm’s work on a particular input of size n can be traced by a path from the
root to a leaf in its decision tree, and the number of comparisons made by the
algorithm on such a run is equal to the length of this path.
 Hence, the number comparisons in the worst case is equal to the height of the
algorithm’s decision tree
 The central idea behind this model lies in the observation that a tree with a given
number of leaves, which is dictated by the number of possible outcomes, has to be tall
enough to have that many leaves. Specifically, it is not difficult to prove that for any
binary tree with l leaves and height h,
h ≥ [log2 l]
 A binary tree of height h with the largest number of leaves has all its leaves on the
last level. Hence, the largest number of leaves in such a tree is 2h
2. With the help of a state space tree, solve the following salesman problem for graph
given using branch and bound algorithm (8)

Solution
Problem: Given n cities, the salesman start at specified city and visit all n-1 cities exactly only
once and return back to the starting city
Objective: The total cost of the tour should be minimum
Step1:

Step2:
Step3:
Step 4:

Step 5:

Final State Space Tree


3. Solve the following instances of assignment problem using branch and bound(10)

Solution
4. Apply backtracking to the problem of finding a Hamiltonian circuit in the graph
shown below(8)

Hamiltonian Circuit/Cycle:

Solution

 The first component of our future solution, if it exists, is a first intermediate vertex of
a Hamiltonian circuit to be constructed.
 Using the alphabet order to break the three-way tie among the vertices adjacent to a,
we select vertex b.
 From b, the algorithm proceeds to c, then to d, then to e, and finally to f, which
proves to be a dead end.
 So the algorithm backtracks from f to e, then to d, and then to c, which provides the
first alternative for the algorithm to pursue.
 Going from c to e eventually proves useless, and the algorithm has to backtrack from
e to c and then to b. From there, it goes to the vertices f , e, c, and d, from which it
can legitimately return to a, yielding the Hamiltonian circuit a, b, f , e, c, d, a.
 If we wanted to find another Hamiltonian circuit, we could continue this process by
backtracking from the leaf of the solution found.

You might also like