An intelligent web-based timetable scheduling system that uses Genetic Algorithm (GA) to automatically generate optimal class schedules for educational institutions. The system efficiently handles complex constraints like room capacity, instructor availability, and time slot conflicts.
- Genetic Algorithm Engine: Automated schedule optimization using evolutionary computation
- Web-Based Interface: User-friendly Django web application
- Constraint Management: Handles room capacity, instructor conflicts, and time slot management
- Multi-Section Support: Generates schedules for multiple sections (CSE1, CSE2, CSE3, CSE4)
- CRUD Operations: Complete management of rooms, instructors, courses, departments, and sections
- PDF Export: Generate printable timetable schedules
- Responsive Design: Bootstrap-powered responsive UI
- Population Size: 15 individuals per generation
- Selection Method: Tournament selection
- Crossover Rate: Random crossover between parent schedules
- Mutation Rate: 0.05 (5% mutation probability)
- Fitness Function: Constraint violation minimization
- Termination: Runs for limited generations or until fitness = 1.0
Time-Table-Generator/
├── M1/ # Django project configuration
│ ├── settings.py # Project settings
│ ├── urls.py # Main URL routing
│ └── wsgi.py # WSGI application
├── mm1/ # Main application
│ ├── models.py # Database models
│ ├── views.py # Business logic + GA implementation
│ ├── forms.py # Django forms
│ ├── urls.py # App URL patterns
│ └── admin.py # Admin interface
├── templates/ # HTML templates
├── static/ # CSS, JS, images
└── db.sqlite3 # SQLite database
- Room: Classroom details with seating capacity
- Instructor: Teaching staff information
- Course: Subject details with enrollment limits
- Department: Academic departments containing courses
- Section: Student groups requiring scheduled classes
- MeetingTime: Time slots across weekdays
- Daily Periods: 6 time slots (9:30 AM - 4:30 PM)
- Weekly Schedule: Monday through Saturday
- Total Slots: 36 possible time slots per week
- Python 3.8 or higher
- Django 5.2
- SQLite (included with Python)
- Clone the Repository
git clone https://github.com/BoddapuLokesh/Time-Table-Generator.git
cd Time-Table-Generator- Set Up Virtual Environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install Dependencies
pip install django==5.2- Database Setup
python manage.py migrate- Create Superuser (Optional)
python manage.py createsuperuser- Run Development Server
python manage.py runserver- Access Application
- Open browser and navigate to:
http://127.0.0.1:8000/ - Admin panel:
http://127.0.0.1:8000/admin/
- Add Rooms: Define classrooms with capacity
- Add Instructors: Register teaching staff
- Add Meeting Times: Set up time slots
- Add Courses: Create subjects with instructor assignments
- Add Departments: Group courses by department
- Add Sections: Define student groups
- Click "Generate Timetable" from home page
- System runs genetic algorithm to find optimal schedule
- View generated timetable organized by sections
- Export to PDF if needed
# Current Database Content
Rooms: 4 (B3-403, B4-303, B4-304, B4-403)
Instructors: 23 teaching staff members
Meeting Times: 30 time slots across 6 days
Courses: 28 subjects (AI, Data Mining, Software Engineering, etc.)
Departments: 4 (CSE sections)
Sections: 4 (CSE1, CSE2, CSE3, CSE4)- Initialization: Creates random population of potential schedules
- Fitness Evaluation: Scores schedules based on constraint violations
- Selection: Tournament selection picks parents for breeding
- Crossover: Combines parent schedules to create offspring
- Mutation: Random changes maintain genetic diversity
- Evolution: Process repeats until optimal solution found
- Room Capacity: Ensures room can accommodate course enrollment
- Room Conflicts: Prevents double-booking of classrooms
- Instructor Conflicts: Avoids instructor scheduling conflicts
- Time Conflicts: Manages section-level time slot conflicts
Generation #1: Fitness = 0.010752688172043012
Generation #2: Fitness = 0.010752688172043012
Generation #3: Fitness = 0.011111111111111112
mm1/models.py: Database schema definitionsmm1/views.py: Contains complete GA implementation (530 lines)mm1/forms.py: User input forms for data entrytemplates/t1.html: Main timetable display templatestatic/CSS/style.css: Styling and responsive design
/ # Home page
/timetable_generation/ # Generate and view timetables
/add_room/ # Add new classroom
/add_instructor/ # Add teaching staff
/add_course/ # Add new course
# ... and more CRUD operations- Small Population Size: Only 15 individuals per generation
- Limited Generations: Short evolution cycles
- Basic Constraint Handling: All constraints treated equally
- No Logging: Limited visibility into algorithm performance
- Data Type Issues: String-integer comparison problems
- No Error Handling: System may crash on invalid input
- Fork the repository
- Create feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open Pull Request
- Django framework for robust web development
- Genetic Algorithm principles from evolutionary computation
- Bootstrap for responsive UI components
- Educational institutions for domain knowledge