Comment by akoboldfrying
Comment by akoboldfrying 19 hours ago
If you greedily fill bundles by first inserting all weight-4 items (pearls, etc.) in any order into a single bundle, moving to a new bundle each time the current one gets full, then inserting all weight-1 items (sticks, etc.) in any order in the same way, the solution you get will use an optimal number of bundles, and also leave an optimal amount of free capacity in the final bundle. (It helps to notice that every bundle except the last must be completely full with no wasted space, since both 4 and 1 divide 64.)
If you do the same, but add all weight-1 items before adding all weight-4 items, you'll still get a solution using the same (optimal) number of bundles, but you may use more capacity in the final bundle than needed -- e.g., if you have 61 sticks and 1 pearl, and add them in that order, the first bundle wastes 3 slots and the second uses 4 slots (vs. no wasted space in the first bundle and just 1 slot used in the second if adding in the reverse order).
OTOH, if you mix adding items of different weights (while staying with the approach of only ever adding to the current bundle if there's room, and if not, moving to a fresh bundle) then you can arrive at a suboptimal number of bundles. E.g., adding 61 sticks, 1 pearl and 3 dirt in that order will require 3 bundles instead of the optimal 2.