A robust, randomized heuristic-based system for automated academic scheduling.
Features β’ Tech Stack β’ Algorithm β’ Installation β’ Research
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.
| 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. |
This project uses a modern, robust technology stack:
Python 3.11+ - The core programming language.
Django - The high-level web framework.
SQLite - Local development database.
PostgreSQL - Production-ready database support via
dj_database_url.WhiteNoise - For efficient static file serving in production.
itertools&random: For combinatorics and randomized slot allocation.reportlab: For generating PDF reports.xlsxwriter: For Excel exports.
The core of Opti-Time operates on a Constrained-Based Randomized Heuristic Algorithm. It approaches the scheduling problem in distinct, logical phases:
-
𧬠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."
-
π 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).
-
π 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.
Get the project running locally in just a few steps.
- Python 3.11 or higher
- Git
-
Clone the Repository
git clone https://github.com/vedangdhuri/Opti-Time-69.git cd Opti-Time -
Create a Virtual Environment
# Windows python -m venv .venv .venv\Scripts\activate # macOS/Linux python3 -m venv .venv source .venv/bin/activate
-
Install Dependencies
pip install -r requirements.txt
-
Database Setup
python manage.py makemigrations python manage.py migrate
-
Run the Server
python manage.py runserver
π Open your browser and go to
http://127.0.0.1:8000/
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 dependenciesContributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature) - Commit your Changes (
git commit -m 'Add some AmazingFeature') - Push to the Branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Distributed under the MIT License. See LICENSE for more information.