CT243 lab5


http://geminga.it.nuigalway.ie/~gettrick/courses/CT243/labs/l5.html



In this lab we re-visit the Knapsack problem of Lab 4, to solve it using the dynamic programming technique. We have fifteen (15) items with weights [12,17,5,3,17,10,14,10,9,4,2,25,21,11,37] (in Kg) and values [36,50,12,10,55,27,45,30,25,13,5,50,70,34,110] (in euro) respectively. (You can call these items A, B, C, ...,O if you want....) There is only one of each item.

  1. Let the bag/knapsack capacity K be 63 Kg. Write a program/function in VB .net using
    1. iteration
    2. recursion
    to solve this problem (i.e. decide which items to put in to the bag to achieve maximum value) using dynamic programming.
  2. Modify your recursive solution to calculate how many times the recursive function is called, and present this as output along with the answer.


© NUI, Galway