Look at the Round() function.
Round( 0.25+0.5+0.75 ; 0 ) = 2
Ceiling Rounds to the next integer.
1 of 1 people found this helpful
Do you want answer for knapsack?
0.75 + 0.75 + 0.75 + 0.75 = 4 (this can't be calculated with Round() nor Ceiling() )
Knapsack! I knew there would be a name for this. This is exactly what I am trying to solve.
Do you have any suggestions? I looked at the wikipedia page for knapsack but it seems to be above my level of mathematical understanding.
I have no idea what the original problem is. Is it the cutting stock problem?
Do you have part-width panels that you want to combine to fulfil orders, with minimum waste?
If so, do you have an intenventory of the part-width panels? Are they accurately measured? How many are you willing to keep around, and for how long? How much waste is acceptable? How long can the job wait for more cut stock of the right size to appear? Note that the lower the acceptable amount of waste, the harder the problem becomes and you'll need to keep more cut stock around.
These optimisation problems are "hard" computationally. The knapsac problem has been worked on for over 100 years. See also the travelling salesman problem.
Generic answer may be really hard as you saw.
If your problem have some limitations, it could be easier.
For example, there is max number to add, using only 4 numbers 0.25,0.5,0.75,1 etc.