Skip to content

BoddapuLokesh/Time-Table-Generator

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Automatic Timetable Generator Using Genetic Algorithm

Django Python License Status

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.

🌟 Features

Current Features (v1.0)

  • 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

Genetic Algorithm Specifications

  • 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

πŸ—οΈ System Architecture

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

πŸ“Š Data Models

Core Entities

  • 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

Time Slots

  • Daily Periods: 6 time slots (9:30 AM - 4:30 PM)
  • Weekly Schedule: Monday through Saturday
  • Total Slots: 36 possible time slots per week

πŸš€ Installation & Setup

Prerequisites

  • Python 3.8 or higher
  • Django 5.2
  • SQLite (included with Python)

Installation Steps

  1. Clone the Repository
git clone https://github.com/BoddapuLokesh/Time-Table-Generator.git
cd Time-Table-Generator
  1. Set Up Virtual Environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. Install Dependencies
pip install django==5.2
  1. Database Setup
python manage.py migrate
  1. Create Superuser (Optional)
python manage.py createsuperuser
  1. Run Development Server
python manage.py runserver
  1. Access Application
  • Open browser and navigate to: http://127.0.0.1:8000/
  • Admin panel: http://127.0.0.1:8000/admin/

🎯 Usage Guide

Step 1: Data Entry

  1. Add Rooms: Define classrooms with capacity
  2. Add Instructors: Register teaching staff
  3. Add Meeting Times: Set up time slots
  4. Add Courses: Create subjects with instructor assignments
  5. Add Departments: Group courses by department
  6. Add Sections: Define student groups

Step 2: Generate Timetable

  1. Click "Generate Timetable" from home page
  2. System runs genetic algorithm to find optimal schedule
  3. View generated timetable organized by sections
  4. Export to PDF if needed

Sample Data Structure

# 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)

🧬 Genetic Algorithm Details

How It Works

  1. Initialization: Creates random population of potential schedules
  2. Fitness Evaluation: Scores schedules based on constraint violations
  3. Selection: Tournament selection picks parents for breeding
  4. Crossover: Combines parent schedules to create offspring
  5. Mutation: Random changes maintain genetic diversity
  6. Evolution: Process repeats until optimal solution found

Constraint Types

  • 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

Sample Output

Generation #1: Fitness = 0.010752688172043012
Generation #2: Fitness = 0.010752688172043012  
Generation #3: Fitness = 0.011111111111111112

πŸ“ Project Structure Details

Key Files

  • mm1/models.py: Database schema definitions
  • mm1/views.py: Contains complete GA implementation (530 lines)
  • mm1/forms.py: User input forms for data entry
  • templates/t1.html: Main timetable display template
  • static/CSS/style.css: Styling and responsive design

URL Patterns

/                          # 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

πŸ”§ Current Limitations

  • 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

🀝 Contributing

  1. Fork the repository
  2. Create feature branch (git checkout -b feature/AmazingFeature)
  3. Commit changes (git commit -m 'Add some AmazingFeature')
  4. Push to branch (git push origin feature/AmazingFeature)
  5. Open Pull Request

πŸ™ Acknowledgments

  • Django framework for robust web development
  • Genetic Algorithm principles from evolutionary computation
  • Bootstrap for responsive UI components
  • Educational institutions for domain knowledge

⚠️ Note: This system is currently in active development.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • CSS 38.1%
  • JavaScript 37.2%
  • Python 12.9%
  • HTML 11.8%