Skip to content

An intelligent thesis defense scheduling system leveraging multi-objective optimization (NSGA-II) to generate optimal defense schedules considering staff availability and preferences. Full-stack web application with Flask API and PostgreSQL.

Notifications You must be signed in to change notification settings

WinterWollf/Thesis-defense-scheduler

Repository files navigation

Thesis Defense Scheduling System

An optimization-based approach to thesis defense planning

Engineering Thesis Project


πŸ“‹ Overview

This project presents an intelligent scheduling system for academic thesis defenses, leveraging multi-objective optimization techniques to generate optimal defense schedules. The system considers multiple constraints including staff availability, committee composition requirements, and interpersonal preferences among committee members.

The core optimization engine uses the NSGA-II (Non-dominated Sorting Genetic Algorithm II) algorithm to find Pareto-optimal solutions that balance multiple competing objectives.

🎯 Key Features

  • Multi-objective Optimization: Simultaneously optimizes for committee member affinity and defense start times
  • Constraint Handling: Respects hard constraints (availability, committee composition) and soft constraints (preferences)
  • Web-based Interface: Modern, responsive UI for data management and schedule visualization
  • RESTful API: Flask-based backend with comprehensive endpoints for all operations
  • Docker Support: Fully containerized deployment with PostgreSQL and Nginx
  • Bilingual Support: User interface available in English and Polish
  • Real-time Simulation: Live progress tracking during optimization runs

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                         Nginx (Reverse Proxy)                   β”‚
β”‚                              Port 80                            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    Flask API (Gunicorn)                         β”‚
β”‚                           Port 5000                             β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”‚
β”‚  β”‚   Routes    β”‚  β”‚  Services   β”‚  β”‚  Optimization Engine    β”‚  β”‚
β”‚  β”‚             β”‚  β”‚             β”‚  β”‚  (pymoo / NSGA-II)      β”‚  β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                   β”‚
                                   β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    PostgreSQL Database                          β”‚
β”‚                           Port 5432                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

🧬 Optimization Problem

Decision Variables

Each decision variable represents the selected time slot and committee composition option for a thesis defense.

Objectives

  1. Maximize Committee Affinity (minimize negative affinity): Sum of preference scores between committee members
  2. Minimize Average Start Time: Earlier defenses are preferred

Constraints

  • Hard Constraints:

    • All committee members must be available during the defense
    • No scheduling conflicts (a staff member cannot be in two committees simultaneously)
    • Committee must consist of exactly 3 members (chairperson, supervisor, reviewer)
  • Soft Constraints:

    • Preferences between staff members (likes/dislikes)

πŸš€ Getting Started

Prerequisites

  • Docker and Docker Compose
  • Git

Installation

  1. Clone the repository

    git clone https://github.com/WinterWollf/Engineering-thesis.git
    cd Engineering-thesis
  2. Configure environment variables (optional)

    # Create .env file with custom settings
    cat > .env << EOF
    POSTGRES_DB=thesis
    POSTGRES_USER=thesis_user
    POSTGRES_PASSWORD=your_secure_password
    EOF
  3. Start the application

    docker-compose up -d
  4. Access the application

    • Web Interface: http://IP
    • API Health Check: http://IP/api/health

Local Development

For development without Docker:

  1. Create virtual environment

    python -m venv venv
    source venv/bin/activate  # Linux/macOS
    # or: venv\Scripts\activate  # Windows
  2. Install dependencies

    pip install -r requirements.txt
  3. Run the development server

    python web/api/app.py

πŸ§ͺ Testing

The project includes a comprehensive test suite using pytest.

# Install development dependencies
pip install -r tests/requirements-dev.txt

# Run all tests
pytest tests/unit_tests/

# Run with coverage report
pytest tests/unit_tests/ --cov=optimization --cov=adapters --cov-report=html

# Run specific test file
pytest tests/unit_tests/test_algorithms.py -v

πŸ“Š API Endpoints

Staff Management

Method Endpoint Description
GET /api/staff List all academic staff
POST /api/staff Add new staff member
PUT /api/staff/{id} Update staff member
DELETE /api/staff/{id} Remove staff member

Availability

Method Endpoint Description
GET /api/availability List all availability entries
POST /api/availability Add availability slot
DELETE /api/availability/{id} Remove availability

Preferences

Method Endpoint Description
GET /api/preferences List staff preferences
POST /api/preferences Add preference relationship
DELETE /api/preferences/{id} Remove preference

Theses

Method Endpoint Description
GET /api/theses List all theses
POST /api/theses Register new thesis
DELETE /api/theses/{id} Remove thesis

Simulation

Method Endpoint Description
POST /api/simulation/run Start optimization
GET /api/simulation/status Get simulation progress
GET /api/simulation/results Retrieve optimization results

Health

Method Endpoint Description
GET /api/health Service health check

βš™οΈ Configuration

Key configuration parameters in config.py:

# Data source configuration
DATASOURCE = "postgres"  # 'excel' or 'postgres'
SINK = "postgres"        # 'excel' or 'postgres'

# NSGA-II Algorithm parameters
POP_SIZE = 300           # Population size
N_GEN = 100              # Number of generations
CROSSOVER_PROB = 0.9     # Crossover probability
CROSSOVER_ETA = 20       # SBX distribution index
MUTATION_ETA = 20        # PM distribution index

# Solution selection weights
AFFINITY_WEIGHT = 0.8    # Weight for committee affinity
START_TIME_WEIGHT = 0.2  # Weight for start time minimization

πŸ› οΈ Technology Stack

Backend

  • Python 3.12 - Core programming language
  • Flask 3.1 - Web framework
  • Gunicorn - WSGI HTTP server
  • pymoo 0.6 - Multi-objective optimization framework
  • NumPy - Numerical computing
  • Pandas - Data manipulation
  • psycopg 3 - PostgreSQL adapter
  • Pydantic - Data validation and settings

Frontend

  • HTML5 / CSS3 - Structure and styling
  • Vanilla JavaScript - Interactive functionality
  • Responsive Design - Mobile-friendly interface

Infrastructure

  • Docker - Containerization
  • PostgreSQL 17 - Relational database
  • Nginx - Reverse proxy and static file serving

Testing

  • pytest - Testing framework
  • Hypothesis - Property-based testing
  • pytest-cov - Coverage reporting

πŸ“ˆ Database Schema

-- Core entities
academic_staff        -- Staff members with academic ranks
theses                -- Thesis registrations with supervisors/reviewers
staff_availability    -- Time slots when staff is available
soft_constraints      -- Preference relationships between staff
committee_date        -- Available dates for defenses

-- Results
defense_schedule           -- Generated committee schedules
committee_thesis_assignment -- Thesis-to-committee mappings

πŸ“„ License

This project was developed as an engineering thesis at a AGH University of Cracow.

πŸ‘€ Author

Wiktor Szyszka - Engineering Thesis Project

πŸ“š References

If you use this project or find it helpful, please consider citing the pymoo library which powers the optimization engine:

@ARTICLE{pymoo,
    author={J. {Blank} and K. {Deb}},
    journal={IEEE Access},
    title={pymoo: Multi-Objective Optimization in Python},
    year={2020},
    volume={8},
    pages={89497-89509},
    doi={10.1109/ACCESS.2020.2990567}
}

Blank, J., & Deb, K. (2020). pymoo: Multi-Objective Optimization in Python. IEEE Access, 8, 89497-89509. https://doi.org/10.1109/ACCESS.2020.2990567

About

An intelligent thesis defense scheduling system leveraging multi-objective optimization (NSGA-II) to generate optimal defense schedules considering staff availability and preferences. Full-stack web application with Flask API and PostgreSQL.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published