Skip to content

shayan0373n/badminton-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

58 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Badminton Club Night Manager

A Streamlit-based application for organizing badminton club night sessions with optimized match generation and skill-based player ratings.

Features

  • Smart Match Optimization: Uses Gurobi to solve a multi-objective integer linear program (ILP) that minimizes a weighted combination of:
    • Skill spread — difference between the strongest and weakest player on each court (uses tier ratings)
    • Team power imbalance — difference in combined ratings between opposing teams (uses real skills)
    • Court repetition — penalizes players who frequently share a court to encourage variety
  • TrueSkill Through Time Ratings: Player skill tracking with uncertainty-aware ratings that improve over time
  • Flexible Game Modes: Support for both singles and doubles matches
  • Session Management: Create, pause, resume, and track multiple sessions
  • Player Registry: Persistent player database with customizable prior skill estimates
  • Organic Gender Balancing: Uses Z-score normalized tier ratings so top females group with top males naturally, without hard-coded penalties

Mathematical Foundations — Detailed write-up of the Bayesian rating model, ILP formulation, and constraint programming backend.

Tech Stack

  • Frontend: Streamlit
  • Optimization: Gurobi
  • Database: Supabase
  • Rating System: TrueSkill Through Time

Setup

  1. Install dependencies:

    pip install -r requirements.txt
  2. Configure Supabase credentials in .streamlit/secrets.toml:

    SUPABASE_URL = "your-supabase-url"
    SUPABASE_KEY = "your-supabase-key"
  3. Run the application:

    streamlit run 1_Setup.py

Usage

  1. Setup Page: Configure player registry, session parameters, and court count
  2. Session Page: Run matches, record results, and view standings

Project Structure

├── 1_Setup.py           # Main entry point and session setup UI
├── pages/
│   └── 2_Session.py     # Active session management UI
├── session_logic.py     # Core session and player logic
├── optimizer.py         # Match generation optimization
├── rating_service.py    # Tier rating and real skill computation
├── database.py          # Supabase database operations
├── recalculate_ratings.py # TTT rating recalculation
└── constants.py         # Application constants

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors