Datta Meghe Institute of Engineering, Technology & Research, Sawangi (M), Wardha Assignment No.2
Datta Meghe Institute of Engineering, Technology & Research, Sawangi (M), Wardha Assignment No.2
2
Branch: Computer Science & Engg. Year/Sem: Third Year/ Sixth Sem
45 30 25
4 5
40 35
50
3
35 20
6
15
4) Explain the Floyd Warshalls Algorithm and implement the same on the following graph. (6)
1 4
5) Implement TSP on following matrix. Generate the path and cost of optimal path if source vertex is 2. 0 10 15 20 5 0 9 10 6 13 0 12 8 8 9 0
6) Using principle of Dynamic programming write an algorithm for chained Matrix multiplication. A = 5 x 13, B = 13 x 7, C= 7 x 89, D = 89 x 3 7) What is multistage graph? Write algorithm for backward method. Find the path between source and destination by applying backward algorithm on following graph. (
2 1 3 6 4 9 5 8 7 10 0
8) Explain three differences between greedy and divide and conquer method. 9) Write an algorithm for Longest Common Subsequence & implement LCS on the following strings: strings: X: VAIBHAV Y: BHAVANA 10) What is significance of Optimal Binary Search tree (OBST)? For the following probabilities draw the OBST by generating W, e, and r matrices. Also find the cost of OBST. Write an algorithm to construct the three matrices. (7) Probabilities: i 0 Pi Qi --0.05
1 0.10 0.05
2 0.15 0.10
3 0.10 0.05
4 0.15 0.05
5 0.10 0.10
Datta Meghe Institute of Engineering, Technology & Research, Sawangi(M),Wardha Assignment No.3
Branch: Computer Science & Engg. Year/Sem: Third Year/ Sixth Sem
2) Using backtracking generates Hamilton cycle on the following graph. Write algorithm for
same. Explain how one cycle can be modified into multiple cycles. (6)
1 2 3 4
3) What is backtracking? Give the at least two solutions for 8-Queens problem and write algorithm for the same & also explain the implicit and explicit constraints associated with it. 4) Explain giving suitable example P , NP, NP-C, NP-H problem and give the relation between them. 5) Explain the following NP problems w.r.t. graph i) Clique ii) Graph portioned into triangle iii) Independent set problem