I need to make a program that calculates the optimal way to cut pieces of pipe to what a customer wants.
My advanced math skills are bad but I know this is the cutting stock problem. My first problem is that I don't really understand much on that wikipedia page. The other thing is that the page describes solving this problem when all the pieces you have in inventory are the same size. How do you optimize when you have varying sizes in inventory and you want to use up the small ones first?
For example say we have pieces of this length in inventory: 2', 18'
And a customer wants these lengths: 1', 12'
My understanding of the wikiepdia page is that it is trying to reduce the left over(waste) which would mean that you would take the requested 1', 12' out of the 18' to have a left over of 5'.
The optimal solution I would want is to take 1' out of the 2' and 12' out of the 18' even though the total left over is 7' because we want to keep pieces as long as possible.
I am having a hard time describing this. Any general guidance on this would be great.