- #1
Sypha
- 1
- 0
Hi all,
Im having trouble making a general algorithm for what at first glance appears to be a simple problem. If I have a volume (V) that can be made from two smaller, different volumes how can I decide which volumes to use to get the minimum wastage? So for example if V(required)=300 and my smaller volumes are 60 and 150, one would use 2*150. If V(required) was 240 one would use 4*60. If however V(required) is 330 one would use 1*150+(3*60); finally if V(required)=250 one would use 1*150+(2*60) with 20units wastage. Is there a way to decide on the best combination for a given volume and two smaller, given volumes for the general case, minimizing wastage?
Thanks
Im having trouble making a general algorithm for what at first glance appears to be a simple problem. If I have a volume (V) that can be made from two smaller, different volumes how can I decide which volumes to use to get the minimum wastage? So for example if V(required)=300 and my smaller volumes are 60 and 150, one would use 2*150. If V(required) was 240 one would use 4*60. If however V(required) is 330 one would use 1*150+(3*60); finally if V(required)=250 one would use 1*150+(2*60) with 20units wastage. Is there a way to decide on the best combination for a given volume and two smaller, given volumes for the general case, minimizing wastage?
Thanks