A web-based application for generating optimal college department timetables using Genetic Algorithm optimization, built with Python Streamlit.
- CSV Data Upload: Easy upload interface for Faculty, Courses, Rooms, and Batch data
- Constraint Configuration: Adjustable parameters for working days, periods, and GA optimization
- Genetic Algorithm Optimization: Advanced GA implementation with fitness-based optimization
- Real-time Progress Tracking: Live visualization of fitness progression during generation
- Multiple View Options: Timetable display by Batch, Room, or Faculty
- Export Functionality: Download timetables as Excel or CSV files
- Data Validation: Comprehensive validation with detailed error reporting
-
Run the Application:
streamlit run app.py --server.port 5000
-
Upload Sample Data:
- Navigate to "Upload Data" section
- Download sample CSV templates provided
- Upload your own data or use the provided samples
-
Set Constraints:
- Configure working days and periods per day
- Adjust GA parameters (population size, generations, etc.)
- Set faculty and room constraints
-
Generate Timetable:
- Click "Start Generation" to run the optimization
- Monitor real-time progress and fitness evolution
- View results in the generated timetable
-
View and Export:
- Switch between Batch, Room, and Faculty views
- Export as Excel or CSV format
- FacultyID: Unique identifier for faculty member
- Name: Faculty member's name
- PreferredDays: Comma-separated preferred working days (0-6, where 0=Monday)
- PreferredSlots: Comma-separated preferred time slots
- MaxLoadPerDay: Maximum classes per day
- CourseID: Unique course identifier
- Name: Course name
- FacultyID: Assigned faculty member (must exist in Faculty.csv)
- HoursPerWeek: Number of hours per week for the course
- IsLab: Boolean indicating if course requires lab room
- RoomID: Unique room identifier
- Capacity: Room capacity (number of students)
- IsLabRoom: Boolean indicating if room is equipped as lab
- BatchID: Unique batch identifier
- Name: Batch/class name
- CoursesOffered: Comma-separated list of CourseIDs for this batch
Each chromosome represents a complete timetable with genes containing:
- BatchID, CourseID, FacultyID, RoomID, Day, Slot
The fitness function evaluates solutions based on:
Hard Constraints (Heavy Penalties):
- Faculty conflicts (same faculty, same time)
- Room conflicts (same room, same time)
- Batch conflicts (same batch, same time)
- Lab room violations (lab courses not in lab rooms)
Soft Constraints (Light Penalties):
- Faculty preference violations
- Uneven workload distribution
- Excessive consecutive hours
- Selection: Tournament selection
- Crossover: Single-point crossover
- Mutation: Random day/slot/room changes
- Elitism: Preserve best solutions across generations
- Working Days: 3-7 days per week
- Periods per Day: 4-10 time slots
- Max Consecutive Hours: Limit for faculty teaching hours
- Population Size: 20-200 solutions per generation
- Generations: 10-500 evolution cycles
- Crossover Rate: 0.1-1.0 probability of parent combination
- Mutation Rate: 0.01-0.5 probability of random changes
- Elitism: 1-10 top solutions preserved per generation