analysis and design of algorithm paper 2

Embed Size (px)

Citation preview

  • 8/3/2019 analysis and design of algorithm paper 2

    1/2

    ~-0::1-00 .->.

  • 8/3/2019 analysis and design of algorithm paper 2

    2/2

    ~ , ., - ~-

    06CS436 a. With the help of pseudocode, explainMarshall's algorithm to find the transitive closure of adirected graph. Apply it to the graph shown below: (10Marks)

    Fig. Q6(a)b. Find the minimum spanning tree, using Prim's method for the graph shown below:

    (10Marks)7 a. Find the single source shortest paths. Apply the Dijkstra's algorithm to Fig. Q7(a),to get theshortest path formthe vertex to all the other vertices.

    Fig. Q7(a) (10Marks)b. Write a bottom-up dynamic algorithm for the knapsack problem. Apply it on the followinginstance of the knapsack problem. (10Marks)

    '\

    Table Q7(b)8 a. Define P, NP and NP complete problem. (04Marks)b. Explain how the TSP problem can be solved using branch and bound methods. (06Marks)c. Explain the back - traching algorithm.Apply the same to solve the following instanceof thesubset sum problems = {5, 10, 12, 13, 15, 18} and d = 30. (10Marks)

    *****

    20f2

    Item Weight Value1 2 32 3 43 4 54 5 6