Hi, protonLeah,
That rule lie in following code after ELSE
Because the EstMax's weight is larger than the capacity, I can not assign EstMax to RealMax. However, after some loop that EstMax can be assigned to RealMax, thus I do not want to delete it.
For example, in a range the first maximum value is found as 35. The sum of that value's weights (Cells(Row, 9) + Cells(Column, 9)) is larger than the capacity of V1. I ignored the value of 35 and go on the loop. The second maximum value is found as 30 and it's sum of weights is smaller, so it is assigned as RealMax. When the capacity of V1 is filled up, I should begin the assignments of V2. The value of 35 will be needed now. May be, the sum of 35's wieghts is smaller than the capacity of V2.
I hope I can explain the process of the algorithm.
Thanks in advance,
Oxco
Bookmarks