Hi all,

For my sins, I'm about to take over as secretary of a local pool league

Part of the responsibilities include generating league schedules.

A standard algorithm is used - best explained here.

Each team plays each other twice, once at home, and once away.

But there's a small problem with it, and my brain hurts, so I wondered if anyone has any input...

Some venues have two teams but only one pool table. In these instances, one team must play away, and one team must play at home each week.

My (so far unprogrammed :) solution involves the following:

Now comes the bit where my brain wobbles a little.

If we could assume that no more than 1/3 of all teams will have the issue of both teams not being able to play at home at the same time, is there a general algorithm we could apply to the final schedules to rejig games to ensure no problems occur?

My initial thought was to run through the schedule for each team once. If a 'double home' was found, reverse the playing of that game and switch the game in the second half as well to balance out. Of course, that could create a problem elsewhere, so on its own is probably not ideal.

argghhh, no, fried again. Sometimes when writing a question here I get the answer sorted before I finish typing. This time I just want to lie down and put a paper bag over my head.

thoughts?

cLive ;-)

--
seek(JOB,$$LA,0);


In reply to league games schedule algorithm by cLive ;-)

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.