
















































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

















































j
j
n + 1 1 Value 18 22 28 1 Weight 5 6 6 2 7 Item 1 3 4 5 2 ∅ { 1, 2 } { 1, 2, 3 } { 1, 2, 3, 4 } { 1 } { 1, 2, 3, 4, 5 } 0 0 0 0 0 0 0 1 0 1 1 1 1 1 2 0 6 6 6 1 6 3 0 7 7 7 1 7 4 0 7 7 7 1 7 5 0 7 18 18 1 18 6 0 7 19 22 1 22 7 0 7 24 24 1 28 8 0 7 25 28 1 29 9 0 7 25 29 1 34 10 0 7 25 29 1 35 11 0 7 25 40 1 40 W + 1 W = 11 OPT: { 4, 3 } value = 22 + 18 = 40
i
i
i
i
1
2
k
1
2
k
If X[i] > X[j] then L[i] + 1 = 1 + 1 = 2 is this > L[i] yes L[i] = 2 move j to next position and check again
1
2
k
If X[i] > X[j] then L[i] + 1 = 1 + 1 = 2 is this > L[i] yes L[i] = 2 move j to next position and check again
1
2
k
If X[i] > X[j] then L[i] + 1 = 1 + 1 = 2 is this > L[i] yes L[i] = 2 move j to next position and check again