The program must generate and evaluate all combinations of y, taken 8 at a time, 1 from each x. What is the most efficient code to generate all the combinations?
PHV, what you described will iterate through the 8 x 24 = 192 individual entries, but the program must evaluate the entries in groups of 8, one from each x. Does iterating through the individual entries generate all possible combinations?
GlennUK - I think the total number of combinations of 192 items taken 8 at a time is 192! / ( 8!x(184)!) = REALLY BIG, but I'm not sure this equation applies because the population of 192 is divided into sub-groups of 24.
For each x, there would be 735,471 ways to make combinations of 24 things taken 8 at a time. This makes it a grand total of 5,883,768 possible groupings.
Care to explain what it is exactly what you are doing?
If you are going to execute some process for each grouping, and you could generate a group and execute the process 10 times a second, it would only take 7 days to run the entire sequence.
The program is being written to demonstrate to clinical lab managers how to schedule their diagnostic assays on a batch basis rather than on demand.
A “raw” schedule might look like this:
Assay Day 1 Day 2 Day 3 Day 4 …….. Day 24
1 40 90 100 100 25
2 50 50 50 50 50
3 0 75 0 75 0
4 25 50 0 0 60
…..
8 0 25 40 0 0
Daily 3 16 10 9 12
Turnaround
Time (hr)
The objective is to adjust the schedules of the individual assays, by moving them either forward or backward on the calendar, so that the projected total Daily Turnaround Time is less than the planned daily operating hours.
The “optimized” schedule would look like this:
Assay Day 1 Day 2 Day 3 Day 4 …….. Day 24
1 40 90 100 100 25
2 50 50 50 50 50
3 75 0 75 0 75
4 0 0 25 50 0
…..
8 25 40 0 0 0
Daily 6 8 8 7 8
Turnaround
Time (hr)
Each individual assay’s daily schedule would remain unchanged, only their relative alignment on the calendar would change. Assays with a fixed daily quantity ( 2 ) would be a constant and would be irrelevant to the analysis. The calculation of the daily Turnaround Time is straightforward. I don’t see how to arrive at the optimum alignment of the individual schedules except by generating all feasible combinations, while keeping track of the combination(s) that meet the daily turnaround time goal. I know this is inelegant brute force, but don’t know what else to do.
Let me see if I can put this in terms everyone can understand.
1. You have a total of 192 "assays" defined by an ID number from 1 to 8 along with a time value measured in minutes.
2. You need to fill an 8 by 24 matrix with the time values such that
2a. All "assays" with the same ID number must remain on the same row and
2b. The sum of all time values in each column is less than or equal to 480 minutes.
Seems like you could simply start with a random distribution and then "fix" the columns by swapping values, working from left to right. I.e., if the column total is too high (over 480), find smaller numbers and swap. If the column total is too low (under 420), find larger numbers and swap.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.