I'm trying to figure out what you are trying to do. I admit I have not looked at your code yet, but I have looked at your "Understanding Paneling Image", and it only confused me.

In the first picture it says that A3 only has 4 options, I don't see why. I would think that A3 in the first round could be joined with any 2 non 'A' groups. So you could have 6 different groupings of just Letters that include the A group (ABC, ABD, ABE, ACD, ACE, ADE). If I'm not misunderstanding (which is entirely possible), I would think you could use an list for each member (A1, A2, B3...) and keep the list of other groups that group has competed with already. Then just iterate (or randomly select), and reject if the school is the same, or if the chosen group is in the list.

And now that I have written all that, I see you already have code that works? Maybe you should re-phrase the question?

You say that it doesn't work all of the time, is that because of un-even numbers of teams in each group? If you find that if you run your program enough times you get an answer, even if it has to run 5 times, unless it takes hours (and even then if you have the time) why not check the results for 'correctness' and if it is not right, just loop back until you get an answer that works?


In reply to Re: Perl for Adjudication by Helter
in thread Perl for Adjudication by dejoha

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.