Can a decision tree algorithm minimize wastage for given volumes?

Click For Summary
SUMMARY

The discussion focuses on utilizing decision tree algorithms to minimize wastage when combining two smaller volumes to meet a required volume (V). The example provided illustrates how to achieve optimal combinations, such as using two 150 units for V=300 and four 60 units for V=240. The conversation highlights that while a heuristic approach of maximizing the larger volume first can be effective, it is not universally optimal. For precise solutions, participants recommend using linear diophantine equations and suggest implementing a brute force method for finding the best combinations, along with the importance of dividing by the greatest common divisor (gcd) of the smaller volumes to enhance computational efficiency.

PREREQUISITES
  • Understanding of decision tree algorithms
  • Knowledge of linear diophantine equations
  • Familiarity with the concept of greatest common divisor (gcd)
  • Basic programming skills for implementing algorithms
NEXT STEPS
  • Research linear diophantine equations and their applications in optimization
  • Learn about decision tree algorithms and their implementation in Python
  • Explore brute force methods for combinatorial optimization problems
  • Study the impact of gcd on computational efficiency in algorithm design
USEFUL FOR

Data scientists, algorithm developers, and operations researchers looking to optimize resource allocation and minimize wastage in volume-based problems.

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
 
Physics 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 [itex]g=gcd(v_1,v_2)[/itex] if [itex]g|V[/itex] where v1,v2 are the smaller volumes. This would cut down a lot of computational time.
 

Similar threads

  • · Replies 6 ·
Replies
6
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 23 ·
Replies
23
Views
3K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 35 ·
2
Replies
35
Views
5K