Find optimal placement of Variants across sheets with minimal waste?

Dannygoor

New member
Joined
Jul 7, 2021
Messages
8
Here is the question I have. I'm not even sure how to go about starting to figure this out, so I could really use some help.

I have x number of variants. Let's say 5 variants for this example.

Variant1 = RED, Required Quantity = 100
Variant2 = BLUE, Required Quantity = 225
Variant3 = GREEN, Required Quantity = 410
Variant4 = ORANGE, Required Quantity = 177
Variant5 = YELLOW, Required Quantity = 91

I need to allocate these variants onto plates (blank sheets) in order to produce a minimum of the required quantities with the least amount of waste.
The one CONSTANT is that I have 30 UPS (or empty spaces) on each Plate (Sheet).

"Think of it like those blank sticker sheets you print on, that are maybe 10 rows of 3 (total 30 blank stickers), and I need to print stickers to get the required quantities (I.E: 100 RED, 225 BLUE, etc...)"

I CANNOT leave any blank stickers. And my goal is to have the minimum amount of extras (waste) per quantity. Meaning: If I end up printing 110 RED stickers, then I have 10 RED waste (since I only needed 100 RED).

I can put one variant on each separate plate (sheet) and RUN them the min required amount of times to meet my required quantities.
EXAMPLE: I can put 30 RED stickers (the whole sheet), and run it 4 times. That will give me 120 RED. But since I only need 100, now I have 20 RED waste.

So it might be more efficient (less waste), to combine them. Where maybe on the first Sheet I do 23 BLUE and 7 RED and run it 10 times (which gives me 230 BLUE (5 waste), and 70 RED (need 30 more).
And then on the next sheet I can do 23 YELLOW and 7 RED and run it 4 times to give me 92 YELLOW (1 waste) and 28 RED (still need 2 more RED).
etc...

But it seems to me that there are tons of these possible combinations, and I don't know how to determine the most efficient one.
I'm assuming there is some mathematical way of doing this??

Please Help.
 
Long, long ago, I worked on a program to solve a somewhat similar problem.

Based on that I might try developing an algorithm to solve this. The first thing I would do is to add up the required quantities of all variants, divide by the number of plates per sheet, and if the quotient is not a whole number, replace the quotient with the whole number immediately above the quotient. Using your example, the total would be 1003. Divide that by 30. You get 33.4333. Replace that by 34.

What is the purpose of that? That tells me 33 sheets are not enough because 33 time 30 is 990. That means 34 sheets is the minimum required, and that further means that 34 times 30 - 1003 = 17 is the minimum possible wastage.

At least now you have an objective. Get as close to 17 wasted as possible.

Now figure out how many sheets you can make of a solid color.

I can do 13 sheets, all green. Gives me 20 greens to go.

I can do 7 sheets all blue. Leaves me 15 blues to go.

I can do 5 sheets all orange. Leaves 27 orange to go.

I can do 3 sheets all red. Leaves 10 red to go.

I can do 3 sheets all yellow. Leaves 1 yellow to go.

That is 31 sheets. I have addressed 930 of the requirements. 73 to go.

Now the problem has been reduced to a manageable level. There are many solutions.

29 orange and 1 yellow. 2 wasted orange.
20 greens and 10 reds. Nothing wasted.
30 blues. 15 wasted blue.

Total wasted is 17. Optimum result possible.

I am not sure this is math. Yes, it uses basic arithmetic, but it looks to me more like programming in spirit.
 
@JeffM 's approach is excellent. However, IF there is a lot of work in organising the 8 different types of sheet to print, there is a way of doing it that requires only two types of sheet. You'd print 33 sheets (all the same) but every sheet contains ALL the colours in some combination. And then you'd need to print one last sheet that is a different combination of the colours. If you need help to find this then let us know, but it is all about finding the right numbers of colours on the 33x sheet (think ratios).
 
@JeffM 's approach is excellent. However, IF there is a lot of work in organising the 8 different types of sheet to print, there is a way of doing it that requires only two types of sheet. You'd print 33 sheets (all the same) but every sheet contains ALL the colours in some combination. And then you'd need to print one last sheet that is a different combination of the colours. If you need help to find this then let us know, but it is all about finding the right numbers of colours on the 33x sheet (think ratios).
Elegant
 
TY so much for this input so far. But I still had a few questions.

1. Are you saying that printing full colors on each sheet initially is the most efficient way? Meaning if I need 100 RED then I print 3 sheets of RED (which gives me 90 RED) and then I need 10 more, etc... Getting as close as possible to the requirement without going over for each Variant? And then take the remainder required between all the Variants and place them on the remaining sheets?

Is that always the most efficient way of doing it compared to just allocating them across multiple sheets from the beginning? I.E 10 RED and 20 BLUE on sheet 1, then 10 RED and 20 Green on sheet 2, etc...?

Here are some sample outputs that they did which is showing as most efficient. But I don't know how they did it.

What formula did they use to get to these results?

TEST8:

1. 63 UPS
2. 22 Variants:
1. Variant 1 – 42C – QTY: 325
b. Variant2 – 44DD – QTY: 1300
c. Variant3 – 42DD– QTY: 1325
d. Variant 4 – 44D – QTY: 425
e. Variant 5 – 38DD – QTY: 400
f. Variant 6 – 38D– QTY: 225
g. Variant 7 – 40D – QTY: 375
h. Variant 8 – 40DD – QTY: 1200
i. Variant 9 – 42D– QTY: 425
j. Variant 10 – 40DDD – QTY: 1275
k. Variant 11 – 46DD – QTY: 400
l. Variant 12 – 44C– QTY: 350
m. Variant 13 – 46C – QTY: 300
n. Variant 14 – 46DDD – QTY: 450
o. Variant 15 – 38C– QTY: 150
p. Variant 16 – 36DD – QTY: 75
q. Variant 17 – 38DDD – QTY: 525
r. Variant 18 – 36DDD– QTY: 125
s. Variant 19 – 44DDD – QTY: 1300
t. Variant 20 – 46D – QTY: 300
u. Variant 21 – 40C – QTY: 200
v. Variant 22 – 42DDD – QTY: 1325




1. Number of plates 4
a. Plate 1 – 175 Runs:
1. Variant 1 : 1 repeats
2. Variant 2 : 7 repeats
3. Variant 3 : 7 repeats
4. Variant 4 : 2 repeats
5. Variant 5 : 2 repeats
6. Variant 6 : 1 repeats
7. Variant 7 : 2 repeats
8. Variant 8 : 6 repeats
9. Variant 9 : 2 repeats
10. Variant 10 : 7 repeats
11. Variant 11 : 2 repeats
12. Variant 12 : 2 repeats
13. Variant 13 : 1 repeats
14. Variant 14 : 2 repeats
15. Variant 17 : 3 repeats
16. Variant 19 : 7 repeats
17. Variant 20 : 1 repeats
18. Variant 21 : 1 repeats
19. Variant 22 : 7 repeats



b. Plate 2 – 25 runs:
1. Variant 1 : 6 repeats
2. Variant 2 : 3 repeats
3. Variant 3 : 4 repeats
4. Variant 4 : 3 repeats
5. Variant 5 : 1 repeats
8. Variant 8 : 6 repeats
9. Variant 9 : 3 repeats
10. Variant 10 : 2 repeats
13. Variant 13 : 5 repeats
14. Variant 14 : 4 repeats
15. Variant 15 : 6 repeats
16. Variant 16 : 3 repeats
18. Variant 18 : 5 repeats
18. Variant 19 : 3 repeats
18. Variant 20 : 5 repeats
18. Variant 22 : 4 repeats

C. Plate 3 – 2 runs:
i. Variant 5 : 25 repeats
ii. Variant 6 : 25 repeats
iii. Variant 7 : 1 repeats
iV. Variant 11 : 12 repeats

C. Plate 4 – 1 runs:
i. Variant 5 : 6 repeats
ii. Variant 7 : 28 repeats
iii. Variant 21 : 29 repeats


TEST9:

1. 55 UPS
2. 4 Variants:
a. Variant 1 – 14/16 – QTY: 1400
b. Variant2 – 22/24 – QTY: 975
c. Variant3 – 18/20 – QTY: 1775
c. Variant4 – 26/28 – QTY: 575


Output:
1. Number of plates 2
a. Plate 1 – 75 Runs:
i. Variant 1 : 12 repeats
ii. Variant 2 : 13 repeats
iii. Variant 3 : 23 repeats
iii. Variant 4 : 7 repeats


b. Plate 2 – 12 runs:
i. Variant 1 : 43 repeats
ii. Variant 3 : 6 repeats
iii. Variant 3 : 6 repeats
 
I think the point that you are missing is that there is more than one way to minimize the number of wasted slots. The solid color way will be one way that is simple to understand. And, in terms of slots wasted, you cannot beat it. I did not imply that the solid color way was the only way to minimize the number of wasted slots. It is just one way that guarantees a minimum of wastage.

BUT what @Cubist is pointing out is that the solid color approach requires at least n set ups, where n is the number of required variants, and usually n + 1 set ups. In your example, my solid-color method requires 6 set-ups. Cubist suggests an approach to reduce set ups as well as minimizing the number of wasted slots.

Now you are saying that the solid color way is not efficient. How do you define efficient?
 
Hi guys, thank you so much for all your help. I am not saying that the solid color approach is not the most efficient. I am actually asking if it is. What is defined as "most efficient" is the allocation that ads up to the least amount of waste between all variants. So like you said, if the total of all my variants is 1003 and we end up with a total between all variants of 1020, which leaves us 17 waste, then if 17 waste is the least amount of waste we can get then it's the most efficient. I'm trying to duplicate something I can see on a different calculator, but I have no idea how they are doing it. That is why I put the example above. As you can see, it seems that the allocation of variants doesn't really follow any specific pattern, so there must be some algorithm they are using to allocate them (since it's automatic). Their system is supposed to have the least possible waste. I just have no idea how they are doing this allocation.
 
Hi guys, thank you so much for all your help. I am not saying that the solid color approach is not the most efficient. I am actually asking if it is. What is defined as "most efficient" is the allocation that ads up to the least amount of waste between all variants. So like you said, if the total of all my variants is 1003 and we end up with a total between all variants of 1020, which leaves us 17 waste, then if 17 waste is the least amount of waste we can get then it's the most efficient. I'm trying to duplicate something I can see on a different calculator, but I have no idea how they are doing it. That is why I put the example above. As you can see, it seems that the allocation of variants doesn't really follow any specific pattern, so there must be some algorithm they are using to allocate them (since it's automatic). Their system is supposed to have the least possible waste. I just have no idea how they are doing this allocation.

You're welcome for the help!

"Most efficient" will obviously mean different things for different applications. For example, if a sticker printing process involved screen printing (I think that's what it's called!) then @JeffM 's description of the solid colour approach will be the most efficient by far. You'd only have to swipe one colour onto each sheet of stickers, and you'd have one period of waiting, for the paint to dry, for (most of the) sheets. BUT if you have an inkjet system that could lay down all the colours at the same time, then the algorithm hinted at in post#3 would likely be most efficient. It also depends on what happens afterwards, do the stickers need to be delivered to several different customers (it might make sense to print one customer's order on one sheet(or set of sheets), etc, instead of having to chop the sheet up into individual stickers and allocating batches to the correct customers.

I'm a bit busy at the moment, but later I'll take a look at the examples that you have posted to see if I can make an educated guess at what their algorithm is doing. I assume that these examples are very suitable for your particular process and requirement? Otherwise we may as well try to come up with our own method - one that is more suitable for your needs.
 
"Most efficient" will obviously mean different things for different applications...

...BTW I know that you want minimum material use. But while satisfying this constraint, and using only 17 sheets in your first sticker example, there will usually be a LOT of "wiggle room" to take a secondary consideration into account.
 
Aha, that is a much better question.

We have [MATH]n[/MATH] variants that are required. In your example, n = 5 distinct colors.

The variants must be delivered in sets of [MATH]s[/MATH]. In your example, you have 30 units per sheet. (I am guessing that is what UPS means rather than United Parcel Service.) Obviously s > 0.

We also have [MATH]r_i > 0[/MATH], which is the number required of the ith variant. In your example, they are
100 red, 225 blue, green 410, orange 177, yellow 91.

We define the total required as

[MATH]r_1 + r_2 + … r_n[/MATH]. We just add up all the items required. That’s 1003 in your example.

Now we come to the first tricky part. To determine how many sets (sheets) we need, we divide t by s. There are two possibilities. Either t divided by s is a whole number or it is not a whole number. If that quotient is a whole number, then that quotient is the minimum number of sets (sheets) required. If the quotient is not a whole number, then the next higher whole number is the minimum number of sets (sheets) required.

To give some examples, if t = 990 and s = 30, then we need 990/30 = 33 sheets and there need be no waste. If t = 1020 and s = 30, then we need 1020/30 = 34 sheets and there need be no waste. If t = 1003 and s = 30, 33 sheets is not quite enough so the minimum number of sheets is 33 + 1 = 34. But that means we have 1020 units and only need 1003. We cannot avoid 17 units of waste. But we can try to make sure the waste does not exceed 17 units.

So in your example, m = 34 and w = 1020 - 1003 = 17. We cannot avoid wasting 17. Any arrangement that leaves us with no more wasted than 17 is an optimum.

Are you with me to here?

We can summarize those two paragraphs in math notation as

[MATH]\text {minimum number of sheets} = m = \left \lceil \dfrac{t}{s} \right \rceil \text {and minimum waste} = w = ms - t.[/MATH]
Note that [MATH]m = \dfrac{t}{s} \text { or } m - 1 < \dfrac{t}{s} < m \implies ms = t \text { or } ms - s < t < ms.[/MATH]
Do you see why?

Now we get to the really tricky part. We calculate the maximum number of possible sets containing a uniform variant (sheets containing the same color). Basically we divide the number required in that color by s. But this may not give us whole numbers. In this case, we pick the next lower whole number if the quotient is not a whole number. In math notation,

[MATH]\text {maximum number of uniform sheets of variant i} = x_i = \left \lfloor \dfrac{r_i}{s} \right \rfloor.[/MATH]
In your example, we get 3 all red possible, 7 all blue possible, 13 all green possible, 5 all orange possible, and 3 all yellow possible.

[MATH]\text {number of solidly colored sheets} = y = x_1 + x_2 + … x_n.[/MATH]
In your example, we get y = 31.

Now we determine how many of each color must still be allocated.

[MATH]\text {number of variant i to be allocated} = z_i = r_i - sx_i \implies z_i + sx_i = r_i.[/MATH]
So, in your example, we get 10 red, 15 blue, 20 green, 27 orange, and 1 yellow still to be taken care of. Make sense?

Now we do some basic math.

[MATH]\text {total left to do} = p = z_1 + z_2 + … z_n.[/MATH]
In your example, p is 73.

[MATH]t = r_1 + r_2 + … r_n = (z_1 + sx_1) + (z_2 + sx_2) + … (z_n + sx_n) \implies[/MATH]
[MATH]t = (z_1 + z_2 + … z_n) + s* (x_1 + x_2 + … x_n) = p + sy.[/MATH]
Now consider the case where t = ms.

[MATH]ms = p + sy \implies (m - y) * s = p \implies m - y = \dfrac{p}{s}.[/MATH]
So this means either p = 0, and we are done without waste, or else p is evenly divisible by s, and we can allocate the p across (m - y) sheets without waste. Clearly optimum.

Then consider the case where ms - s < t < ms.
Your example is of this type 990 = 1020 - 30 < 1003 < 1020 = 34 * 30.

In that case, [MATH]w = ms - t > 0.[/MATH] Which is 17 in your example.

[MATH]ms - s < p + sy < ms \implies (m - 1 - y) * s < p < (m - y) * s.[/MATH]
Now suppose we put (m - 1 - y) * s of the p remaining unallocated onto (m - 1 - y) sheets, leaving just q unallocated.

[MATH]q = p - (m - 1 - y) * s.[/MATH]
In your example, m = 34 and y = 31 so m - 1 - y = 2 and 2 * 30 = 60 so q = 13.

[MATH]q = p - (m - 1 - y) * s \implies 0 < q < (m - y) * s - (m - 1 - y) * s \implies q < s.[/MATH]
Let’s recapitulate We did y same-color sheets without waste. We dealt with all but q of the p unallocated in
m - 1 - y sheets without waste. And q is less than s so we can put all those q onto one sheet.

y sheets same color and fully used
m - 1 - y mixed colors but fully used
1 sheet not fully used

y + m - 1 - y + 1 = m. That is the minimum possible number of sheets.

The only question is what is wasted on the sheet not fully used. Obviously that is s - q. But what is s - q.

We have y + m - 1 - y = m - 1 fully used sheets. So t = (m - 1) * s + q. And w = ms - t.

[MATH]- t = -(m -1) * s - q = s - ms - q \implies w = ms - t = ms + s - ms - q \implies w = s - q.[/MATH]
It is optimum.

Let’s go through it with your example. We do 31 same color full sheets, which takes care of 930 of the 1003 items required without waste. That leaves 73 to go. But 73 divided by 30 gives 2 plus a remainder of 13. So do 2 sheets that are full but are mixed. (Be careful not to overcount any unused colors.)That leaves 13 to go. Put them on the last sheet. That leaves 17 that are wasted, which is the best you can do.

My procedure is simple enough to figure out and will always give the minimal amount of waste.

Cubist’s point, which is entirely correct, is that there are untold other arrangements, and some of them may be optimum in some other respect. I suspect, however, it may be a bit more difficult than he suspects to find arrangements that invariably satisfy minimizing waste and optimizing some other attribute simultaneously. I gave it a shot and got a headache. The fact that we are restricted to whole numbers makes things complicated.
 
Last edited:
Cubist’s point, which is entirely correct, is that there are untold other arrangements, and some of them may be optimum in some other respect. I suspect, however, it may be a bit more difficult than he suspects to find arrangements that invariably satisfy minimizing waste and optimizing some other attribute simultaneously. I gave it a shot and got a headache. The fact that we are restricted to whole numbers makes things complicated.

"I gave it a shot and got a headache", ?? . Hope it goes away soon ?

I agree with you. It wouldn't surprise me if adding extra requirements (depending on what they are) could result in an "NP-hard problem" in computer speak, or in layman's words a bl**dy difficult problem! There's often clever ways to get very close to the desired result in this circumstance, BUT the only surefire solution to guarantee the (double) optimum result would be to have a computer trawl through all possibilities (which might take a long time).
 
"I gave it a shot and got a headache", ?? . Hope it goes away soon ?

I agree with you. It wouldn't surprise me if adding extra requirements (depending on what they are) could result in an "NP-hard problem" in computer speak, or in layman's words a bl**dy difficult problem! There's often clever ways to get very close to the desired result in this circumstance, BUT the only surefire solution to guarantee the (double) optimum result would be to have a computer trawl through all possibilities (which might take a long time).
That's almost exactly what my son told me. Good solutions may be findable with a quick search or by a simple algorithm, but proving that a particular algorithm is optimal over a large space for multiple objectives may range from very hard to impossible.
 
Thank you so much JeffM this was a really great start I think to understand this better. I think there is a bit of confusion here as far as the terminology goes. And maybe I was not clear enough in my explanation. To clarify: Each "layout" of a sheet is called a PLATE. This could be 30 RED, 20 RED and 10 BLUE, etc... And then each one of these "PLATES" can have X number of "RUNS", which is how many time each PLATE is repeated. So to take what you said. The number of solidly colored PLATES would always equal the number of Variants.

The one CONSTANT is the UPS, which is how many available stickers are on each PLATE.
So if the UPS = 30, that is consistent among all the PLATES.

So PLATE A = RED x 3 runs (30 x 3 = 90)
PLATE B = BLUE x 7 runs (30 x 7 = 210)
PLATE C = GREEN x 13 runs (30 x 13 = 390)
PLATE D = ORANGE x 5 runs (30 x 5 = 150)
PLATE E = YELLOW x 3 runs (30 x 3 = 90)

Then the remaining required quantities need to be allocated across an additional PLATE(s) in order to produce enough to meet the minimum required while getting the least amount of waste.

This is the part I'm having trouble with. "73 divided by 30 gives 2 plus a remainder of 13. So do 2 sheets that are full but are mixed "

How do I allocate them onto the remaining PLATE(s) in the most efficient way?

TY so much for all your help so far.
 
Thank you so much JeffM this was a really great start I think to understand this better. I think there is a bit of confusion here as far as the terminology goes. And maybe I was not clear enough in my explanation. To clarify: Each "layout" of a sheet is called a PLATE. This could be 30 RED, 20 RED and 10 BLUE, etc... And then each one of these "PLATES" can have X number of "RUNS", which is how many time each PLATE is repeated. So to take what you said. The number of solidly colored PLATES would always equal the number of Variants.

The one CONSTANT is the UPS, which is how many available stickers are on each PLATE.
So if the UPS = 30, that is consistent among all the PLATES.

So PLATE A = RED x 3 runs (30 x 3 = 90)
PLATE B = BLUE x 7 runs (30 x 7 = 210)
PLATE C = GREEN x 13 runs (30 x 13 = 390)
PLATE D = ORANGE x 5 runs (30 x 5 = 150)
PLATE E = YELLOW x 3 runs (30 x 3 = 90)

Then the remaining required quantities need to be allocated across an additional PLATE(s) in order to produce enough to meet the minimum required while getting the least amount of waste.

This is the part I'm having trouble with. "73 divided by 30 gives 2 plus a remainder of 13. So do 2 sheets that are full but are mixed "

How do I allocate them onto the remaining PLATE(s) in the most efficient way?

TY so much for all your help so far.
I apologize. I seem not to have been clear.

You have 73 left after the runs of uniform color.

You create 2 plates that are full in the sense that every color is required. So for example, you could use no more than one yellow in those two plates because you only need 1. Or you could use no yellow in those two plates. You can fill those plates any way you want, provided that you do not use any color more times than it is needed. You run each of those plates once.

Because you never use more than are required of any color in those two plates, there is no waste. That is the only requirement you have. It is truly simple. Just don't use more of any color than you still need. Easy peasy.

Now we have 13 left for the last plate. Put them on any way you like. What you do with the remaining 17 is irrelevant because they are all waste. But you cannot get away with waste less than 17.

Now as a practical person, I might make extras of the colors used most heavily as a little customer benefit that costs nothing. That is I would use the "waste" for customer service. Make sure you tell the customer that you did so the customer appreciates the attention.
 
Thanks JeffM, I think there was one part of the description of this that I was unclear on.
I am unable to leave any BLANK spaces. All have to be filled. So any "Extras" of each color is waste.
And this also has to be automatic. How do I know how many of each color to allocate? Also remember the PLATES have a max of 30 UPS in this example.

So if I need 1 RED, 20 BLUT, 15 YELLOW, etc... obviously they won't all fit on one PLATE, so how do I know how many of each color to put on the PLATE and how many runs it needs?
 
Thanks JeffM, I think there was one part of the description of this that I was unclear on.
I am unable to leave any BLANK spaces. All have to be filled. So any "Extras" of each color is waste.
And this also has to be automatic. How do I know how many of each color to allocate? Also remember the PLATES have a max of 30 UPS in this example.

So if I need 1 RED, 20 BLUT, 15 YELLOW, etc... obviously they won't all fit on one PLATE, so how do I know how many of each color to put on the PLATE and how many runs it needs?
No, I understand that none can be blank. We have 17 that are wasted because they are not required, but they still are colored.

My fundamental point is that if you have 1003 that are required and 30 per sheet, you will necessarily have 17 that are "wasted." 33 runs gets you to 990, not enough. 34 runs gets you to 1020, too much. There is no way to avoid the waste of 17. (Of course all these numbers would change with a different example.)

You had the basic idea when you said 3 runs all red, 7 runs all blue, 13 runs all green, 5 runs all orange, and 3 runs all yellow.

But that leaves 73 to go. We design three more plates, each to be run once.

On the first two plates, we do whatever we want, provided that we use no color more often than is needed. So those two plates will have no waste at all. (As a practical matter, I might create a systematic way to do it to avoid mistakes, but what that systematic way is is mathematically irrelevant.) All the waste is in the last very last plate and is unavoidable. Again, you can do anything you want on that last plate provided that you put in the number of each color still needed.

At the very end, I suggested you might try to get some benefit from the waste by making extras of the colors used most. So in your example, I might make 9 extra green, 4 extra blue, and 4 extra orange. Then if there was a misprint or some damage, you might be able to fix it without anything extra. But that just shows that I was responsible for a marketing department for decades. Give extra if it costs nothing. But all that is totally irrelevant to what I was fundamentally saying.

Given the constraints that you are dealing with, there usually will be waste that cannot be eliminated. But there is a relatively easy procedure that guarantees you will have no avoidable waste.
 
Thanks JeffM, this is the part I'm still not 100% clear on: "On the first two plates, we do whatever we want "

The do what we want is what I don't understand. If I have 5 Variants how do I allocate them onto the first two plates? How many of each color go on each plate? Do all the colors go on both plates? Do some go on one plate and some on the other? Also I might have 40 variants and not 5. Is there not some mathematical way to determine how to allocate them onto the last 2 or 3 plates?
 
HI JeffM, I am trying to program this to work automatically, so I need to find some way of allocating them. That is where I am stumped. Is how do I program them based on some formula or algorithm so it's done automatically, regardless of how many variants (colors) I have.

I'm sorry for my ignorance, I just still don't understand how I'm supposed to allocate them. I understand that they wouldn't be allocated more than what is required. But again if these are the quantities I'm still missing (after all the solid color prints):

RED = 10
BLUE = 15
GREEN = 20
ORANGE = 27
YELLOW = 1

How do I determine how to allocate them. Obviously if I add them all up they are going to exceed 30 which is the max I can put on one PLATE.

It also has to be automatic. So I can't just look at it and make a decision. This isn't something a human will interact with.

It just needs to take the input parameters (Variants, required quantities, UPS), and then output automatically like my example above.

That's how the current system works that I'm trying to replicate. So they are using some algorithm to place the variants on the PLATES.

That algorithm is what I'm trying to understand.

I really appreciate your help and your patience, and I apologize if I'm unclear in my descriptions.
 
OK So you know how to figure out the number of runs required that are single color, right?

Now that leaves a bunch of colors still not allocated. I called that number p. It was 73 in our example.

Now if p = 0, you are done.

If p > 0 (it was 73 in our example, then do the following.

Build a plate starting with the variant with the lowest designation (say variant 93), and one by one allocate the remaining requirements for variant 93 onto the plate. When no more are left, start allocating those remaining from the next highest variant (say variant 107). When you hit 30 (or whatever the ups is) you are done with that plate. Or if you run out of needed colors before the plate is done, fill in the remaining spots with black (the black ones are waste).

You do that over and over until all the required colors are allocated.

Let's think about how to do that in your example.

We start with red. You took care of 90 in the same color runs. That leaves 10 to go. Put those on a plate. So red is taken care of. The next color that has unfilled requirements is blue. There are 15 of them left. We start putting them onto the plate. When we are done with blue, up to 25 spots on the plate have been used. Next color up is green. There are 20 of those left to be allocated. We start putting them on the plate, but when we have put 5 of them on the plate, the plate is full. The design for that plate is complete. Run it once.

But we still have unmet requirements. Start designing a new plate. We have 15 greens left. Put them onto the new plate. Next up is 27 unassigned orange. Start putting them onto the new plate. But when you have assigned 15 of them, the plate is full. The design for that plate is complete. Run it once.

But we still have unmet requirements. Start designing a new plate. We have 12 oranges left unassigned. Put them onto the new plate. We still have 1 yellow unassigned, Put it onto the plate. We have no unassigned colors left, but there are 17 slots on this plate with no color allocated. Allocate black to all of them. The design for this plate is complete. Run it once.

There are no unmet requirements. Stop.

See you can take the boy out of the programming bull pen, but you cannot take the programming out of the boy.
 
Thanks Jeffm, this approach would definitely work,.

I really appreciate you clarifying this for me. I now understand what you were saying and this does yield 17 waste.

TY so much for this info.


Is there a mathematical calculation to do this? Again this won't be something done by a human that can see when and if it goes over the UPS.
 
Top