- Where Developers Learn, Share, & Build Careers


I'm unsure of distributing an indefinite program. It is currently run as a recursive and a single program, but my goal is to distribute this program to other machines which only generate a subset of data.

The background of this program is here, I give it a list of targets (10 in this case) and minimum / maximum weight items and it gives a combination of each.

with 3 items, and

  lower = 2, 2, 2 high = 6, 6, 6 target = 10   

The result is:

  2 2 4 2 3 3 2 4 2 3 2 3 3 3 2 4 2 2   

Here's the way to work :

  zero distribution (int i, int [] low, int [] high, last int breast, int [] size) {// System.out.println (i + "+ + + + "+ Size"); If (I == sizes, length - 1) {if (left & lt; high [i]) {size [i] = rest; Result.add (Arrays.copyOf (size, size, length)); }} For (int c = 0; c & lt; = java.lang.math.min (high [ii] - less [i], rest); ++ c) {size = i] = c; Distribute (i + 1, low, high, comfort - c, size); }}   

Let's think if anyone has any idea how to distribute the output, in the above example, if I have 3 servers, then each server has only 2 unique entries Generates the whole thing instead of producing the thing, in advance I know that there will be 6 results and 2 will have to be distributed in each machine, how can I do this? Is it possible and if so, what is the logic?

If it helps, then this is the entire program:

I think That is, you want to run the algorithm on many machines and then unite the results. You just have to split the execution, it should not be very difficult because the parameters already limit the results.

For example, replace the L: [2,2,2] H: [6,6,6] [4,2,2] H: [5, 6,6] L: [6,2,2] H: [6,6,6]

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -