1. Introduction
Timetabling is an important and challenging area of research with diverse applications in education, enterprises, sports, transportation, human resources planning, and logistics. According to [
1], timetabling refers to the allocation of given resources, subject to constraints, to objects placed in space–time, aiming to maximize the number of satisfied desirable objectives. These high-dimensional, multi-objective combinatorial optimization problems have received significant attention from the scientific community because manually generating timetables is laborious and time-consuming, often resulting in ineffective and costly schedules. Therefore, the development of automated timetabling systems is crucial to reducing errors, accelerating the creation process, and maximizing desirable objectives. Among the various forms of timetabling problems, the educational timetabling problem stands out as one of the most extensively studied. Finding a universal and effective solution for this problem is challenging due to its complexity, varying constraints, and evolving requirements.
The
university course timetabling problem (UCTP) is a multidimensional assignment problem that involves assigning students and teachers to events (or courses), which are then allocated to appropriate timeslots and rooms. The UCTP can be categorized into two categories: post-enrollment-based course timetabling problems (PE-CTPs) and curriculum-based course timetabling problems (CB-CTPs). PE-CTP, sometimes referred to as “event timetabling”, focuses on assigning events to timeslots and resources (rooms and students) to avoid conflicts between events, timeslots, and rooms. The timetable is constructed after student enrollment to ensure all students can attend the events they are enrolled in. On the other hand, CB-CTP was first introduced in the Second International Timetabling Competition (ITC2007) [
2] and is a weekly assignment problem that involves scheduling a specific number of lectures for various university courses within a given number of time periods and a set of rooms. Each day is divided into a fixed number of timeslots, and a period refers to a combination of a day and a timeslot. The total number of scheduling periods per week is determined by multiplying the number of days per week by the number of timeslots per day. Each course must be scheduled at different periods. Additionally, a set of curricula consists of groups of courses with shared students, and conflicts between courses are resolved based on the curricula rather than student enrollment data.
The main difference between these two variants of the UCTP is that in the PE-CTP, all objectives and constraints are based on the student’s enrollment in various course events, whereas in the CB-CTP, all objectives and constraints are associated with the curriculum conception, which is a set of courses that form a complete assignment for a group of students. An illustration of a student’s preference in the PE-CTP can be seen in the statement, “A student should have multiple events in a day.” Similarly, for the CB-CTP, a teacher’s preference can be exemplified by the statement, “A teacher prefers to have no more than two consecutive lectures.” These timetabling problems involve two types of constraints: hard and soft. Hard constraints are those that must be satisfied under any circumstances. A timetable is considered feasible if it successfully satisfies all hard constraints. On the other hand, soft constraints are more flexible and can be violated if necessary, but it is desirable to minimize these violations due to associated penalty costs. The lower the total value of the penalty cost, the higher the quality of the timetable. Thus, the main objective is to create a high-quality schedule with minimal penalties for violations of soft constraints.
Educational timetabling has been studied for over 60 years, beginning with Gotlieb [
3]. Over the years, many solution approaches have been proposed by researchers. Carter et al. [
4] provided an overview of the primary solution approaches for the UCTP and roughly divided them into four categories: constraint-based, sequential, clustered, and metaheuristic methods. In recent years, metaheuristic algorithms have been successfully applied for both variants of the UCTP and are classified into local area-based and population-based approaches. Local area-based algorithms, also called single-point algorithms, focus more on exploitation than exploration [
5]. These algorithms work iteratively on a single solution and may not thoroughly explore the entire solution space. Examples of local area-based algorithms include tabu search (TS), iterated local search (ILS), very large neighborhood search (VLNS), and simulated annealing (SA). On the other hand, population-based algorithms, also known as multiple-point algorithms, are good at exploration rather than exploitation [
6]. These algorithms maintain multiple solutions within a population and employ a selection process to update the solutions. They extensively search the entire solution space to find a globally optimal solution and are sometimes referred to as global area-based algorithms. Consequently, these algorithms do not focus solely on individuals with good fitness within a population but instead explore the entire solution space to identify potential solutions. However, premature convergence is the main disadvantage of such types of algorithms. Commonly utilized population-based algorithms for timetabling problems include the genetic algorithm (GA), artificial bee colony (ABC), particle swarm optimization (PSO), and ant colony optimization (ACO).
Driven by these discoveries and acknowledging that exploration, carried out through population-based algorithms, and exploitation, executed via local area-based algorithms, are two significant attributes of an optimization algorithm, which complement each other and necessitate fine-tuning between them, we propose a hybrid metaheuristic algorithm named GAILS, for solving PE-CTP and CB-CTP. The algorithm iteratively explores the search space, finds the global optimum region using GA, and then employs ILS to obtain the global optimum solution by exploiting this region. The GA generally fails to reach a global optimum because it repeatedly explores various sub-parts of the search space, leading to a long execution time. Additionally, the GA incorporates a local search (LS) which tends to become trapped in a local optimum quickly. Therefore, when dealing with a large search space, the GA might either fail to converge to a global optimum solution or require a significant amount of time due to the possibility of getting trapped in a local optimum. At this juncture, ILS is used to escape from the local optimum by applying perturbations to the current solution. This allows one to maintain a proper balance between the merits of these algorithms. Consequently, GA emphasizes exploration and diversification, while ILS concentrates on the exploitation and intensification of the search space. Various crossover and mutation operators, as well as neighborhood and perturbation moves, are utilized by the algorithm to generate new solutions.
The superiority of GAILS can be attributed to its hybridization of two complementary approaches. It initiates the search by using GA with an LS approach to explore the search space and identify the global optimum region, which is prone to becoming trapped in a local optimum. To overcome this challenge, ILS is employed, introducing perturbations to the current solution and facilitating escape from local optima. Furthermore, we conducted experimental investigations with varying time limits to demonstrate GAILS’ capability to evade local optima. The results affirm the effectiveness of our proposal, as the solution quality improves with increased time. Additionally, we evaluate the algorithm’s performance on benchmark problem instances of differing complexity, employing the fitness function value as a metric and comparing it with other algorithms using a t-test.
The structure of this paper is as follows: In
Section 1, an introduction is provided.
Section 2 contains a brief literature review of the related work on PE-CTP and CB-CTP. The PE-CTP and CB-CTP, along with their mathematical formulation, are explained in
Section 3.
Section 4 covers the description of the GAILS algorithm. Implementation and testing of GAILS on different benchmark problem instances with varying complexity are performed in
Section 5. Finally, conclusions are summarized in
Section 6.
3. Problem Formulation
This section outlines the two variants of UCTPs, namely, the PE-CTP and the CB-CTP, and presents their mathematical formulations. The UCTP is a multi-dimensional assignment problem where students and teachers are assigned to events (or courses), which are then allocated to appropriate timeslots and rooms. In the subsequent subsections, we delve into the PE-CTP and CB-CTP individually.
3.1. Post-Enrollment Based Course Timetabling Problem
This section provides an explanation of the PE-CTP, along with its mathematical formulation. The PE-CTP is characterized as a multi-dimensional assignment problem wherein students select events, such as lectures, tutorials, and laboratories. These events must be allocated to a certain number of timeslots (9 per day for 5 days) and rooms, with the goal of minimizing constraint violation. Each student selects multiple events, and each room has a specific capacity and various features. The resolution to this problem entails assigning the events to suitable timeslots and rooms that fulfill the specified hard constraints, as described below.
Each student can attend only one event at any given timeslot.
Each event must be assigned to a room with enough seating capacity and all the necessary features.
Each room can host only one event at a time.
When only hard constraints are present, the goal is to find a feasible solution. In addition, the following soft constraints are considered, the violation of which leads to a certain penalty for the PE-CTP solution.
Scheduling an event at the last timeslot of the day should be avoided.
A student should not have more than two events in consecutive timeslots daily.
Having only one event a day is not recommended for a student.
Next, the mathematical formulation of the PE-CTP can be described. The PE-CTP involves a set consisting of n events assigned to 45 timeslots (with 9 timeslots per day for 5 days). There is also a set of m rooms with fixed seating capacity where these events occur. In addition, a set includes p students who can choose any event from , and a set contains q room features required for events in selected rooms. The following notations are used in the formulation of the problem.
The set of events, denoted as , consists of n events.
The set of rooms, denoted as , contains m rooms.
The set of timeslots, denoted as , includes 45 timeslots.
The set of students, denoted as , comprises p students.
The set of rooming features, denoted as , represents q rooming features.
represents the capacity of room .
A matrix , called a room-feature matrix and represents the feature possessed by the room. Here, , if room is having feature ; otherwise, the value is zero.
The decision variable
represents student
attending the event
in the timeslot
and in the room
. It is defined for
i ranging from 1 to
p,
j ranging from 1 to
n,
k ranging from 1 to 45, and
l ranging from 1 to
m.
The decision variable
represents an event
that takes place in the room
with feature
. It is defined for
,
, and
.
The decision variable
represents an event
that takes place in timeslot
and defined for
.
Now, the mathematical formulation of hard constraints can be described as follows:
Each student can attend only one event at any given timeslot.
Each event must be assigned to a room with enough seating capacity and all the necessary features.
Each room can host only one event at a time.
Similarly, the soft constraints can be formulated mathematically as follows:
Scheduling an event at the last timeslot of the day should be avoided.
A student should not have more than two events in consecutive timeslots daily.
Having only one event a day is not recommended for a student.
The objective is to achieve an optimal solution for the PE-CTP by satisfying all the hard constraints and reducing the overall penalty cost of the soft constraint violations. Therefore, the objective function
for an individual solution
I can be defined as
where
and
represent the counts of hard and soft constraint violations in solution
I, and γ is a constant greater than the maximum potential violation of the soft constraints. To simplify the process, a direct solution representation is used, which involves an integer-valued ordered list of size
, denoted as
, where
. Each element
represents the timeslot for event
. The assignment of rooms is generated using a matching algorithm where a set of events appearing in a timeslot and a pre-processed list of rooms based on their sizes and features are used. A bipartite matching algorithm is employed to obtain a maximum cardinality matching between these two sets, which is determined by using a deterministic network flow algorithm as provided by [
47]. The remaining unplaced events are assigned to the room with the fewest events, in order, until all events are assigned. Following these procedures, a similar integer-valued ordered list of size
, say
, where
is obtained for the event-room assignments. Here,
m denotes the total number of rooms. In the case of a tie, the first room is selected. This process leads to a complete assignment of all the events to suitable rooms and timeslots.
3.2. Curriculum-Based Course Timetabling Problem
This subsection presents a description of the CB-CTP and its corresponding mathematical formulation. The CB-CTP refers to a weekly assignment problem that involves the allocation of lectures for multiple courses within a given number of periods and a set of rooms. The day is split into a fixed number of timeslots, and each period is identified as a combination of a day and a timeslot. The total number of scheduling periods per week is determined by multiplying the number of days per week by the number of timeslots per day. It is necessary to schedule each course at different periods, and a set of curricula comprises a group of courses with shared students. In case of conflicts between courses, the curricula are used to resolve the issue instead of relying on student enrollment data. A feasible timetable is one in which all lectures are scheduled within a period and a room while satisfying the following hard constraints.
All lectures of a course must take place in distinct rooms and periods.
Two lectures cannot occur in the same room during the same period.
All lectures for courses taught by the same teacher or within the same curriculum must be scheduled during different time periods. This means that there should not be any overlap of students or teachers during any given period.
No lectures for the course can be assigned to a period if the teacher of the course is unavailable for that period.
Also, a penalty is imposed on the timetable for each violation of any of the following soft constraints:
The lecture room’s capacity should not be exceeded by the number of students attending the course.
All lectures in a course should be scheduled in the same room. If this is not possible, the number of occupied rooms should be as low as possible.
The lectures of a course should be spread over the given minimum number of days.
A curriculum incurs a violation when a lecture is not adjacent to any other lecture of the same curriculum within the same day. This requirement ensures that the student’s schedule is as compact as possible.
The aim is to minimize the violation of soft constraints. The problem involves assigning lectures from a set of n courses to periods. Here, v and u represent the number of timeslots per day and the number of days per week, respectively. Additionally, the problem involves a set of m rooms with different capacities. Each course comprises lectures, each scheduled at a different period and assigned to a different room. The problem also includes a set Π of x curricula, where each curriculum is a group of courses with common students. The following notations are used to establish the mathematical formulation of CB-CTP.
is a set of x curricula.
is a set of n courses.
is a set of u days in a week.
is a set of v timeslots in a day.
is a set of w periods, where .
is a set of m rooms.
is a set of lectures.
is the total number of lectures for course . Taking , a lecture corresponds to a course for k satisfying . Also, .
is the total number of students taking course .
is the minimum number of days for course .
represents the capacity of room .
is a decision variable representing that lecture
of course
takes place in room
at period
and defined for
, as
is a decision variable representing that lecture
of course
takes place at period
and defined for
, as
is a decision variable representing that course
takes place in room
at period
and defined for
, as
is a decision variable representing that course
takes place in room
and defined for
, and
, as
is a decision variable representing that course
is unavailable at period
and defined for
, as
is a decision variable representing that course
belongs to curriculum
and defined for
, as
is a decision variable representing that course
takes place at period
and defined for
, as
is a decision variable representing that course
takes place in day
and defined for
, as
is a decision variable representing that course of curriculum
takes place at period
and defined for
, as
Now, the mathematical formulation of hard constraints can be described as follows:
All lectures of a course must take place in distinct rooms and periods.
Two lectures cannot occur in the same room during the same period.
All lectures for courses taught by the same teacher or within the same curriculum must be scheduled during different time periods. This means that there should not be any overlap of students or teachers during any given period.
No lectures for the course can be assigned to a period if the teacher of the course is unavailable for that period.
Similarly, the soft constraints can be formulated mathematically as follows:
The lecture room’s capacity should not be exceeded by the number of students attending the course.
All lectures in a course should be scheduled in the same room. If this is not possible, the number of occupied rooms should be as low as possible.
The lectures of a course should be spread over the given minimum number of days.
Here, will take the value 0 if and only if course takes more than () number of days.
A curriculum incurs a violation when a lecture is not adjacent to any other lecture of the same curriculum within the same day. This requirement ensures that the student’s schedule is as compact as possible.
Here, is removed for , and is removed for . Also, will take the value 1 if has an isolated lecture at period .
Similar to the PE-CTP, the goal is to attain an optimal solution for the CB-CTP by satisfying all the hard constraints and minimizing the penalty cost of the soft constraint violations. Hence, the objective function
for an individual solution
I can be defined as follows:
where the symbols retain their usual meanings. Here also, a direct solution representation is selected. A solution involves an integer-valued ordered list of size
, say
. Here, list
corresponds to the assigned periods. Taking
, the
k consecutive entries of
, satisfying
are corresponding to the periods for all the
number of lectures of course
. Once the assignments of all the lectures for all the courses to periods are completed, the room assignments are made by using a bipartite matching algorithm. A set of courses appears in a period and a set of rooms based on their sizes. Now, a bipartite matching algorithm is used to obtain a maximum cardinality matching between these two sets using a deterministic network flow algorithm as given by [
47]. This solves our CB-CTP by assigning all courses to the appropriate rooms and periods.
4. Proposed Hybrid Metaheuristic Approach
This section develops the proposed exploration and exploitation-based metaheuristic algorithm that combines GA and ILS to find an optimal solution for the UCTP.
The study conducted by Golberg [
48] observed that although GAs can identify potential regions for global optima in the search space, they face significant challenges when dealing with highly constrained problems. Moreover, it has been noted [
49,
50] that hybridizing GA with other optimization techniques can yield even better solutions. Incorporating these findings, we propose an approach for finding optimal solutions for PE-CTP and CB-CTP. Our algorithm aims to reduce the exponential time complexity of GA by combining it with the ILS algorithm, thereby increasing the likelihood of convergence to an optimal solution in the search space. The ILS algorithm refines the GA search and improves the chances of convergence to an optimal solution through successive iterations in various sub-parts of the search space. It is important to note that while GA may generate individuals representing both good and bad search spaces, the ILS algorithm ensures fairness by exploring different sub-parts of the search space.
Let us briefly recall the basic concepts of GA to explain the technical details of our algorithm. This stochastic algorithm is based on the principle of survival of the fittest and is used to iteratively map a population of solutions, known as chromosomes with fitness values, into a new population of solutions known as offspring. It requires the problem-specific encoding of a solution, where genes on chromosomes are characterized by variables. Therefore, it works with a randomly generated population of solutions in the search space and consists of three primary processes: selection, reproduction, and replacement.
In the selection process, more duplications of candidate solutions with higher fitness function values are made to enforce the survival-of-the-fittest mechanism. The reproduction stage uses crossover and mutation operators for the selected parents. In the crossover, segments of two solutions in the population are combined to obtain new and possibly improved solutions. In contrast, a solution is modified locally in a random order in the mutation process. Finally, the original parental population is replaced by a population of offspring solutions generated through the selection and reproduction processes. This replacement includes keeping the best solutions and removing the worst ones. The selection phase ensures better utilization of healthier offspring, while the reproduction phase ensures adequate exploration of the search space. Natural selection ensures the propagation of better fitness function values on chromosomes in future generations. The algorithmic layout of GAILS can be found in Algorithm 1. The complete working procedure of GAILS is shown in the flow chart in
Figure 1.
Remark 1. The algorithms and descriptions provided are designed based on PE-CTP. However, in the case of CB-CTP, the event and timeslot are replaced with lecture and period , respectively, along with their respective parameters.
Algorithm 1 The proposed hybrid metaheuristic approach−GAILS |
Require: A problem instance I |
Ensure: an optimal solution for I |
1: begin |
2: for do | ▹ randomly generated initial population of size |
3: ; |
4: ; | ▹ LS given in Algorithms 3 and 4 |
5: compute fitness function value of ; |
6: end for |
7: organize the population of solutions in ascending order based on their fitness function values; |
8: ; | ▹ denotes the finest solution within the population |
9: repeat |
10: use tournament selection to select two parents from population; |
11: offspring solution obtained by applying crossover with α rate and mutation with β rate; |
12: if then | ▹ is the fitness function value of y |
13: ; | ▹ ILS given in Algorithm 2 |
14: end if |
15: ; | ▹ the worst solution is replaced by y in the population of sorted solutions |
16: create and sort the population of solutions in ascending order of their fitness function values; |
17: ; |
18: until (termination criteria not satisfied); |
19: end |
Since all the variables in both PE-CTP and CB-CTP problems are binary, there is no need for special methods for the solution encoding. Chromosomes in the proposed algorithm are vectors of Boolean values of all decision variables. For the PE-CTP problem: . For the CB-CTP problem: .
By utilizing a uniform distribution, our proposed algorithm produces a population of random solutions with a size of
, where each event is assigned a timeslot. As the quality of the initial solutions impacts the final solutions, good initial solutions produce better results in less computation time [
51,
52]. We applied the LS to each initial population to create a population of good-quality initial solutions. The problem-specified heuristic information from the LS is then used by a steady-state evolution process in which only one pair of parent individuals is chosen for reproduction in each generation. The LS assigns events to timeslots and then uses the matching algorithm to allocate rooms to each event–timeslot pair using three neighborhood operators. Following that, the population of solutions is arranged in ascending order according to their fitness function values, where
represents the best solution. Some individuals with the best fitness function values are randomly selected as parents from the current population. The fitness function
for an individual solution
I is given by
where
and γ are the counts of violations of hard and soft constraints on
I, and a constant greater than the maximum possible violation of soft constraints, respectively. A child solution is generated using a uniform crossover operator with α probability and a mutation operator with β probability over the selected parents. Two individual solutions are chosen from the current population as the parents, using tournament selection with a suitable tournament size to create a child solution using a crossover operator. In our case, for each event, we select the parent with the smaller penalty value and assign their corresponding timeslot and room to the event of the child solution. Finally, a mutation operator is applied to the child solution obtained from the crossover operator.
The mutation operator is defined as a random move in the neighborhood of LS, which is extended with four-cycle permutations of the timeslots corresponding to four different events to complete the neighborhood of LS. Thus, the entire neighborhood consists of four categories of neighborhood moves. In a type 1 move, a random event from a timeslot is selected and moved to another timeslot. A type 2 move involves swapping two randomly chosen events between two different timeslots. A type 3 move selects two timeslots randomly and swaps all the events between them. Lastly, in a type 4 move, three randomly selected events from three different timeslots are permuted in one of the two possible ways.
A new solution
y is obtained by applying the crossover and mutation operators on the selected parents using tournament selection. If
is less than
, the ILS algorithm described in
Section 4.1 is applied to
y. Here,
and
correspond to the best solution in the population and the fitness function of the best solution, respectively. Next, the worst solution
is replaced by the new solution
y. The population of solutions is then sorted in increasing order of their fitness function values so that
will be the best solution. This procedure is repeated until a termination criterion is met. Termination criteria may include a time limit, a number of iterations, or achieving an optimal solution with a zero fitness function value. The next subsection discusses the ILS and LS algorithms utilized in the GAILS.
4.1. Iterated Local Search Algorithm
This subsection describes, in brief, the ILS algorithm applied to solve the UCTP. The main disadvantage of LS is that it can become trapped in locally optimal solutions, which are considerably worse than the global optimal solution. It improves the LS algorithm by providing new starting solutions obtained from the current solution using perturbations rather than considering a random restart. Hence, ILS escapes from the local optimal solution by using perturbations. Every single execution of a perturbation in it creates a new solution. The strength of the perturbation is defined as the number of solution components that are modified. It is crucial that the LS algorithm cannot undo the perturbation, or else the solution will fall back into the just-visited local optimal solution. To apply ILS, four components are specified. The first component, “GenerateInitialSolution”, modifies y in GAILS to generate the initial solution , which is further improved to a new solution y by applying LS. The second component, “Perturbation”, enhances the quality of the current solution y by taking it to some intermediate solution . The third component, “LocalSearch”, takes solution and gives an enhanced solution . Finally, the fourth component, “AcceptanceCriteria”, selects the solution for the next perturbation, with the acceptance criteria requiring the cost to decrease.
The article ref. [
53] proposed that executing a random move within a higher-order neighborhood is more effective for achieving excellent performance in perturbation than moves performed in the LS algorithm. The perturbations should be compatible with the LS algorithm and consider the problem’s properties for better results. If the perturbation is too strong, the ILS algorithm may function similarly to a random restart. Conversely, if the perturbation is too small, the LS algorithm will likely return to the previously visited local optimal solution, limiting the diversification of the search space. The solution returned by the AcceptanceCriteria employs this perturbation. The ILS algorithm is described in Algorithm 2.
Algorithm 2 Iterated local search algorithm−ILS |
- Require:
A solution from the population - Ensure:
An enhanced solution y - 1:
begin - 2:
; - 3:
; - 4:
while (termination criteria not met) do - 5:
; - 6:
; - 7:
; - 8:
end while - 9:
end
|
The ILS method is utilized by starting with the randomly generated initial solution of PE-CTP. The LS algorithm is applied to with the help of some designed neighborhoods to obtain an enhanced solution y. The new solution y is then subjected to perturbation to obtain a further improved solution . The perturbation employs the search history, referred to as History, to mine the previously discovered local optima, which are used to generate better starting points for LS. After that, LS is applied once more to to obtain a further improved solution . If the solution satisfies the acceptance criteria based on the specified History, it replaces . The ILS method is repeated until the predefined termination criteria used in GAILS are met. In our study, we utilize the following four types of perturbation moves:
- Per1:
Selecting a different timeslot to a randomly chosen event.
- Per2:
Swapping timeslots for two randomly chosen events.
- Per3:
Selecting two timeslots randomly and swapping all their events.
- Per4:
Selecting three events randomly and permuting them into three distinct timeslots in one of the two possible ways that differ from the existing one.
The random choices mentioned above were selected from a uniform distribution. To determine the strength of the perturbation, each individual random move is performed r times, where . We have considered three different methods to accept solutions in the AcceptanceCriteria. The initial method, Random_Walk, consistently accepts the new solution that LS returns. The second method, Accept_if_Better, only accepts a new solution if it is an improvement over the current solution y. The third method is Simulated_Annealing, which accepts if it is superior to the current solution; otherwise, it is accepted with a probability determined by . Here, represents the total count of or , depending on whether solutions y and are feasible. Two methods used for calculating this probability are
- M1:
- M2:
Here, T and represent a temperature parameter and the optimal solution obtained so far. Throughout the execution, the value of T remains constant. Generally, the temperature decreases over time in the SA algorithm to facilitate convergence towards a local minimum. However, when the ILS algorithm incorporates SA, the temperature is maintained at a constant level. The reason is that the ILS algorithm employs a distinct strategy to overcome local minima. Instead of reducing the temperature, the ILS algorithm introduces perturbations to alter the solution randomly. This allows the algorithm to explore new regions of the search space and potentially escape from local minima. Further, the value of T are selected from and for and , respectively.
4.2. Local Search Algorithm
The classical method of local search is often used to find optimal solutions for many combinatorial optimization problems through two phases. The first phase is called the construction phase, which establishes feasibility. The second phase, the improvement phase, optimizes soft constraints without violating the feasibility of the search space. During the construction phase, the algorithm commences with an empty timetable and systematically builds up a schedule by gradually including one event at a time. Typically, the initial timetable is of poor quality with numerous constraint violations. The improvement phase then gradually enhances the timetable’s quality by modifying certain events to achieve a better timetable. The selection of good neighborhoods is a critical aspect of LS.
To solve PE-CTP, the construction and improvement phases of LS are applied to each individual solution. During the construction phase, all possible neighborhood moves are attempted for each event from the list of events associated with and ignoring all until a termination criterion is reached. Termination criteria can be an improvement in the solution or the exhaustion of the pre-specified number of iterations. For simplicity, a portion of the given solution is customized to form a new neighboring solution. In this work, we used a neighborhood consisting of three smaller neighborhoods, and , defined as follows:
- N1:
An operator that randomly chooses a single event and moves this event to a different timeslot that produces the lowest penalty.
- N2:
An operator that swaps the timeslots of two randomly selected events.
- N3:
An operator that randomly selects two timeslots and swaps all their events.
The neighborhood operator
is applied only when
fails, and
is applied only when both
and
fail. In this context, the term “penalty” refers to the number of violations of hard and soft constraints. The resulting disturbance in room allocation is resolved by applying the bipartite graph matching algorithm to the affected timeslots after each neighborhood move, using its delta-evaluated measure. Delta-evaluation refers to the computation of the
of events that move within a solution to obtain the fitness function value dispute between the related event’s pre- and post-move. If there are no new moves in the neighborhood or the current event has no
, the construction phase proceeds to the next event. If there is any remaining
after applying all neighborhood moves to all events, the construction phase ceases to function without discovering a viable solution to the problem. Once a feasible solution is achieved, the improvement phase begins. It operates similarly to the construction phase but focuses on satisfying soft constraints instead of hard constraints. The goal is to minimize the
by applying all neighborhood moves to each event in sequential order without violating hard constraints. In summary, the construction phase provides a feasible solution, while the improvement phase aims to optimize the solution by satisfying as many soft constraints as possible. Algorithms 3 and 4 illustrate the general framework of the LS algorithm in its construction and improvement phases.
Algorithm 3 Construction phase of the local search algorithm |
Require: A solution I from the population |
Ensure: Either a feasible solution I or the nonexistence of a viable solution |
1: begin |
2: construct a randomly ordered circular list consisting of n events; |
3: ; | ▹i is the event counter |
4: select event after ; | ▹ move to the next event |
5: if (all neighborhood moves applied to all the events) then |
6: if (∃ any in I) then |
7: END LOCAL SEARCH; |
8: else |
9: output a feasible solution I and END the construction phase; |
10: end if |
11: end if |
12: if ((feasible ) ⋁ (no untried move left for )) then |
13: goto 4; |
14: end if |
15: ; | ▹ all neighborhood moves applied and return the solution I |
16: if (reduced number of in I) then |
17: make the move; |
18: goto 3; |
19: else |
20: goto 12; |
21: end if |
22: end |
Algorithm 4 Improvement phase of the local search algorithm |
Require: Solution I from Algorithm 3 |
Ensure: An optimal solution I |
1: begin |
2: use the circular randomly ordered list of n events generated in Algorithm 3; |
3: ; | ▹i is the event counter |
4: select event after ; | ▹ move to the next event |
5: if (all neighborhood moves applied to all the events) then |
6: END LOCAL SEARCH with an optimal solution I; |
7: end if |
8: if (( NOT involved in any ) ⋁ (no untried move left for )) then |
9: goto 4; |
10: end if |
11: ; | ▹ all neighborhood moves applied and return the solution I |
12: if (number of reduced in I without making I infeasible) then |
13: make the move; |
14: goto 3; |
15: else |
16: goto 8; |
17: end if |
18: end |
Procedure |
and I are arguments. Returns I after neighborhood moves - Require:
: the set of 45 timeslots; : the set of m rooms; - 1:
begin - 2:
apply to solution I; - 3:
if ( successful) then - 4:
generate solution I; - 5:
else if ( to I not successful) ⋀ ( to I successful) then - 6:
apply to I and generate solution I; - 7:
else - 8:
apply to I and generate solution I; - 9:
end if - 10:
fordo - 11:
if timeslot is effected by either of the move , , or then - 12:
use the matching algorithm for events held in to allocate rooms; - 13:
end if - 14:
end for - 15:
delta-evaluate the result of the move; - 16:
return I; - 17:
end
|