Skip to content

An intelligent constraint optimization solution that eliminates scheduling conflicts while balancing student preferences, teacher availability, and room capacity.

Notifications You must be signed in to change notification settings

LQ458/CourseScheduler

Repository files navigation

Smart Class Scheduling System

An intelligent constraint optimization solution that eliminates scheduling conflicts while balancing student preferences, teacher availability, and room capacity.

Python Streamlit License

Key Achievements

  • ** Eliminates 50+ scheduling conflicts** through intelligent constraint optimization
  • ** Balances multiple constraints** simultaneously (teacher availability, room capacity, class preferences)
  • ** Interactive visualizations** with Plotly-powered schedule charts
  • ** Professional exports** to CSV and Excel with color-coded formatting
  • ** Real-time conflict detection** and resolution suggestions

Architecture Overview

This system implements a sophisticated constraint satisfaction algorithm that optimizes educational timetables by considering:

Core Constraints

  • Teacher Availability: Prevents double-booking of instructors
  • Room Capacity: Ensures adequate space for class sizes
  • Class Schedules: Avoids student conflicts across courses
  • Course Frequency: Meets weekly session requirements (1-5x per week)
  • Time Slot Management: Handles breaks, lunch periods, and duration preferences

Smart Optimization Features

  • Priority-based scheduling: High-frequency courses get priority placement
  • Randomized assignment: Ensures variety in schedule generation
  • Conflict detection: Multi-layer validation system
  • Capacity matching: Intelligent room-to-class size pairing

Problem Solved

Educational institutions face complex scheduling challenges:

  • Manual scheduling takes weeks and often results in conflicts
  • Resource conflicts between teachers, rooms, and time slots
  • Frequency requirements for different subjects (daily vs. weekly)
  • Capacity constraints matching room sizes to class enrollment
  • Export needs for administration and distribution

Our solution automates this process, reducing scheduling time from weeks to minutes while eliminating human error.

Technology Stack

Component Technology Purpose
Frontend Streamlit Interactive web interface
Optimization Custom Python Algorithm Constraint satisfaction solver
Visualization Plotly Interactive schedule charts
Data Processing Pandas + NumPy Data manipulation and analysis
Export XlsxWriter Professional Excel formatting
State Management Streamlit Session State Real-time data persistence

Features

Data Management

  • Teacher Management: Add instructors with subject specializations
  • Room Management: Configure spaces with capacity limits
  • Class Management: Set up student groups with enrollment numbers
  • Course Management: Define subjects with frequency requirements

Intelligent Scheduling

  • Constraint Optimization: Simultaneous multi-constraint satisfaction
  • Conflict Prevention: Proactive validation before assignment
  • Frequency Balancing: Distributes sessions across the week
  • Room Optimization: Matches class sizes to room capacities

Visualization & Analysis

  • Multiple Views: Class, teacher, and room perspectives
  • Interactive Charts: Hover details and color-coded subjects
  • Conflict Reports: Detailed analysis of scheduling issues
  • Schedule Summaries: Quick overview statistics

Professional Exports

  • CSV Export: Simple data format for external tools
  • Excel Export: Color-coded, formatted spreadsheets
  • Multiple Sheets: Separate views in single workbook
  • Print-Ready: Professional formatting for distribution

Quick Start

Installation

# Clone the repository
git clone <repository-url>
cd class-scheduling-system

# Install dependencies
pip install -r requirements.txt

Running the Application

# Start the Streamlit server
streamlit run app.py

The application will open in your browser at http://localhost:8501

Sample Data

Load the included sample dataset to explore features:

  • 9 teachers across different subjects
  • 8 rooms with varying capacities
  • 4 classes with realistic enrollment
  • Multiple courses with different frequency requirements

📖 Usage Guide

1. Input Data

  • Add teachers with their subject specializations
  • Configure rooms with capacity information
  • Set up classes with student counts
  • Define courses with frequency requirements

2. Generate Schedule

  • Configure time slots and break periods
  • Set lunch periods and duration
  • Run the optimization algorithm
  • Review conflict reports

3. View & Analyze

  • Switch between class, teacher, and room views
  • Explore interactive visualizations
  • Analyze schedule distribution and conflicts

4. Export & Share

  • Download CSV for data analysis
  • Export formatted Excel for distribution
  • Print-ready professional layouts

🔧 Algorithm Details

Constraint Satisfaction Process

  1. Priority Sorting: Courses sorted by frequency (high to low)
  2. Iterative Assignment: Each session placed using availability checks
  3. Multi-layer Validation: Teacher, room, and class conflict detection
  4. Randomized Placement: Ensures schedule variety across generations
  5. Conflict Reporting: Detailed analysis of unresolved constraints

Optimization Strategies

  • Greedy Assignment: Priority-based slot allocation
  • Backtracking Prevention: Smart conflict avoidance
  • Resource Matching: Capacity-aware room assignment
  • Frequency Distribution: Even spacing of recurring sessions

Sample Results

With the included sample data, the system successfully:

  • Schedules 36+ course sessions across 4 classes
  • Manages 9 teachers without conflicts
  • Utilizes 8 rooms efficiently
  • Maintains zero scheduling conflicts
  • Generates schedules in under 5 seconds

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

  • Built with Streamlit for rapid web app development
  • Visualizations powered by Plotly
  • Data processing with Pandas

Ready to eliminate scheduling conflicts? Get started now and experience intelligent timetable generation!

About

An intelligent constraint optimization solution that eliminates scheduling conflicts while balancing student preferences, teacher availability, and room capacity.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages