# Thread: how to calculate a best case scenario

1. ## how to calculate a best case scenario

This is not an urgent request, just something I have been trying to work on.
I am trying to figure a best case scenario for cutting specific lengths of items from a standard size piece.

As an example:
I want to have the following list cut from standard sizes of material.
qty mark# size
3 A 3"
2 B 4"

the standard size material is 10"
so in this example I would end up with
1 10" piece to cut all 3 A's out of and have 1" left over
1 10" piece to cut the B's out of and have 2" left over.

the best case would be:
1 10" piece to cut 2 A's and 1 B, to have 0" left over,
1 10" piece to cut 1 A and 1 B, to have 3" left over.

My example is very basic, I will have a much more complex need of this basic idea. I currently have my code sorting all of my items to cut by size, and simply cutting the largest items first and then checking if the next size down can be cut out of what remained. It is functional but not optimal.

2. I have uploaded a sample workbook with what I have currently.
It is a continual work in progress for me, so please forgive all my comments and extra bits of code.

This code is not the complete set, it is only the best case "nesting" scenario.
The data in columns A to K is generated by another set of code and sorted automatically as shown.
I have simply manually copied this data to columns M to W then ran the code b_nesting and the results are shown.
to re-run the same code, simply copy A to K and overwrite what is in M to W.

3. Has anyone had a chance to look at this?

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•