This repository contains code for optimizing football league schedules using Pyomo, a Python-based optimization modeling language. The optimization model is demonstrated using the example of Bundesliga schedule planning.
Here is a Medium article that describes what we are going here with football league schedule optimization :)
Run the model with the following:
- Option 1:
python main.py
- Option 2:
streamlit run streamlit_app.py
Crafting a football league schedule involves various considerations such as fairness, balance for each team, international competitions, and minimizing travel. This project explores how mathematical optimization can tackle these challenges, focusing on the Bundesliga schedule.
Bundesliga results from 1993–2022 are utilized to define team characteristics, while season 21–22 serves as the basis for building the league schedule. Additionally, the coordinates of each club's stadium are used to consider distances while constructing the optimization model.
The goal of the optimization model is to assign match round numbers for each fixture, ensuring fairness and adherence to various constraints. Pyomo is employed to formulate the model's constraints and objective function.
The optimized Bundesliga schedule is reconstructed using boolean variables generated by the optimization model, ensuring fairness, minimized travel, and an exciting season for football fans.
Feel free to explore the code and adapt it for your own scheduling projects! If you have any questions or suggestions, please don't hesitate to reach out. Let's optimize football schedules together! 🏆⚽