Class Scheduling Using Generative AI
Class Scheduling Using Generative AI
Algorithm
Presented by: Engr. Farhan Ghafoor
Engr. Ghulam Qasim
Abstract
Time Table Scheduling is an NP-hard problem and hence
polynomial time verifiable using genetic algorithms.
It a typical scheduling problem that appears to be a tedious job in
every academic institute once or twice a year.
In earlier days, time table scheduling was done manually with a
single person or some group involved in task of scheduling it
manually, which takes a lot of effort and time. Planning timetables
is one of the most complex and error-prone applications.
Furthermore, Timetabling is the task of creating a timetable while
satisfying some constraints.
There are basically two types of constraints, soft constraints and
hard constraints.
Abstract
Soft constraints are those if we violate them in scheduling, the
output is still valid, but hard constraints are those which if we violate
them; the timetable is no longer valid.
The search space of a timetabling problem is too vast, many solutions
exist in the search space and few of them are not feasible.
Feasible solutions here mean those which do not violate hard
constraints and as well try to satisfy soft constraints.
We need to choose the most appropriate one from feasible solutions.
Most appropriate ones here mean those which do not violate soft
constraints to a greater extent.
In this project hard-constraints have been taken care of strictly and it
has been ensured that soft-constraints are as well followed as much
as possible.
Introduction
Making a class schedule is one of those NP hard problems.
The problem can be solved using a heuristic search
algorithm to find the optimal solution, but it only works for
simple cases.
For more complex inputs and requirements, finding a
considerably good solution can take a while, or it may be
impossible.
This is where genetic algorithms come in to the game to
solve the impossible problem and to make possible.
Background
When you make a class schedule, you must take into
consideration many requirements as follows:
Number of professors
No of students
No of classes and classrooms
Size of classroom
Laboratory equipment in the classroom
And many others etc.
These requirements can be divided into several groups
by their importance.
Background
Hard requirements (if you break one of these, then the
schedule is infeasible):
A class can be placed only in a spare classroom.
No professor or student group can have more then
one class at a time.
A classroom must have enough seats to accommodate
all students.
To place a class in a classroom, the classroom must
have laboratory equipment (computers, in our case) if
the class requires it.
Background
Some soft requirements (can be broken, but the
schedule is still feasible):
Preferred time of class by professors.
Preferred classroom by professors.
Distribution (in time or space) of classes for student
groups or professors.
Hard and soft requirements, of course, depend on the
situation.
Objects of Class Schedule
Professor
The Professor class has an ID and the name of the
professor. It also contains a list of classes that a
professor teaches.
Students Group
The StudentsGroup class has an ID and the name of
the student group, as well as the number of students
(size of group). It also contains a list of classes that the
group attends.
.
The Genetic Algorithm
Classroom
The Room class has an ID and the name of the
classroom, as well as the number of seats and
information about equipment (computers). If the
classroom has computers, it is expected that there is a
computer for each seat. IDs are generated internally
and automatically.
Course
The Course class has an ID and the name of the course.
Objects of Class Schedule
Class
CourseClass holds a reference to the course to which
the class belongs, a reference to the professor who
teaches, and a list of student groups that attend the
class. It also stores how many seats (sum of student
groups' sizes) are needed in the classroom, if the class
requires computers in the classroom, and the duration
of the class (in hours).
Algorithm
i. First of all an initial generation of chromosomes is created randomly and their fitness
value is analyzed.
ii. ii. New Generations are created after this. For each generation, it performs
following basic operations:
a. First of all preserve few fittest chromosomes from the previous generation as it
is. This is called Elitism and is necessary to preserve desired characteristics in
the coming generations.
b. Randomly select a pair of chromosomes from the previous generation. Roulette
wheel selection method has been used here in this project.
c. Perform crossover depending on the crossover rate which is pretty high usually.
Here single point crossover has been used.
d. Perform mutation on the more fit chromosome so obtained depending on the
mutation rate which is kept pretty small usually.
iii. Now analyze the fitness of the new generation of chromosomes and order them
according to fitness values.
iv. Repeat creating new generations unless chromosomes of desired fitness value i.e.
fitness=1, are obtained.
Chromosome
The genetic algorithm is fairly simple. For each generation, it performs two
basic operations:
Randomly selects N pairs of parents from the current population and
produces N new chromosomes by performing a crossover operation on
the pair of parents.
Randomly selects N chromosomes from the current population and
replaces them with new ones. The algorithm doesn't select
chromosomes for replacement if it is among the best chromosomes in
the population.
And, these two operations are repeated until the best chromosome
reaches a fitness value equal to 1 (meaning that all classes in the schedule
meet the requirement).
As mentioned before, the genetic algorithm keeps track of the M best
chromosomes in the population, and guarantees that they are not going to
Results
Results
Results
Results
Conclusion
https://www.codeproject.com/Articles/
23111/Making-a-Class-Schedule-Using-a-
Genetic-Algorithm
Slide Title
Product A Product B
• Feature 1 • Feature 1
• Feature 2 • Feature 2
• Feature 3 • Feature 3