- About the Project
- Features
- Getting Started
- Usage
- Directory Structure
- Technologies Used
- Future Improvements
This project demonstrates how to optimize football player rotations across multiple matches using Gurobi, a mathematical optimization solver. Coaches must consider factors such as:
- Player fatigue and physicality.
- Match difficulty.
- Goals per game.
The app ensures optimal performance over a season by using mathematical modeling to generate the best possible team lineup for each game.
-
Frontend:
- Choose your favorite team from a visually appealing UI.
- Setup matches with opponent names and difficulty levels.
- View optimized results for player rotations.
-
Backend:
- Solve optimization problems using Gurobi.
- APIs to manage teams, players, and match setups.
- Scalable architecture for advanced features.
Before running the project, ensure you have the following installed:
- Python 3.8+
- Node.js (v16+ recommended)
- Gurobi Optimizer
- A modern web browser
-
Clone the Repository:
git clone https://github.com/HIJOdelIDANII/Optimization-of-Football-Player-Rotations-Using-Gurobi.git cd Optimization-of-Football-Player-Rotations-Using-Gurobi -
Backend Setup:
- Navigate to the backend folder:
cd backend - Install dependencies:
pip install -r requirements.txt
- Run the backend server:
python main.py
- Navigate to the backend folder:
-
Frontend Setup:
- Navigate to the frontend folder:
cd ../frontend - Install dependencies:
npm install
- Start the development server:
npm run dev
- Navigate to the frontend folder:
| Route | Method | Description |
|---|---|---|
/api/teams/ |
GET | Fetch all teams. |
/api/teams/<team_name>/players/ |
GET | Fetch players of a specific team. |
/api/optimise/<team_name>/ |
POST | Get optimized player rotations for matches. |
Request Body:
{
"numberMatches": 5,
"matchesChosen": {
"1": {"opponent": "Everton", "difficulty": 1.0},
"2": {"opponent": "Chelsea", "difficulty": 1.5},
"3": {"opponent": "Arsenal", "difficulty": 0.5}
}
}Response:
{
"lineups": [
{"match": 1, "players": ["Player A", "Player B", "Player C"], "goals": 2.7, "opponent": "Everton"},
{"match": 2, "players": ["Player A", "Player D", "Player E"], "goals": 1.8, "opponent": "Chelsea"}
],
"player_statistics": [
{"player": "Player A", "matches_played": 2},
{"player": "Player B", "matches_played": 1}
],
"total_goals": 4.5
}-
Choose Your Favorite Team:
- Select a team from the home page.
-
Set Up Matches:
- Add matches by specifying the opponent and difficulty level.
-
View Results:
- See the optimal player rotations and statistics.
📦 Optimization-of-Football-Player-Rotations-Using-Gurobi
├── backend
│ ├── instance/
│ ├── __pycache__/
│ ├── BackendLogic.py
│ ├── config.py
│ ├── main.py
│ ├── models.py
│ ├── requirements.txt
├── frontend
│ ├── node_modules/
│ ├── public/
│ ├── src/
│ │ ├── components/
│ │ ├── pages/
│ │ └── App.jsx
│ ├── package.json
│ ├── vite.config.js
└── .gitignore
- Backend: Python, Flask, Gurobi
- Frontend: React, Vite
- Database: SQLite
- Styling: CSS
- Integrate player injury data into the optimization model.
- Visualize player statistics with interactive charts.
- Expand support to more leagues and teams.
HIJOdelIDANII
- GitHub: HIJOdelIDANII