1

I am running a Tennis Website in behalf of a friend of mine because she's not that really passionate about technology and computers.

When we create a tournament subscription page, users and amateur tennis players fill out a form to subscribe to that tournament.

There is a field in the form where the user can describe their availability based on their needs.

Basically, users write when they can play matches, and most of the times they are time costraints, like for example:

"I can play all the evenings after 9.00 PM", "only in the weekdays", "because of work, I can play only in the weekends", "Always, except not after 10.00 PM every evening because I have to wake up early".

I call them time costraints.

Yesterday I found a new costraint, and it is like so:

"Me (UserA) and my friend (userB) will share the car in order to partecipate in the tournament, because we live far from you, and we have to travel long miles and we would like to come together in order to save fuel. As long as my friend is not eliminated in the tournament, I'd prefer to play in similar times with my friend (userB). If my friend is eliminated, I can always play everytime"

My question now is if there is an algorithm to satisfy all these costraints, or a precooked solution my friend can use even if she's not a techie or a geek.

I undertand that this algorithm should run after every day, because of course match winners are not known in advance and hence user time costraints vary. I also understand it is an operations research problem, but I haven't got experience and I'm not a professional programmer.

Please leave any pointer you may have on specific literature or software. Thanks

Jacquelyn.Marquardt
  • 602
  • 2
  • 12
  • 30
  • The easiest approach, although not trivial is to use constraint-programming technology which is usually 1) very declarative and 2) very performant for scheduling applications (sometimes some programmed search is needed; sometimes automatic search can be enough). Something like: `As long as my friend is not eliminated in the tournament` is usually using *reification* where some boolean variable might activate some constraints. Some mentionings of software: Gecode, ortools, Choco. Not all are easy to use (and internals differ a lot too!). But this is just a basic pointer towards some direction. – sascha Jun 26 '20 at 13:29
  • Describing a hard-feasibility model in these kind of libraries is not that hard and even search will probably work out great. But imho the more annoying thing is on the modelling-side: hard- vs. soft-constraints. How to make sure that you will find a solution -> e.g. by ignoring some wishes => inducing costs. This might render it an optimization-problem (where CP can work out too; but it's gotten harder then), where the modeller need to balance out these things somewhat a-priori (cost-factors and co.). Nothing worse than a service which does not produce any schedule due to incompatible input. – sascha Jun 26 '20 at 13:32
  • And crazy nerds might also target *robust* or *stochastic-optimization* where statistical-assumptions about this friend being eliminated are exploited to improve the schedule in regards to later events (e.g. a schedule which makes everyone happy but breaks if x is elimated early vs. a schedule which has 2 unhappy people, but things do not change much due to early or late elimination of x). Which schedule is better depends somewhat on those early elimination-chances. But this is tough! – sascha Jun 26 '20 at 13:39

1 Answers1

0

There is no precooked solution to such problems AFAIK. Somebody will have to build a model and an application for that.

As suggested, Constraint Programming is one technique that solves this kind of problem and proposes solutions that satisfy all given constraints. Choco is a very handy open source tool.

However, you may want to formulate it as an optimization problem. You want the algorithm to place each pair UserA/UserB in the same day/time slot when scheduling the next round. How many such pairs are there? What if it is not possible to place all such pairs? Go for the largest number of pairs would be doable using MILP. Maybe take history into account and average out the number of times each pair comes together ? Such a model is definitely more complex...

peter.cyc
  • 1,763
  • 1
  • 12
  • 19