My customer is producing windows with aluminium frames of almost any size using profiles. Aluminium profiles are extruded with a standard length of 6 meters in the factory. Now I am looking for a way (recursive loop, function...) to know how many profiles must be cut with a minimum amount of waste to fit to a certain order.

Assume a list of profiles of arbitrary length, but not longer than 6 m.

How in FileMaker would an algorithm be best applied to know:

- What would be the best cut to produce minimal waste?

- How many profiles from extrusion are needed?

Assume for example we need 10 profiles of 1200 mm each, 10 profiles of 900 mm each, 4 profiles of 1300 mm each, and 4 profiles of 1100 mm each. We know that in total we need 30,600 mm or 30.6 m of profiles. But just cutting them from the 6 m profiles will produce some waste, more or less, depending on my cutting plan.

A lot of combinations for cutting are possible, but we want the best one.

I googled 'stack overflow optimized cut length' and got about what I expected, a lot of links to mathematical solutions. Apparently a lot of people have thought about this.

Cutting stock problem - Wikipedia, the free encyclopedia

My math skills are not strong enough to follow the formulas, so I can only suggest finding a math wiz to work this out with you. From the bits I could understand, my guess would be your particular case might not be as difficult as some, if you only have a handful of standard lengths. It sounds like having a finite number of combinations makes the problem much more tractable.