Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
courses:cs211:winter2012:journals:virginia:chapter6 [2012/03/26 04:37] โ [Section 3: Segmented Least Squares: Multi-way Choices] lovellv | courses:cs211:winter2012:journals:virginia:chapter6 [2012/03/26 04:53] (current) โ [Section 4: Subset Sums and Knapsacks] lovellv | ||
---|---|---|---|
Line 26: | Line 26: | ||
Readability: | Readability: | ||
+ | |||
+ | ===== Section 4: Subset Sums and Knapsacks ===== | ||
+ | |||
+ | In this section we consider the Knapsack problem. We have a knapsack that can carry a weight of W. We also have some items with different weights and values. | ||
+ | |||
+ | We will first consider the simpler case of this problem where each item's value is the same. This problem is similar to the weighted interval problem (we know we either want an item or we don' | ||
+ | |||
+ | In the general case where each object has a distinct value v(i), the recurrence becomes Opt(i,w) = max[opt(i-1, | ||
+ | |||
+ | Readability: | ||
+ |