Can a decision tree algorithm minimize wastage for given volumes?

Sypha
Messages
1
Reaction score
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
 
Mathematics news on Phys.org
I seem to recall that a good general solution is to fit in as many of the larger as you can and then fill will as many smaller as needed. This will not be the best solution in every possible case, though, so it's NOT a generic optimization solution.
 
To check that an exact solution exists, if either of the smaller volumes are not a multiple of V then you're dealing with a linear diophantine equation that is restricted to positive solutions. You can run an algorithm that follows that procedure, otherwise I'd use a brute force method that follows phinds' suggestion to find the best solution.

Don't forget to divide through by g=gcd(v_1,v_2) if g|V where v1,v2 are the smaller volumes. This would cut down a lot of computational time.
 
Insights auto threads is broken atm, so I'm manually creating these for new Insight articles. In Dirac’s Principles of Quantum Mechanics published in 1930 he introduced a “convenient notation” he referred to as a “delta function” which he treated as a continuum analog to the discrete Kronecker delta. The Kronecker delta is simply the indexed components of the identity operator in matrix algebra Source: https://www.physicsforums.com/insights/what-exactly-is-diracs-delta-function/ by...
Fermat's Last Theorem has long been one of the most famous mathematical problems, and is now one of the most famous theorems. It simply states that the equation $$ a^n+b^n=c^n $$ has no solutions with positive integers if ##n>2.## It was named after Pierre de Fermat (1607-1665). The problem itself stems from the book Arithmetica by Diophantus of Alexandria. It gained popularity because Fermat noted in his copy "Cubum autem in duos cubos, aut quadratoquadratum in duos quadratoquadratos, et...
I'm interested to know whether the equation $$1 = 2 - \frac{1}{2 - \frac{1}{2 - \cdots}}$$ is true or not. It can be shown easily that if the continued fraction converges, it cannot converge to anything else than 1. It seems that if the continued fraction converges, the convergence is very slow. The apparent slowness of the convergence makes it difficult to estimate the presence of true convergence numerically. At the moment I don't know whether this converges or not.

Similar threads

Back
Top