The Padel Planner 3000 - The challenges of organizing an Internal Competition
Another gray and rainy Sunday in Belgium… The ideal moment for a small side project. But what to do? A colleague recently told me about the challenges of organizing Datashift’s internal Padel-competition. Each quarter Datashifters battle it out on the padel-court to decide who will be the padel king or queen of this quarter. But as the number of colleagues that enter the competition is rising rapidly, it gets more and more complicated to organize the individual games. This sounds like an optimization problem worth solving, let’s see what we can do. But first, coffee!
Challenge
In essence the challenge is quite simple. You have a lot of Datashift colleagues that want to play padel. Put them in groups of four and organize the games. All of the players need to play at least tree games (and preferably not 20). However we have some real padel-talent in house and others will be playing their first game in the Datashift-league. We do not want these people to battle it out in their first game. In addition, multiple games are played on the same day. So we need to make sure that people are not scheduled in overlapping games and that they have some time in between to take some rest. That sounds easy doesn’t it?
Solution
On a high level the task is straightforward. Decide for each player, for each game whether or not they play that game and make sure all the conditions are met. This is an integer programming problem. We can solve this by modelling the problem mathematically and solving the equations. Luckly the python package Gekko can help us with this.
Result
The results are quite amazing. You input the names of the players that entered the competition, each with their skill-level. The output is a completed planning that explains you the teams that play against each other in each game. In addition we can also create a player based view that shows for each player which games they have to play. All this with a single click of a button.
Sometimes the competition presents scenarios where finding a solution becomes impossible. This occurs when it's not feasible to create a schedule for which everyone only plays three games, avoids back-to-back matches and were the beginners never face off against the pro’s. In these cases we have to relax some constraints. For example by playing more games or being more forgiving in who plays against who. (we haven’t yet gotten to the point where someone had to play two games at the same time). Luckily all of this could also be integrated in the solution.
Conclusion
The moral of this example is quite straightforward. If you allow analytics to help you in live, you can spend some time on the rainy days to automating your solution allowing you to play padel when the sun is shining. Moreover, automating the tedious aspects of your tasks not only saves time but also results in optimal solutions.
Are you excited to learn what analytics can mean for you? Please reach out and I am happy to discuss the possibilities, but please, let’s not do it on a Sunday.