This repository contains a Python script (SwissPairing.py
) that implements a tournament management system. The system handles team pairings, match simulations, score updates, and rating adjustments based on match outcomes.
- Team Pairings: The system pairs teams for matches, ensuring fair matchups and minimizing repeat pairings.
- Match Simulation: Simulates matches between paired teams using a random probability model based on their ratings.
- Score and Rating Updates: Updates scores and ratings of teams based on match results.
- Constraints Handling: Applies constraints to keep team ratings within specified upper and lower limits.
- Bye Team Handling: Manages teams with byes by adjusting their ratings and scores appropriately.
-
Clone the repository to your local machine:
git clone https://github.com/your-username/Tournament-management.git
-
Install the required dependencies. Ensure you have Python and pip installed. Run:
pip install pandas
-
Prepare the team data:
- Create a CSV file named
data.csv
containing team information such as Team Name, Rating, and Language of Code. - Ensure the CSV file is structured with appropriate columns and data types.
- Create a CSV file named
-
Run the script
SwissPairing.py
:python SwissPairing.py
-
The script will load the team data from
data.csv
, perform team pairings, simulate matches, and update scores and ratings accordingly. -
Monitor the output to see match results, updated scores, and ratings for teams.
- Trade-off between Uniqueness and Similar Ratings: Due to the algorithm's emphasis on unique pairings and fair matches, occasional repeat matchups may occur, affecting approximately 8-9 matches out of a total of 240 matches played.
Contributions to improve the system's functionality, efficiency, or documentation are welcome. Please follow the standard GitHub workflow:
- Fork the repository.
- Create a new branch (
git checkout -b feature-improvement
). - Make your changes and commit them (
git commit -am 'Add new feature'
). - Push your changes to the branch (
git push origin feature-improvement
). - Create a new Pull Request.
This project is licensed under the MIT License.