Skip to content

vedangdhuri/Opti-Time-69

Repository files navigation

πŸ—“οΈ Opti-Time: Automated Class Timetable Generator

Python Version Django License Status PRs Welcome GitHub issues GitHub last commit

A robust, randomized heuristic-based system for automated academic scheduling.

Features β€’ Tech Stack β€’ Algorithm β€’ Installation β€’ Research


πŸ“– About The Project

Opti-Time is a powerful Django-based application engineered to solve the NP-hard problem of university timetabling. It automates the complex process of scheduling classes, practical batches, and teacher assignments while strictly adhering to hard constraints and optimizing for soft constraints.

It handles multiple classes (e.g., FYCO, SYCO, TYCO), subject constraints, practical batches (A1, A2, A3), and teacher availability to produce conflict-free, optimized schedules.


πŸš€ Key Features

Feature Description
πŸ€– Automated Scheduling Generates valid timetables for multiple classes simultaneously with a single click.
⚑ Conflict Detection Real-time validation ensures no teacher or room is double-booked across different classes.
πŸ§ͺ Batch Management Automatically handles practical sessions for distinct batches (A1, A2, A3) ensuring unique teacher assignments.
βš–οΈ Smart Allocation Prioritizes practicals (2hr blocks), distributes theory lectures evenly (Max 2/day), and fills gaps intelligently.
πŸ‘¨β€πŸ« Faculty Timetables Aggregated individual schedules for every teacher across all departments and classes.
πŸ§‘β€πŸ’» Teacher Workload Custom dashboard to track total weekly hours per teacher and actively highlight any double-booking conflicts.
πŸ‘€ User Profiles Secure authentication system with visually stunning, Tailwind-styled profile pages and simplified user details.
🎨 Modern UI/UX Completely redesigned interface featuring glassmorphism, responsive navigation, and beautiful Tailwind styling.
πŸ“š Global Subjects Define Master Subjects in Admin to automatically suggest and auto-fill workloads.
πŸ“ˆ Global Analytics Dedicated institutional-level dashboards to holistically view overall validations, workload, and conflicts.
πŸ“Š Class Dashboard Visualizes per-class workload distribution to identify underloaded or overloaded resources.
πŸ•³οΈ Smart Gap-Filling Dynamically add extra lectures to remaining empty slots without affecting the optimized core schedule.
πŸ”„ Dynamic Regeneration Seamlessly regenerate the timetable with a single click to explore and refine scheduling alternatives.
πŸ“₯ Export Ready Download generated timetables in professional PDF, Excel, and PNG formats.
🌱 Data Seeding Includes scripts to populate initial sample data for robust testing and demonstration.
πŸ“ Architecture Docs Includes detailed System Design and multiple UML diagrams mapping out the core application logic.

πŸ› οΈ Tech Stack

This project uses a modern, robust technology stack:

Backend

  • Python Python 3.11+ - The core programming language.
  • Django Django - The high-level web framework.
  • SQLite SQLite - Local development database.
  • PostgreSQL PostgreSQL - Production-ready database support via dj_database_url.
  • WhiteNoise WhiteNoise - For efficient static file serving in production.

Frontend

  • HTML5 HTML5 - Structuring the web pages.
  • CSS3 CSS3 - Styling and layout.
  • JavaScript JavaScript - Dynamic interactivity.

Libraries & Tools

  • itertools & random: For combinatorics and randomized slot allocation.
  • reportlab: For generating PDF reports.
  • xlsxwriter: For Excel exports.

🧠 Algorithm Logic

The core of Opti-Time operates on a Constrained-Based Randomized Heuristic Algorithm. It approaches the scheduling problem in distinct, logical phases:

  1. 🧬 Phase 1: Practical Scheduling (Hard Constraint)

    • Uses a cyclic rotation algorithm to assign subject trios (A1, A2, A3) to batches.
    • Guarantees 100% completion of required blocks while ensuring no batch repeat the same subject in parallel.
    • Wait-List Logic: If a teacher conflict occurs, sessions are queued for the next available slot.
    • Slot Reservation: Dynamically reserves exact slot spaces before theory generation to protect required practical blocks and prevent "algorithm lockout."
  2. πŸ•— Phase 2: Theory Scheduling

    • Iterates through available time slots using a weighted pool.
    • Constraints:
      • Teacher Availability: Real-time cross-check against all other academic timetables.
      • Daily Load: Strict limit of maximum 2 lectures per subject per day (relaxable to 3 for backfilling).
  3. πŸ”„ Phase 3: Multi-Class Orchestration & Gap Filling

    • Randomized Class Generation: Randomly shuffles the generation order for classes during "Generate All" to prevent algorithm starvation and ensure balanced workload distribution across the entire institute.
    • Scans for remaining empty slots after core generation.
    • Assigns "Extra" lectures or "Library" slots based on teacher availability to ensure no dead space in the schedule.

πŸ“¦ Installation & Setup

Get the project running locally in just a few steps.

Prerequisites

  • Python 3.11 or higher
  • Git

Steps

  1. Clone the Repository

    git clone https://github.com/vedangdhuri/Opti-Time-69.git
    cd Opti-Time
  2. Create a Virtual Environment

    # Windows
    python -m venv .venv
    .venv\Scripts\activate
    
    # macOS/Linux
    python3 -m venv .venv
    source .venv/bin/activate
  3. Install Dependencies

    pip install -r requirements.txt
  4. Database Setup

    python manage.py makemigrations
    python manage.py migrate
  5. Run the Server

    python manage.py runserver

    πŸŽ‰ Open your browser and go to http://127.0.0.1:8000/


πŸ“‚ Project Structure

Opti-Time/
β”œβ”€β”€ class_timetable/       # 🧠 Main scheduling logic & models
β”‚   β”œβ”€β”€ utils.py           # Core scheduling algorithm
β”‚   β”œβ”€β”€ views.py           # View controllers & analytics
β”‚   └── models.py          # Data models (Teachers, Subjects)
β”œβ”€β”€ templates/             # 🎨 HTML Templates
β”œβ”€β”€ static/                # πŸ’… CSS/JS assets
β”œβ”€β”€ manage.py              # βš™οΈ Django CLI utility
└── requirements.txt       # πŸ“¦ Project dependencies

🀝 Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

πŸ“ License

Distributed under the MIT License. See LICENSE for more information.


About

Django timetabling engine solving university scheduling with constraint handling, batch management, and optimized faculty allocation.

Topics

Resources

License

Stars

Watchers

Forks

Contributors