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. In this article, I assume that you are familiar with the basic concepts of genetic algorithms, and I won't describe them in detail because it has been done so many times before.
Background
When you make a class schedule, you must take into consideration many requirements (number of professors, students, classes and classrooms, size of classroom, laboratory equipment in classroom, and many others). These requirements can be divided into several groups by their importance. 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.
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. In this example, only hard requirements are implemented. Let's start by explaining the objects which makes a class schedule.
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