Reg. No:
SNS College of Technology, Coimbatore-35.
(Autonomous)
B.E/B.Tech- Internal Assessment -III
Academic Year 2016-2017(Even)
Fourth Semester
Computer Science and Engineering
IT204 – Design and Analysis of Algorithms
B
(Common to CSE & IT)
Time: 11/2 Hours
Maximum Marks: 50
Answer All Questions
PART - A (5 x 1 = 5 Marks)
1.
2.
Simplex method starts with
a) Exception point
b) Extreme point
c) Essential point
d) a &b
________is a flow that satisfies the capacity constraints but not the flow-conservation
requirement.
a) Post flow
b) Pivot flow
d) None of the above
c) Pre flow
3.
Name the design strategy which stops the execution when it find the solution
otherwise starts the problem from top
b) Branch and Bound
a) Backtracking
c) Divide and Conquer
d) Dynamic Programming
4.
Time complexity of 4-queen problem
5.
a) O(|V|)
b) O(|E|)
d) O(|V2|)
c) O(|V|+|E|)
Graph Coloring is which type of algorithm design strategy
b) Divide and Conquer
a) Back tracking
c) Branch and Bound
d) Dynamic Programming
PART-B (5 x 2=10 Marks)
6.
List out the applications of Iterative improvement
Ans:
Simplex method
1
Ford Fulkerson maximum flow problem
Maximum matching in bipartite graphs
Gale Shapely algorithm for stable marriage problem
7. Define Simplex method
Ans:
Start with a feasible solution
Repeat the following step until no improvement can be found:
Change the current feasible solution to a feasible solution with a better value
of the objective function
Return the last feasible solution as optimal
8. Define P and NP
Ans:
P is the class of decision problems that can be solved by a deterministic polynomial
algorithm.
NP is the class of decision problem that can be solved by a non-deterministic
polynomial algorithm.
9. List out some problems which are solved using backtracking algorithm.
Ans:
8- Queens problem
Hamiltonian problem
Knapsack problem
10. Define Traveling salesperson problem.
Ans:
The Branch and Bound strategy divides a problem to be solved into a number of subproblems. It is a system for solving a sequence of sub problems each of which may
have multiple possible solutions and where the solution chosen for one sub-problem
may affect the possible solutions of later sub-problems.
PART-C (14+14+7=35 Marks)
11. a)
Apply the shortest augmenting path algorithm to find a maximum flow in 14
the following network.
Solution: Max flow value for first network=10
2
(or)
b)
Apply the maximum matching algorithm to the following bipartite graphs
14
Solution:
12. a)
Solve the travelling salesperson problem for the following graph using 14
branch-and-bound algorithm.
Solution:
abcda
acdba
(or)
b)
Explain the Assignment problem in Branch and bound with Example.
14
Ans:
The problem of assigning n people to n jobs so that the total cost of the
assignment is as small as possible.
3
Recall that an instance of the assignment problem is specified by an n × n
cost matrix C so that we can state the problem as follows:
Select one element in each row of the matrix so that no two selected
elements are in the same column and their sum is the smallest possible.
We will demonstrate how this problem can be solved using the branch-andbound technique by considering the same small instance of the problem
A linearly ordered set of persons P={P1, P2, …, Pn} where P1<P2<…<Pn
A partially ordered set of jobs J={J1, J2, …, Jn}
Suppose that Pi and Pj are assigned to jobs f(Pi) and f(Pj) respectively. If
f(Pi) £ f(Pj), then Pi £ Pj. Cost Cij is the cost of assigning Pi to Jj. We want
to find a feasible assignment with the min. cost. i.e.
Minimize
åi,j
CijXij,
where Xij = 1 if Pi is assigned to Jj and Xij = 0 otherwise.
Example:
A Partial Ordering of Jobs
After topological sorting, one of the following topologically sorted
sequences will be generated:
One of feasible assignments:
P1→J1, P2→J2, P3→J3, P4→J4
Cost matrix:
4
A Cost Matrix for a Personnel Assignment Problem
Reduced cost matrix:
subtract a constant from each row and each column respectively such that
each row and each column contains at least one zero.
A Reduced Cost Matrix
13. a)
Total cost subtracted: 12+26+3+10+3 = 54
This is a lower bound of our solution.
C =
Solve 8-Queen problem with procedure using Backtracking method.
7
(or)
b)
Explain the knapsack problem using approximation algorithm with example 7
***** ALL THE BEST ******
Prepared by
Verified by
5
HoD/Dean
© Copyright 2026 Paperzz