Need to divide a group

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • CD Tom
    Contributor
    • Feb 2009
    • 495

    Need to divide a group

    this is a general example of what I am trying to do.
    I have a group of 50 people and have 12 tables, I need to put two people at each table but can't have the same two people together. I've tried doing a random numbering, but I still end up with the same two people at the same table. Does anyone have any idea how I can do this. Any help would be appreciated.

    Thanks.
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32645

    #2
    Hi Tom.

    I'm thoroughly confused. I can't imagine a scenario, that fits your description even remotely, where any person could ever be at more than one table - let alone at multiple tables where the table pairings are the same as any others.

    Is there maybe something important missing from the question?

    Comment

    • CD Tom
      Contributor
      • Feb 2009
      • 495

      #3
      Sorry for the confusion so let me see if i can explain it better. I'll use a different example
      I have 4 or 6 lanes. (The lane number can very between 4 or 6) each lane will have two people assigned to it. Lane 1 and Lane 2 will have two people assigned. 3 and 4 will have two people assigned these people race down the lanes you have a winner for Lane 1 and 2 and a winner for lanes 3 and 4.
      The people can run this race up to twelve times. but the two racers cannot run against each other again. The database has a master file with maybe 500 people in it, People register for this event so I never know how many there will be at any event until registration is complete. Then I have to come up with an assignment list as to what table people will be assigned to.
      I don't know if this makes sense, but I hope so.
      Again Thanks

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32645

        #4
        Hi Tom.

        I was rather worried this might be leading in that direction. Worried because this is a lot more complicated than one might think who doesn't have a clear understanding of what is involved. It's often easier to explain something in common language that covers much of the situation without the full purport necessarily being appreciated. So is the case here.

        To start with, or possibly even - before we can even start with this - we need to be even more clear about the logic rules where two runners cannot compete against each other more than once. Does this mean ever? Must each compete against every other once & only once? What is the significance of 6 & 8 lane races? Would this be equivalent to 3 or 4 separate 2-lane races or is there some (as yet unexplained) significance or connection between the 3 or 4 pairs of competitors all running together? It would be simpler if there was none. So, before we continue in earnest, we absolutely must understand the starting parameters of the problem.

        When we have a clear understanding of what we're trying to achieve then we need to decide how to store the information about who has already faced off against whom. This can be (is) messy as there is no easy place to both store it and retrieve it conveniently for later use. In order to avoid a repeat match then this data will need to be retrievable at the time of, or before, the random numbers are generated that will indicate who should be matched with whom.

        Why "at the time of, or before"? If we only find out that a match is invalid after it's been suggested then we'll need to run the process again, and possibly yet again ad infinitum, until a valid match is found.

        Consider also, that this approach will be unreliable in the following scenario :
        We are working with a subset of competitors from A to D.
        A has matched with B & C already but not with D.
        B has matched with A already but not with C or D.
        Neither C nor D has never matched within this subset before.
        Consider further that the first match that comes up is C & D. A perfectly valid match. However this leaves A & B left and we know such a match is invalid. A possible solution would be A & D followed by B & C.

        Notice how this desired result is not reachable simply by finding & selecting one valid pair after another.

        I'm sorry to say, and hopefully I've explained in a way that you and others reading this can understand - even though the logic is quite involved and complicated - that, while it may be possible to get something that can help you approximate to a solution, getting a full solution is beyond my competence.

        Comment

        • CD Tom
          Contributor
          • Feb 2009
          • 495

          #5
          i've been working many different ways to try and come up with a solution.
          Runners register for the match. this number can be any number of runners. Each runner in the database has a unique identifier.
          The number of rounds they can run can be as high as 12 time but usually no lower than 6, this depends on the match director and his decision may be decided by the number of runners that have signed up.
          When registration is complete, I need to create a list that shows the runners which lane they will be assigned to for each run.
          Runners cannot run against the same person only in this match, they can run against the same person in the next match.
          On the first-round lanes 1 and 2 run against each other, 3 and 4 run against each other, and if there are 6 lanes then lanes 5 and 6 run against each other.
          After the first round then the runners that were on lanes 1 and 2 can't be matched up again the same with the other lanes. The shooter on lane one can be assigned to any other lane of even the same lane. The lane a runner is assigned to doesn't matter.
          After the first group of runners have finished then the next group will take their assigned lanes This continues until all groups have competed. Then the second round will start.
          Here's something I've tried.
          I started by randomly selecting a runner from those registered and added him to a table with columns for round1 through the number of rounds that are being run, then I randomly picked another runner from the registered runners and added his unique identifier (I do check that the random number hasn't been already used) to the table I continue this until all runners are in the table. then I go through the table and 1 and 2 will run together, 3 and 4 will run together and so on. if there is an odd number then that runner gets a bye. then I go randomly through the registered shooters again and this time put the runner in round2. this worked for me until usually the 3rd or 4th round.

          Comment

          • CD Tom
            Contributor
            • Feb 2009
            • 495

            #6
            I've come up with an idea but not sure how to implement it. Here's my thoughts.
            I have 40 registered runners.
            round 1: 1 round 2. 2 round 3. 3 round 4 4 round 5continue for as many rounds as selected.
            1--------- 2 ---------- 3---------- 4 -----------5
            2--------- 3 ---------- 4 ----------5 -----------6
            3--------- 4 ---------- 5---------- 6 -----------7
            4--------- 5 ---------- 6 ----------7 -----------8
            5--------- 6 -----------7---------- 8 -----------9
            6--------- 7 ---------- 8---------- 9 -----------10
            etc etc etc etc
            What I will do is build a table with columns for round1 through round12 and I will load round1 with the runners Id the same for the rest of the rounds.
            I just not sure of a good way to access the registered table to get the correct runners ID
            runners 1 to 40 1 against 2, 3 against 4, 5 against 6
            in round 2 runners 1 to 40 only I have to start with the second runner in the registered table. but when I get to the 40th runner in the registered table I need to go back so registered runner 40 will be against runner 1
            in round 3 runners 1 to 40 only this time I have to start with the third runner in the registered table. then when I to the 39th runner in the registered table i have to go back and start with the 1st registered runner so registered runner 39 will be running against runner 1 and runner 40 against runner 2

            If you are not already confused, do you think this will work.
            again thanks for any help.

            Comment

            • CD Tom
              Contributor
              • Feb 2009
              • 495

              #7
              I see that my first thoughts are not going to work. in round 2 runners 3 and 4 and 5 and 6 and so forth.
              So how about this.
              Again, I'm starting with 40 registered runners. Round1 is pretty straight forward.
              Not sure how many rounds there will be but no more than 12.
              I know what round number I'll be in so I can use that to setup the table lookup. If I knew how to do that. Round 2 I can start with registered runner 1 and then go to the end to get the runner he will be competing against. but then how do I get back to get next round.
              If anybody has any ideas, I would love to hear them.

              round1 Round2 Round3 Round4 and Round5
              -----1 -------1--------3---------5-----------7
              -----2--------40------40-------40----------40
              -----3---------2--------4--------6------------8
              -----4--------39-------39------39----------39
              -----5---------3---------5-------7----------- 9
              -----6--------38-------38-------38---------38
              -----7---------4---------6--------8---------10
              -----8--------37-------37-------37---------37
              I've penciled this out and if I've done it right, I think this will work now my only problem will be how to have the program do it.
              does anybody have any ideas as to how to make this work.

              CD

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32645

                #8
                Hi Tom.

                Be very clear - Your task is an extremely complicated one. If there even is a solution then I don't know of it. Many have tried before (Similar concept at least) and I know of none that have succeeded :-(

                I did work out a solution whereby you can guarantee that each random number will use a different item from any selection(Dealing Cards), if that's any use to you.

                Comment

                Working...