in reply to Re^10: Tricky chemicals optimization problem
in thread Tricky chemicals optimization problem
In response to your call outs : I don't understand how you can "minimixe the number of nozzles"? Don't you need all the different flows to be separate? If not, why are there multiple flows of the same chemical on the same machine in the existing scheme? So if a chemical is the same, and its nozzle is on the same machine it can be collapsed into one. The reason my data is showing differently is because it represents real world inefficiencies in the manufacturing. Essentially the case you pointed out is an easy win or is a particular exception (perhaps due to flow rate which we don't know ). We are assuming now that it's always the former case, to simplify the analysis.
If you don't care how many machines, just have a separate machine for each chemical; and if the total flow required for a given chemical exceeds the machines capacity, add another for that chemical.I explained this poorly. What I should.have said is : we want to minimize the numbers of nozzles with precedence over minimizing the number of machines. The relative weighting of each is something I'm been thinking a lot about, but st a high level the minimizing of nozzles has to take precedence over minimizing of machines, that being said you still want to end with the fewest machines possible.
The code I supplied does a pretty good job of putting as many of the flows for a given chemical onto the same machine. If you can combine flows to a single nozzle, simply adding all the flows for a given chemical on a given machine into single nozzle will do a pretty good job of minimizing the number of nozzles. I hear what you are saying but I'm failing to see what the gap might be if we made minimizing the lines higher precedence... I.e., is the fact that your code is doing a good job of minimizing the nozzles a side effect of the operation , or are you purposefully designing it to do that -if so can you point out the line that provides that effect? If you switch all like chemical nozzles across different machines e.g., let's say : Mach A Chem A 45%, Mach B Chem A 30%, Mach C Chem A 40% , where the percents represent the percent of total capacity that flow value would take of a single machines capacity, the result you'd want is Mach A Chem A 85% (A+ C ), and then a second machine Mach B remains at 30% for Chem A because Mach A does not have the capacity left to take on this 30% block. Once you do this you would search for the optimal solution to fill in the remaining 15% capacity in Mach A with a different chemical(s), and 70% on Mach B with different chemical(s). Ideal here would be a second chemical that runs 10% on 7 machines, and thus can be collapsed into one nozzle that perfectly utilizes the 70% capacity remaining on machine B. Does the greedy algorithm approach still work optimally here? Or maybe a gradient descent? I'm really struggling to program in the logic I just described via the Chem A ,Chem B example due to the large numbers of machines and chemicals The code I posted already puts all the flows for a given chemical on a given machine into a separate array, so combining them would be trivial, assuming that there in no limit on the flow from a nozzle other than the machine limit. (A question I did ask but you didn't answer as far as I've noticed.) Which array is this in the code you provided?Re: flow - the 'flow' values (3rd column of the data) are actually seconds of flow, and the machines total capacity is also represented as seconds of flow. You must think of them as blocks though, as you currently are I.e., you can sum the seconds 'blocks' but not not split them into pieces.
On books- I definitely will do that and start reading this weekend. Thanks a ton for the help again. You're a wizard with this stuff.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^12: Tricky chemicals optimization problem
by BrowserUk (Patriarch) on Jan 11, 2017 at 23:02 UTC | |
by Anonymous Monk on Jan 16, 2017 at 01:55 UTC | |
by BrowserUk (Patriarch) on Jan 16, 2017 at 03:13 UTC | |
by Anonymous Monk on Jan 16, 2017 at 05:26 UTC | |
by BrowserUk (Patriarch) on Jan 16, 2017 at 21:56 UTC |