Minimum-Waste Print Job Grouping Algorithm?

Posted by Matt Mc on Stack Overflow See other posts from Stack Overflow or by Matt Mc
Published on 2011-04-10T01:14:10Z Indexed on 2012/06/19 21:16 UTC
Read the original article Hit count: 380

Filed under:
|
|
|

I work at a publishing house and I am setting up one of our presses for "ganging", in other words, printing multiple jobs simultaneously. Given that different print jobs can have different quantities, and anywhere from 1 to 20 jobs might need to be considered at a time, the problem would be to determine which jobs to group together to minimize waste (waste coming from over-printing on smaller-quantity jobs in a given set, that is).

Given the following stable data:

  1. All jobs are equal in terms of spatial size--placement on paper doesn't come into consideration.
  2. There are three "lanes", meaning that three jobs can be printed simultaneously.
  3. Ideally, each lane has one job. Part of the problem is minimizing how many lanes each job is run on.
  4. If necessary, one job could be run on two lanes, with a second job on the third lane.
  5. The "grouping" waste from a given set of jobs (let's say the quantities of them are x, y and z) would be the highest number minus the two lower numbers. So if x is the higher number, the grouping waste would be (x - y) + (x - z). Otherwise stated, waste is produced by printing job Y and Z (in excess of their quantities) up to the quantity of X. The grouping waste would be a qualifier for the given set, meaning it could not exceed a certain quantity or the job would simply be printed alone.

So the question is stated: how to determine which sets of jobs are grouped together, out of any given number of jobs, based on the qualifiers of 1) Three similar quantities OR 2) Two quantities where one is approximately double the other, AND with the aim of minimal total grouping waste across the various sets.

(Edit) Quantity Information: Typical job quantities can be from 150 to 350 on foreign languages, or 500 to 1000 on English print runs. This data can be used to set up some scenarios for an algorithm. For example, let's say you had 5 jobs:

1000, 500, 500, 450, 250

By looking at it, I can see a couple of answers. Obviously (1000/500/500) is not efficient as you'll have a grouping waste of 1000. (500/500/450) is better as you'll have a waste of 50, but then you run (1000) and (250) alone. But you could also run (1000/500) with 1000 on two lanes, (500/250) with 500 on two lanes and then (450) alone.

In terms of trade-offs for lane minimization vs. wastage, we could say that any grouping waste over 200 is excessive.

(End Edit)

...Needless to say, quite a problem. (For me.)

I am a moderately skilled programmer but I do not have much familiarity with algorithms and I am not fully studied in the mathematics of the area. I'm I/P writing a sort of brute-force program that simply tries all options, neglecting any option tree that seems to have excessive grouping waste. However, I can't help but hope there's an easier and more efficient method.

I've looked at various websites trying to find out more about algorithms in general and have been slogging my way through the symbology, but it's slow going. Unfortunately, Wikipedia's articles on the subject are very cross-dependent and it's difficult to find an "in". The only thing I've been able to really find would seem to be a definition of the rough type of algorithm I need: "Exclusive Distance Clustering", one-dimensionally speaking.

I did look at what seems to be the popularly referred-to algorithm on this site, the Bin Packing one, but I was unable to see exactly how it would work with my problem.

Any help is appreciated. :)

© Stack Overflow or respective owner

Related posts about algorithm

Related posts about printing