in reply to Re: Finding the simplest combination of descrete thicknesses that sums nearest to the target thickness.
in thread Finding the simplest combination of descrete thicknesses that sums nearest to the target thickness.

You may be able to convince yourself, but I'm convinced that you're wrong about that decomposition being possible. Let me try to convince you.

Consider the case where you have blocks with width/thickness pairs of 4,3, 1,5 and 3,2. They can be arranged into the following pattern to form a 5,8 square:

_______ _ | | | | | | |_______| | | | | | | |_____|_| | | | | | | |_|_______|
(I've actually drawn each horizontal space as 2 characters...)

I assert that that example can't be broken down as you claimed it could. A brute force proof is fairly straightforward. You have to put some block in the top left corner. Let's examine each possibility.

So you see that by brute force there are 2 ways to solve this problem, and neither decomposes as you'd hoped.
  • Comment on Re^2: Finding the simplest combination of descrete thicknesses that sums nearest to the target thickness.
  • Download Code