OPTIMIZATION OF A SCHOOL TIMETABLE USING GRAPH THEORY (A BIPARTITE EDGE-COLORING APPROACH)
Article Information
Abstract
Constructing a school timetable is a mathematical scheduling problem
with many interacting restrictions. A class cannot attend two lessons at the
same time, and a teacher cannot teach two classes simultaneously. In
addition, a useful timetable should distribute repeated subjects across the
week, avoid undesirable lesson positions, and reduce idle gaps for teachers.
This paper develops a graph-theoretic model for the basic school
timetabling problem. Classes and teachers are represented by the two parts
of a bipartite multigraph, while each required weekly lesson is represented
by an edge. Assigning a time period to a lesson is then exactly a proper edgecoloring problem. Using König’s edge-coloring theorem, we prove that in
the simplified model a conflict-free timetable exists if and only if the number
of available weekly periods is at least the maximum degree of the classteacher multigraph. A constructive algorithm based on decomposition into
matchings is described. A second local-search stage is then used to improve
soft constraints without destroying feasibility. On a reproducible illustrative
instance with four classes, thirteen teachers, 120 weekly lessons, and thirty
weekly periods, random class-by-class schedules produced an average of
14.94 teacher conflicts over 1000 trials. The graph-coloring stage reduced
hard conflicts to zero, and the local-search stage further removed all
penalties under the selected soft-constraint model. The results show how a
classical theorem of graph theory can be turned into a practical scheduling
method suitable for a school-level research project.

