bracket icon indicating copy to clipboard operation
bracket copied to clipboard

Court scheduling algorithm

Open nvanheuverzwijn opened this issue 8 months ago • 2 comments

I spent some time reading the source code and it seems that there is no court scheduling algorithm for round-robin and singe elimination. Swiss format is kinda doing it's own thing i.e. match scheduling has to be done manually (which make sense) but the button to schedule all match is not working for swiss format (which again, make sense).

Each format should have a scheduling algorithm associated with them. Round robin is either spread matches to all court or to custom court, same for single elimination. Swiss is a special case of scheduling because it kinda have to be manual, otherwise, that kinda become a round robin.

Is this something you were working on ?

nvanheuverzwijn avatar Apr 09 '25 13:04 nvanheuverzwijn

hmm yes there's two court scheduling "algorithms":

  • swiss: just assign every match in a round to a court, since rounds don't overlap in time and there's not more matches per round than there are courts
  • round-robin/elimination: you can press the "Schedule all matches now" or something button, which I think just works quite stupidly and first spreads all matches from the first stage item over all courts, and then the second stage item etc. It doesn't take conflicts into account either.

Now it's a bit of a bug indeed that you can change the schedule of swiss matches from the page where you can change the schedule of elimination/round-robin stage items, which shouldn't be the case. Swiss matches should only be allowed to be rescheduled from the swiss management page.

So there's two problems:

  • court and time scheduling for round-robing/elimination could be smarter
  • it should be disallowed to reschedule swiss matches from the page where you reschedule round-robin/elimination matches. (but they should still be displayed there I guess for sake of completeness)

does that make sense?

evroon avatar Apr 09 '25 13:04 evroon

Yes, that make sense.

Should be straight forward but that's a fair amount of refactor: schedule all the matches as efficiently as possible, on all court, without conflict then insert all of that in the database. Right one, inserting and scheduling is done at the same time.

FYI, The schedule all matches button put all matches of the all the stageitem of the first stage in the first court then, for the next stage, it schedule all matches of all the stage items to the second court (if there is one), etc.

nvanheuverzwijn avatar Apr 09 '25 14:04 nvanheuverzwijn