Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Senior Coder
    Join Date
    May 2006
    Posts
    1,673
    Thanks
    28
    Thanked 4 Times in 4 Posts

    How do I systematiccally walk through all combinations of these sets of data ?

    Hi,

    I have many sets of data that I want to combined to produce
    unique groups.

    These are the data sets:

    {A_01|A_02|A_03|A_04|A_05}
    {B-01|B-02|B-03|B-04|B-05|B-06|B-07|B-08|B-09|B-10|B-11|B-12}
    {C-01|C-02|C-03}
    {D-01|D-02|D-03|D-04|D-05|D-06|D-07}
    {E-01|E-02|E-03|E-04|E-05|E-06|E-07|E-08|E-09|E-10}
    {F-01|F-02|F-03|F-04}
    {G-01|G-02}
    {H-01|H-02|H-03|H-04|H-05|H-06|H-07|H-08|H-09}
    {I-01|I-02|I-03|I-04}
    {J-01|J-02|J-03|J-04}

    Notice that sets F , I and J have the same number of data elements.

    ( I was using the random function but this often does
    not use all data points and sometimes uses one datapoint 3 or 4 times )

    So I want to try and systematically use all the combinations and avoid
    duplicating the patterns.

    But I am not sure how to do this ...

    My output should be something like:

    0) A_01 B-01 C-01 D-01 E-01 F-01 G-01 H-01 I-01 J-01
    1) A_02 B-02 C-02 D-02 E-02 F-02 G-02 H-02 I-02 J-02
    2) A_03 B-03 C-03 D-03 E-03 F-03 G-01 H-03 I-03 J-03
    3) A_04 B-04 C-01 D-04 E-04 F-04 G-02 H-04 I-04 J-04
    4) A_05 B-05 C-02 D-05 E-05 F-01 G-01 H-05 I-02 J-03 < -- I start position increased by 1 and J by 2
    5) A_01 B-06 C-03 D-06 E-06 F-02 G-02 H-06 I-03 J-04
    6) A_02 B-07 C-01 D-07 E-07 F-03 G-01 H-07 I-04 J-01
    7) A_03 B-08 C-02 D-01 E-08 F-04 G-02 H-08 I-01 J-02
    8) A_04 B-09 C-03 D-02 E-09 F-01 G-01 H-09 I-02 J-03
    9) A_05 B-10 C-01 D-03 E-10 F-02 G-02 H-01 I-03 J-04
    10) A_01 B-11 C-02 D-04 E-01 F-03 G-01 H-02 I-04 J-01
    ...
    ...

    This is just an example ...

    I should be able to get a hundred or ( maybe ) several hundred
    unique combinations.

    Any suggestions on how to code this ?

    Thanks.



    .
    If you want to attract and keep more clients, then offer great customer support.

    Support-Focus.com. automates the process and gives you a trust seal to place on your website.
    I recommend that you at least take the 30 day free trial.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Looping.
    Although you won't be able to process them all in a reasonable time since there appears to be approximately 14.5 million combinations on the results you have provided.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •