Question: 1. This assignment will compare the performance of the dynamic programming approach to the Branch and Bound approach. 2. Consider the 0/1 knapsack problem. Write

 1. This assignment will compare the performance of the dynamic programming

1. This assignment will compare the performance of the dynamic programming approach to the Branch and Bound approach. 2. Consider the 0/1 knapsack problem. Write the complete programs for this knapsack problem using dynamic programming and also using branch and bound. Debug the program on small datasets The code should be robust with proper documentation 3. Using a random number generator, generate datasets of size n-1000, 2000, 3000 and all the way to 10000. The values for v, w, should be randomly generated between 1 and size of the array n. Set W as n 20 4. Run both programs on each dataset and measure the time taken to execute. Also count the number of nodes pruned by the branch and bound algorithm 5. Write a report. Include the following points and add some more of your own: a. Explain the idea behind each algorithm and explain the complexity of each. Explain how branch and bound does pruning b. Include the code with proper documentation c. Draw a graph of the running times on all the datasets d. Explain the graph. Are there any anomalies? 6. Extra Credit For extra credit of up to 5 points of the final grade, choose a problem not discussed in class. Explain the problem and the DP and BB algorithms for that

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!