0% found this document useful (0 votes)
251 views

CS8451-Design and Analysis of Algorithms PDF

This document contains a question bank for the subject "Design and Analysis of Algorithms" for the fourth semester of computer science engineering. It is prepared by three professors from the Department of Computer Science and Engineering at Valliammai Engineering College. The question bank contains questions in three parts: Part A focuses on introductory concepts related to algorithm analysis including asymptotic notations, best/worst/average cases, and algorithm design steps. Part B includes more advanced questions requiring understanding, analysis, creation and evaluation of algorithms. Part C evaluates time complexities using asymptotic notations.

Uploaded by

kathirpk
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
251 views

CS8451-Design and Analysis of Algorithms PDF

This document contains a question bank for the subject "Design and Analysis of Algorithms" for the fourth semester of computer science engineering. It is prepared by three professors from the Department of Computer Science and Engineering at Valliammai Engineering College. The question bank contains questions in three parts: Part A focuses on introductory concepts related to algorithm analysis including asymptotic notations, best/worst/average cases, and algorithm design steps. Part B includes more advanced questions requiring understanding, analysis, creation and evaluation of algorithms. Part C evaluates time complexities using asymptotic notations.

Uploaded by

kathirpk
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

www.rejinpaul.

com

VALLIAMMAI ENGINEERING COLLEGE


SRM Nagar, Kattankulathur – 603 203

DEPARTMENT OF
COMPUTER SCIENCE AND ENGINEERING

QUESTION BANK

IV SEMESTER

CS8451 - DESIGN AND ANALYSIS OF ALGORITHMS


Regulation – 2017

Academic Year 2018 – 19

Prepared by

Dr. V. Dhanakoti, Associate Professor


Dr. M. Senthil Kumar, Associate Professor
Mr. N. Leo Bright Tennisson, Assistant Professor

downloaded from www.rejinpaul.com


www.rejinpaul.com

VALLIAMMAI ENGINEERING COLLEGE


SRM Nagar, Kattankulathur – 603 203.

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

QUESTION BANK
SUBJECT CODE/NAME: CS8451 DESIGN AND ANALYSIS OF ALGORITHMS

SEM / YEAR: IV/II

UNIT I - INTRODUCTION
Notion of an Algorithm – Fundamentals of Algorithmic Problem Solving – Important Problem Types –
Fundamentals of the Analysis of Algorithmic Efficiency –Asymptotic Notations and their properties. Analysis
Framework – Empirical analysis - Mathematical analysis for Recursive and Non-recursive algorithms -
Visualization
PART - A
Q.
No Questions BT Level Competence

1. Define time complexity and space complexity. Write an Remember BTL-1


algorithm for adding n natural numbers and find the space
required by that algorithm
2. List the steps to write an Algorithm Remember BTL-1

3. Illustrate an algorithm for (i) Finding factorial of n number. Apply BTL-3


(ii).Sorting the Elements.
4. Evaluate an algorithm for computing gcd(m,n) using Euclid’s Evaluate BTL-5
algorithm
5. Design the equality gcd(m,n)=gcd(n,m mod n) for every pair Create BTL-6
of positive integers m and n.
6. List out the steps that need to design an algorithm. Remember BTL-1

7. Examine an algorithm to convert a binary number to a Apply BTL-3


decimal number.
8. Identify how you will measure input size of algorithms. Remember BTL-1

9. Explain how many algorithms can you write for solving find Analyze BTL-4
the prime numbers. Compare which is the simplest and the
most efficient.
10. Explain the various types of problems that can be solved using Analyze BTL-4
algorithm.
11. Apply the common technique for proving the correctness of an Apply BTL-3
algorithm.

downloaded from www.rejinpaul.com


www.rejinpaul.com
12. Define the term Algorithm Remember BTL-1

13. Define Big ‘Oh’ notation. Remember BTL-1

14. Formulate the order of growth. Compare the order of growth n! Create BTL-6
n
and 2 .
15. Differentiate between Best, average and worst case efficiency. Understand BTL-2
16. Discuss the concepts of asymptotic notations and its properties. Understand BTL-2
17. Analyze the order of growth. Analyze BTL-4
(i).F(n) = 2n2 + 5 and g(n) = 7n. Use the Ω (g(n)) notation.
18. Evaluate the recurrence relations. Evaluate BTL-5
(i). x (n) = x (n-1) + 5 for n>1.
(ii). X (n) = x(n/3) +1 for n >1,x(1) =1. (Solve for n = 3k)
19. Discuss the General plan for analyzing efficiency of Non Understand BTL-2
recursive & Recursive algorithms
20. Discuss the following questions by consider the definition based Understand BTL-2
algorithm for adding two n by n matrices.
1. What is basic operation?
2. How many times it is performed as a function of the matrix order
n?
3. How many times it is performed as a function of the total number
of elements in the input matrices?

PART - B
1. Give the General Plan for Analyzing the Time Efficiency of
Recursive Algorithms and use recurrence to find number of moves Understand BTL-2
for Towers of Hanoi problem n (13)
2. (i) Consider the following algorithm for the searching problem. (8)
ALGORITHM Linear search (A[0,……….n-1],key)
// Searches an array for a key value by Linear search.
//Input: Array A [0…..n-1] of values and a key value to
search.
//Output: Returns index if search is successful.
For i← 0 to n-1 do
If [key== A[i])
Return i. Apply BTL-3
a) Apply this algorithm to search the list 10,
92,38,74,56,19,82,37 for a key value 74.
b) Is this algorithm efficient?
c) When can this algorithm be used?

(ii) What are the most important problem types are used to illustrate
different algorithm design techniques and methods of algorithm
analysis. (5)

downloaded from www.rejinpaul.com


www.rejinpaul.com
3. If you have to solve the searching problem for list of n numbers, Create BTL-6
how can you take advantages of the fact that the list is known to be
sorted? Give separate Answers for
i)Lists represented as arrays. (7)
ii)Lists represented as Linked lists. (6)
Create the time complexities involved in the analysis of both the
algorithms.
4. For each of the following algorithms, Analyze BTL-5
i) Compute n! (7)
ii)Asses & find the largest element in a list of n numbers with
respect to the following conditions: (6)
(a). A natural size metric for its inputs.
(b). Its basic operation.
(c). Whether the basic operation count can be different for inputs of
the same sizes.

5. (i)Discuss in detail about the worst case, best case and Understand BTL-2
Average case efficiencies of sequential search function. (7)
(ii)Discuss how much the function value will change if the
sequential search function’s argument is increased. (6)

6. (i).Compare the worst and Average case analysis of binary Analyze BTL-4
search using suitable illustrations. (8)
(ii). Explain the drawbacks in using the standard unit of time,
to measure the runtime of an algorithm(5)
7. Illustrate briefly on Big oh Notation ,Omega Notation and Evaluate BTL-3
Theta Notations .Give Examples. (13)
8. (i)Define a Mathematical analysis of recursive algorithms. (4) Remember BTL-1
(ii)Examine the efficiency of factorial of some number n with
the help of General plan. (9)
9. (i)Define a Mathematical analysis of Non-recursive algorithms. (5) Remember BTL-1
(ii) Tell about the efficiency of finding the element with
maximum value in a given Array with the help of General plan.(8)
10. (i)Define Towers of Hanoi problem. (3) Remember BTL-1
(ii)Describe the time complexity of Towers of Hanoi problem.(10)
11. Explain in detail about Analysis Framework with a suitable Analyze BTL-4
example (13)
12. Analyze the recursive and non-recursive versions of the factorial Analyze BTL-4
function.
i)Examine how much each function requires as ‘n’becomes large.
(7)
ii) Find the time complexity and space complexity (6)
13. (i) Label the algorithm of fundamental problem solving. (7) Apply BTL-1
(ii) Show the useful property involving the asymptotic notations.
(6)
14. Discuss in detail about the fundamentals of algorithmic problem Understand BTL-2
solving. (13)

downloaded from www.rejinpaul.com


www.rejinpaul.com

PART C
1. Evaluate the following equalities are correct: Evaluate BTL-5
i)5n2-6n=ϴ(n2) (4)
ii)n!=O(nn) (4)
iii)n3+106n2=ϴ(n3) (4)
iv)2n22n+n logn=ϴ(n22n) (3)
2. Evaluate the following recurrences completely Evaluate BTL-5
i ) T( ) = ∑ =1−1 (i) + 1≥ 2Given T(n) = 1 if n = 1 (5)
ii) T(n) = 5T(n-2) – 6T (n – 2) (5)
iii)T(n)=2T(n/2) + nlogn (5)
3. Design a consecutive integer checking algorithm and middle- Create BTL-6
school procedure algorithm.
4. Consider the problem of finding the smallest and largest elements Create BTL-6
in an array of n numbers.
i) Design a presorting-based algorithm for solving this problem and
determine its efficiency class (7)
ii) Compare the efficiency of the three algorithms: (8)
a)The Brute-force algorithm
b)This presorting –based algorithm and
c) The divide-and conquer algorithm.

UNIT II - BRUTE FORCE AND DIVIDE-AND-CONQUE


Brute Force – Computing an – String Matching - Closest-Pair and Convex-Hull Problems - Exhaustive
Search - Travelling Salesman Problem - Knapsack Problem - Assignment problem. Divide and Conquer
Methodology – Binary Search – Merge sort – Quick sort – Heap Sort - Multiplication of Large Integers
– Closest-Pair and Convex - Hull Problems.
PART - A
Q.No Questions BT Level Competence
1. State Master’s theorem Remember BTL-1

2. Examine a brute force algorithm for string matching problem. Apply BTL-3

3. Give an example of a text of length n and a pattern of length m Create BTL-6


that constitutes a worst case input for the brute force string
matching algorithm. Formulate and find how many character
comparisons will be made for such input.
4. Define closest pair problem. Remember BTL-1

5. Examine a brute force algorithm for counting the number of Apply BTL-3
vowels in a given text.
6. Define convex hull problem. Remember BTL-1

7. Find the number of comparisons required to search for ‘6’ in the Analyze BTL-4
given Sequence of numbers: 10, 19, 7, 9, 6, 15.

downloaded from www.rejinpaul.com


www.rejinpaul.com
8. Define the term exhaustive search. Remember BTL-1

9. Describe the concepts of Travelling Salesman Problem. Remember BTL-1

10. Define Assignment problem (Hungarian method). Remember BTL-1

11. Analyze the time efficiency and drawbacks of merge sort Analyze BTL-4
algorithm.
12. Explain the advantages and disadvantages of binary search Analyze BTL-4
algorithm.
13. Differentiate Sequential technique from binary search Understand BTL-2
technique.
14. Is merge sort stable sorting algorithm? Justify your answer. Apply BTL-3

15. Describe brute force approach. What are the advantages and Understand BTL-2
disadvantages of this approach?
16. Discuss the three processing steps in Quick sort. Understand BTL-2

17. Multiply the numbers 54 and 45. Evaluate by using Evaluate BTL-5
multiplication of Large integer concepts.
18. Give an example problem that cannot be solved by a Brute force Evaluate BTL-5
approach and also how to decide?
19. Define and design the Convex set. Invent the sets such are Create BTL-6
convex. a) Star b) Cone C) Pentagon D) Semicircle.
20. Discuss the recurrence equation for the worst case behavior of Understand BTL-2
merge sort.
PART – B
1. Explain the concepts of the following. Evaluate BTL-5
(i)Brute force string matching Algorithm. (7)
(ii)Closest pair and convex hull problems by brute force. (6)
2. (i)List out the procedures to solve travelling salesman problem. Remember BTL-1
(7)
(ii)Describe the Knapsack problem by using Exhaustive search.
(6)
3. Find and Analyze the optimal solution for the assignment Analyze BTL-4
problem given below. (13)
Job Job 1 Job 2 Job 3 Job 4
Person
Person 4 3 8 6
Person 5 7 2 4
Person 16 9 3 1
Person 2 5 3 7

4. (i) Discuss the topic on merge sort. Illustrate the algorithm with Understand BTL-2
numeric Example. Predict the complete analysis for the same.
(8)
(ii)Write the algorithm to perform Binary search and compute its
run time complexity. (5)
5. (i)Define Assignment problem .Examine the optimal solution Remember BTL-1

downloaded from www.rejinpaul.com


www.rejinpaul.com
for the assignment problem with one example. (7)
(ii)Explain convex hull problem and the solution involved
behind it. (6)
6. (i)Design a Quick sort algorithm (5) Create BTL-6
(ii) Develop Best, worst and Average case analysis for Quicksort
method. (8)
7. Examine that the procedure SEARCH of binary search algorithm Remember BTL-1
gives the Smallest possible expected search time if all elements in
the universal set are equally likely to be sought. (13)
8. (i)Solve 2138 × 4967 by applying the Divide and Conquer Apply BTL-3
method. (8)
(ii)Analyze the time and space complexity of Divide and
conquer methodology. (5)
9. (i)Apply Strassen’s matrix algorithm to compute. (7) Apply BTL-3

(ii) How to show the average time complexity for merge sort
algorithm. (6)
10. (i) Discuss in detail about the closest pair and convex hull Understand BTL-2
problems by using Divide and conquer method. (7)
(ii)Write the KMP string matching algorithm for finding a
pattern on a text, and analyze the algorithm. (6)
11. (i)Describe in detail about divide and conquer strategy. (6) Understand BTL-2
(ii)Explain the binary search with suitable example problem. (7)

12. Analyze and Write an algorithm to sort a given list of elements Analyze BTL-4
using merge sort .Show the operation of the algorithm, on the list
38,27,43,3,9,82,10. (13)

13. i)Differentiate sequential search from binary search technique. Analyze BTL-4
(7)
ii)Write an algorithm for Quicksort and write its time complexity
with example list are 5,3,1,9,8,2,4,7. (6)

14. Examine in detail about Exhaustive search techniques. (13) Remember BTL-1

PART – C
1. How exhaustive search method uses Brute force approach to Evaluate BTL-5
evaluate various problems and find whether the given string
follows the specified pattern and return 0 or 1 accordingly.
Examples:
1)Pattern “abba” input: “redblueredblue” should return 1
2)Pattern “aaaa” input: ”asdasdasdasd” should return 1
3)Pattern “aabb” input: “xyzabcxyzabc” ” should return 0

downloaded from www.rejinpaul.com


www.rejinpaul.com
2. Deduce the operation of binary search algorithm for the input Evaluate BTL-5
-15, -6 , 0, 7 , 9, 23, 54, 82, 101,112, 125,131,142,151 if you
are searching for the element 9.

3. Compose and give an example of an algorithm that should not Create BTL-6
be considered an application of the brute-force approach.

4. Formulate and give an example of a text of length n and a pattern Create BTL-6
of length m that constitutes a worst-case input for the brute-force
string-matching algorithm. Exactly how many character
comparisons will be made for such input?

UNIT III - DYNAMIC PROGRAMMING AND GREEDY TECHNIQUE

Dynamic programming – Principle of optimality - Coin changing problem, Computing a Binomial


Coefficient – Floyd‘s algorithm – Multi stage graph - Optimal Binary Search Trees – Knapsack
Problem and Memory functions. Greedy Technique – Container loading problem - Prim‘s algorithm
and Kruskal's Algorithm – 0/1 Knapsack problem, Optimal Merge pattern - Huffman Trees.
PART – A
Q.
No Questions BT Level Competence
1. How is a transportation network represented? Remember BTL-1

2. Describe the method to construct an optimal binary search tree Remember BTL-1

3. Define Transitive closure of a directed graph. Remember BTL-1

4. Describe the general principle of Greedy algorithm. Remember BTL-1

5. Compare Divide & Conquer and Dynamic Programming. Analyze BTL-4

6. Discover the pseudo code of the Warshall’s algorithm. Apply BTL-3

7. Summarize feasible and optimal solution. Understand BTL-2

8. Contrast Greedy algorithm and Dynamic programming. Analyze BTL-4

9. List the properties of Dynamic programming approach Remember BTL-1

10. Define the minimum spanning tree problem Remember BTL-1

11. Explain how the Binomial coefficient is computed. Evaluate BTL-5


Estimate the time and space complexity for Warshall’s
12. Understand BTL-2
algorithm.

Demonstrate the obstacles in constructing a minimum spanning


13. Apply BTL-3
tree by an exhaustive search.

14. Estimate the space and time complexity of a prim’s algorithm. Understand BTL-2

downloaded from www.rejinpaul.com


www.rejinpaul.com
Analyze the time complexity of optimal Binary search Tree
15. Analyze BTL-4
algorithm.
Show an algorithm to make for 1655 using the greedy strategy.
16. Apply BTL-3
The coins available are {1000, 500, 100, 50, 20, 10, 5}.
17. Distinguish prim’s and Kruskal’s algorithm. Understand BTL-2

18. Summarize Huffman trees and its applications. Evaluate BTL-5


Integrate Minimum spanning tree concepts and Prim’s
19. Create BTL-6
algorithm.
20. Develop an algorithm for memory function knapsack problem. Create BTL-6

PART - B
1. Consider the following distance network. Analyze BTL-4
a) Write the floyd’s algorithm and generate the final distance
matrix. (7)
b) Analyze the shortest path and the corresponding
distance from the source node to the destination node
as indicated in each of the cases 1-6, 5-1 and 5-2 (6)

2. i) Illustrate all-pair shortest path problem algorithm. (4) Apply BTL-3


(ii)Calculate the all-pair shortest path problem for the diagraph
with the weighted matrix given below. (9)

a b c d
a 0 α 3 α
b 2 0 α α
c Α 7 0 1
d 6 α α 0
3. (i)Describe in detail about the Warshall’s algorithm. (7) Understand BTL-2
(ii)Discuss topic on Knapsack problem with memory functions.
(6)
4. Describe and compute binomial coefficient by the formula Understand BTL-2
C(n, k) = C(n − 1, k − 1) +C(n − 1, k). (13)

5. Analyze the algorithm by applying the following keys and Analyze BTL-4

downloaded from www.rejinpaul.com


www.rejinpaul.com
probabilities to obtain the optimal binary tree. (13)

Key A B C D
Probability 0.1 0.2 0.4 0.3

6. a) Consider 4 elements a1< a2< a3< a4with q0=0.25, q1=3/16, Evaluate BTL-5
q2=q3=q4=1/16, P1=1/4, P2=1/8,P3=P4=1/16.
b) Construct the optimal binary search tree as a minimum cost
tree.
(7
)
c) Construct the table of values Wij, Cij, Vij computed by the
algorithm to compute the roots of optimal sub trees. (6)
7. Plan the following instance of the 0/1, knapsack problem given Create BTL-6
the knapsack capacity in W=5 using dynamic programming and
explain it.
(13)

Item Weight Value


1 4 $10
2 3 $20
3 2 $15
4 5 $25

8. (i)Define Huffman tree. List the types of Encoding in Remember BTL-1


Huffman tree. (8)
(ii)Write the Huffman’s algorithm. Construct the Huffman’s tree
for the following data and obtain its Huffman code. (5)

Character A B C D E
- (underscore)
Probability 0.5 0.35 0.5 0.1 0.4 0.2

9. (i)Describe minimum spanning tree using Kruskal’s algorithm Remember BTL-1


with an example.
(7)

(ii)Comparison between Prim’s and Kruskal’s algorithm and


identify the time complexity of those algorithms.
(6)

downloaded from www.rejinpaul.com


www.rejinpaul.com
10. (i)Write and analyze the prim’s algorithm. (5) Remember BTL-1

(ii)Describe minimum spanning tree using Prim’s algorithm. (8)

11. (i)List out the short notes on optimal binary search tree. Remember BTL-1
(7)

(ii) Label the optimization technique used for Warshall’s


algorithm. State the rules and assumptions which are implied
behind that. (6)
12. (i)Explain in detail about Huffman code (5) Analyze BTL-4

(ii)Let A= {l/119,m/96,c/247,g/283,h/72,f/77,k/92,j/19} be
the letters and its frequency of distribution in a text file.
Analyze a suitable Huffman coding to compress the data. (8)
13. (i) Examine Dijkstra’s algorithm with a suitable example (9) Apply BTL-3
(ii)Illustrate how the minimum-sum descent problem can be
solved by Dijkstra’s algorithm. (4)
14. Summarize Knapsack and memory functions problem in detail. Understand BTL-2
(13)

PART – C
1. Asses and solve all-pair shortest path problem for the digraph Evaluate BTL-5
with the weight matrix given below:

A B C D
A 0 ∞ ∞ 3
B 2 0 ∞ ∞
C ∞ 7 0 1
D 6 ∞ ∞ 0

downloaded from www.rejinpaul.com


www.rejinpaul.com
2. Given the mobile numeric keypad.You can only press buttons that Evaluate BTL-5
are up, left, right or down to the first number pressed to obtain the
sequent numbers.You are not allowed to press bottom row corner
buttons (i.e. * and #).Given a number N, how many key strokes
will be involved to press the given number. What is the length of
it? Which dynamic programming technique could be used to find
solution for this? Assess each step with a help of a pseudo code
and derive its time complexity.

3. Apply Warshall’s algorithm to find the transitive closure of the Create BTL-6
digraph defined by the following adjacency matrix
0 1 0 0 
0 0 1 0 
 
0 0 0 1 
 
0 0 0 0 
i) Prove that the time efficiency of Warshall’s algorithm is cubic
(7)
ii) Explain why the time efficiency of Warshall’s algorithm is
inferior to that of the traversal-based algorithm for sparse graphs
represented by their adjacency lists. (8)
4. Develop and give an example of a graph or a digraph with Create BTL-6
negative weights for which Floyd’s algorithm does not yield the
correct result. (13)

UNIT IV - ITERATIVE IMPROVEMENT


The Simplex Method - The Maximum-Flow Problem – Maximum Matching in Bipartite Graphs,
Stable marriage Problem.
PART - A
Q. BT Level Competence
No Questions
1. Summarize maximum cardinality matching. Understand BTL-2

2. Define slack and surplus variable Remember BTL-1

3. Associate Feasibility and optimality condition in simplex Understand BTL-2


method.
4. Describe Dual simplex method Remember BTL-1

5. Define Basic variable. Remember BTL-1

6. Quote extreme point theorem Remember BTL-1

7. Define Network flow and cut. Remember BTL-1

8. Differentiate Feasible and optimal solution. Analyze BTL-4

9. Define bipartite graph Remember BTL-1

downloaded from www.rejinpaul.com


www.rejinpaul.com
10. Discuss the stable marriage problem. Understand BTL-2

11. Point out the Max-flow algorithm Analyze BTL-4

12. Show the Mathematical formulation to solve a max flow Apply BTL-3
problem.
13. Summarize the steps to print all edges of minimum cut. Understand BTL-2

14. Generalize about the perfect matching in bipartite graphs. Create BTL-6

15. Compare man-optimal and woman-optimal Analyze BTL-4

16. What if the blocking pair concepts for marriage problem are Create BTL-6
chosen?
17. Show the requirements of a standard form to solve a Simplex Apply BTL-3
method problem
18. Apply Augmenting path concepts in Maximum flow problem. Apply BTL-3

19. Assess the properties of stable marriage problem (Gale shapley Evaluate BTL-5
algorithm).
20. Explain about the articulation point in a graph. Evaluate BTL-5

PART - B

1. (i)Solve the following LP problem using (8) Apply BTL-3


graphical method.
Maximize Z = 6x1 + 8x2
5x1+10x2≤ 60
4x1+4x2≤ 40
x1and x2≥ 0
(ii). Write the procedure to initialize simplex which
determines if a linear program is feasible or not (5)
2. (i)Design Extreme Point theorem and generalize how it is Create BTL-6
used to find the boundary points. (5)
(ii)Maximize the given equation. Use the Simplex method to
the linear programming problem. (8)
Max Z = 3x + 5y
Subject to x + y ≤ 8
x+ 3y≤12

3. Identify the maximum value of Z in the following LP problem Remember BTL-1


using Simplex method. (13)
Max Z = 10x1 +15x2 + 20x3
Subject to 2x1 +4x2 + 6x3≤ 24
3x1 +9x2 + 6x3≤ 30
x1 ,x2and x3≥ 0.
4. (i)Discuss the Ford-fulkerson algorithm for maximum flow Understand BTL-2
problem. (7)
(ii)Discuss the shortest –augmenting path algorithm. (6)

downloaded from www.rejinpaul.com


www.rejinpaul.com
5. (i)Apply the maximum-matching algorithm is the following Apply& BTL-3
bipartite graph. (7) Analyze

(ii) Analyze all edges that form the minimum cut, And also
analyze the maximum flow problem. (6)

6. (i)Analyze about the stable marriage algorithm. (5) Analyze BTL-4


(ii)Consider an instance of the stable marriage problem given by
the ranking matrix. (8)

A B C
α 1,3 2,2 3,1
β 3,1 1,3 2,2
γ 2,2 3,1 1,3

For each of its marriage matching’s, indicate whether it is stable


or not. For the unstable matching’s, specify a blocking pair. For
the stable matching’s indicate whether they are man-optimal,
woman-optimal or neither. (Assume that the greek and English
letters denote the man and woman respectively).
Evaluate BTL-5
7. Consider the pipe network shown as in figure showing the
flow capacities between various pairs of locations in both
ways. Find the maximal flow from node 1 to node 6. (13)

8. (i)Describe Max-flow problem. (7) Remember BTL-1


(ii)List out the procedures needed to solve the Maximum
flow problem by using matrix method. Explain each. (6)
9. (i)Prove that the stable marriage algorithm terminates after no Remember BTL-1
more than n2 iterations with a stable marriage output (8)
(ii)Identify the steps used in Stable marriage algorithm.
Which steps are used in Men propose and Woman propose in
detail. (5)

downloaded from www.rejinpaul.com


www.rejinpaul.com
10. (i)Describe the algorithm for maximum bipartite matching. (7) Understand BTL-2
(ii)Find the maximal matching for the following graph: (6)
A→{1,2,4}, B→{1},C→{2,3},D→{4,5},E→{3}.

11. Analyze and apply the maximum matching algorithm for the Analyze BTL-4
bi-partite graph. (13)
1->{5,6} 2->{5} 3 ->{4,5}
12. Examine in detail about Iterative Improvement with an Remember BTL-1
example. (13)
13. (i)Discuss about the graphical method in detail. (7) Understand BTL-2
(ii)Summarize in detail about the simplex algorithm methods.
(6)
14. Analyze and Solve the following linear programming Analyze BTL-4
problems geometrically. (7)
a. maximize 3x+y
subject to
−x + y ≤ 1
2x + y ≤ 4
x ≥ 0, y ≥ 0
b. maximize x+ 2y (6)
subject to 4x ≥ y
y≤3+x

PART – C
1. How do you compute a maximum flow for the following graph Evaluate BTL-5
using Ford-Fulkerson method?

2. Evaluate and solve the following problem using simplex method: Evaluate BTL-5
Maximize p= 2x+3y+z
Subject to
x+y+z<=40
2x+y-z>=10
-y+z>=10
where x>=0,y>=0,z>=0

3. Formulate and prove following linear programming problem Create BTL-6


in two variables using geometric interpretation:
maximize 3x + 5y
subject to
x+y≤4
x + 3y ≤ 6

downloaded from www.rejinpaul.com


www.rejinpaul.com
x ≥ 0, y ≥ 0.
4. Design an Extreme Point Theorem. Create BTL-6

UNIT V - COPING WITH THE LIMITATIONS OF ALGORITHM POWER


Lower - Bound Arguments - P, NP NP- Complete and NP Hard Problems. Backtracking – n-Queen
problem - Hamiltonian Circuit Problem – Subset Sum Problem. Branch and Bound – LIFO Search and
FIFO search - Assignment problem – Knapsack Problem – Travelling Salesman Problem -
Approximation Algorithms for NP-Hard Problems – Travelling Salesman problem – Knapsack
problem.
PART - A
Q.
No Questions BT Level Competence
1. What are tractable and non-tractable problems? Remember BTL-1

2. Compare class P and class NP. Analyze BTL-4

3. Define NP complete problem. Remember BTL-1

4. Discuss the principle of backtracking. Understand BTL-2

5. How is the accuracy of approximation algorithm measured? Evaluate BTL-5

6. Define backtracking. Remember BTL-1

7. What are the additional items required for branch and bound? Analyze BTL-4
compare backtracking technique.
8. Point out some examples of lower bound. Analyze BTL-4

9. Describe the term heuristics Remember BTL-1

10. Define Knapsack problem. Remember BTL-1

11. Discuss the term best first branch bound. Understand BTL-2

12. State whether backtracking always produces optimal Create BTL-6

13. Decide the termination point of the search path in a state Evaluate BTL-5
space tree of branch and bound algorithm.
14. Show formal definition of the n-queens problem. Apply BTL-3

15. Describe the term state space tree Understand BTL-2

16. What is Hamiltonian path? Generalize that Hamiltonian cycle Create BTL-6
is an undirected graph.
17. What does NP-hard mean? Demonstrate approximation Apply BTL-3
algorithm for NP hard problem.

downloaded from www.rejinpaul.com


www.rejinpaul.com
18. How is lower bound found by problem reduction? Remember BTL-1

19. Examine the subset sum problem. Apply BTL-3

20. Give some examples of P and NP problem. Understand BTL-2

PART - B
What is Class NP? Discuss about any five problems for which Understand BTL-2
1. no polynomial-time algorithm has been found (13)

2. (i) Evaluate the subset sum problem with set as {3, 5, 6, 7, Evaluate BTL-5
2}and the sum =15.Derive all the subsets. (6)
(ii) Evaluate the following instance of the knapsack problem y
the branch and bound algorithm.
Knapsack capacity W=10. (7)

Item Weight Value


1 4 $40
2 7 $42
3 5 $25
4 3 $12

3. (i)Identify an example for the best case input for the branch Remember BTL-1
and bound algorithm for the assignment problem (6)
(ii)Describe NP-hard and NP-completeness. (7)

4. Using Back-Tracking enumerate how can you solve the Apply BTL-3
following problems.
(i)8-queens problem. (7)
(ii)Hamiltonian circuit problem. (6)
5. (i)Discuss in detail about decision tree algorithms. (6) Understand BTL-2
(ii)Elaborate on the nearest-neighbor algorithm and
multifragment-heuristic algorithm for TSP problem (7)

6. Describe about the following. Remember BTL-1


(i) Subset sum problem. (8)
(ii)Limitations of Algorithm power. (5)
7. (i) Using an example, design and prove that satisfiability of Create BTL-6
Boolean formula in 3-conjunctive normal form I NP-
complete. (7)
(ii)Design N-queens problem for n=6. (6)
8. (i) Show that the Hamiltonian path problem reduces to the Apply BTL-3
Hamiltonian circuit problem and vice versa. (7)
(ii)Analyze the approximation algorithm for travelling
salesman problem. (6)

9. (i)Explain how to implement an algorithm for Knapsack Analyze BTL-4


problem using NP-Hard approach. (7)
(ii)Distinguish between the P and NP problems. (6)

downloaded from www.rejinpaul.com


www.rejinpaul.com
Describe about the following: Remember BTL-1
10. (i)Greedy algorithms for the knapsack problem. (4)
(ii)Twice around the tree algorithm. (4)
(iii)Multifragment-heuristic algorithm. (5)

i) Analyze and explain elaborately on recursive backtracking Analyze BTL-4


11. algorithm. (8)
ii)Explain the backtracking problem. (5)

12. There are 5 distinct numbers {1,2,5,6,8}.Identify the Remember BTL-1


combinations of these numbers such that the sum is 9.Use the
backtracking model to arrive at the solution. (13)

13. Explain in detail about assignment problem. (13) Remember BTL-4

14. Estimate the following instance of the knapsack by branch and Apply BTL-2
bound algorithm. (13)
Item Weight Values
1 10 $100
2 7 $63
3 8 $56
4 4 $12

PART – C
1. Let w={5,7,10,12,15,18,20} and m=35.Compute all possible Evaluate BTL-5
subset of w whose sum is equivalent to m. Draw the portion of
state space tree for this problem.

2. With an example, summarize how the branch and bound Evaluate BTL-5
technique is used to solve 0/1 knapsack problem.

3. Design Branch and Bound algorithm to solve the Travelling Create BTL-6
Salesman problem for the following graph.

4. Generate all permutations of A={1,2,3,4} and d=9 by Create BTL-6


backtracking.

downloaded from www.rejinpaul.com

You might also like