0
$\begingroup$

I have a two-dimensional choose problem.

 x: 18  21  29      
 y: 28  38  48      
 z: 99  112 127 130 131
 AA: 11  22  12 23
 BB: 55 22 23 23 13 30 34
 CC: 9  3  21 23 33 44 53 343

I need to write all combinations that MUST include one each from x, y,z, AA, BB, CC rows.

One straight forward combination would be x-18, y-28, z-99, AA-11, BB-55, CC-9

I need help in figuring and writing down all combinations.

$\endgroup$
3
  • $\begingroup$ You need to write them all down? Even ignoring CC, there are hundreds, if I understand the objective correctly. $\endgroup$
    – pjs36
    May 19, 2016 at 1:07
  • $\begingroup$ 10080 different ways to combine these items, if i understand correctly... $\endgroup$
    – buruzaemon
    May 19, 2016 at 1:43
  • $\begingroup$ I need to write them all down. This is my worst case list. $\endgroup$
    – user914425
    May 19, 2016 at 1:53

1 Answer 1

0
$\begingroup$

I am able to solve this using Python script:

import itertools
a = [[18,  21,  29], [28  38  48], [99  112 127 130 131], ...]
z=list(itertools.product(*a))
print z
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.