## 3 The Greek HSTP
### The Evaluation (Fitness) Function  
We used a weighted sum function that is based on hard and soft constraint violations to assist the algorithm's evolution. Each constraint violation added a cost to the function value, which was estimated by the mathematical formula presented at the end of this section. The cost contribution of each constraint violation was computed via a formula that was different for each constraint. Next, we present the weights used in the fitness function along with the formulas for each constraint violation, whether it was a hard or a soft constraint. The actual values of these weights are presented in Section 4.7, in Table 2.  
1. Hard Constraint Weight--HCW: This weight is used by the algorithm to distinguish between feasible and non-feasible timetables. This specific weight should be considerably higher than the value of the other weights, so that feasible but not efficient timetables should rarely have a higher total cost than the non-feasible ones. However, this weight should not be too large, to avoid restricting the diversity provided by infeasible timetables during the algorithm's evolution;
2. Teachers' empty periods weight--TEPW: this weight is related to the gaps in teachers' schedules during a working day;
3. Ideal dispersion weight for teachers--IDWT: this weight is used to compute the dispersion of teachers' hours of teaching;
4. Ideal dispersion weight for classes--IDWC: this weight regulates the ideal dispersion of teachings to classes. A very important parameter is also the exponential basis used in the definition of objective function. It is symbolized with BASE and its value must be a real number between 1 and 2, as suggested by [PERSON] and [PERSON] [8]. This parameter is used in various constraints. In the presented contribution, we decided to follow a different approach to the BASE setting value, from that proposed by the above-mentioned researchers, to avoid the production of infeasible final timetables. The analytical formulas for the cost of violating each constraint are listed next. * Hard constraints (see Section 3.1) 1. Classroom conflicts: this type of hard constraint is always respected by the representation of the particle as a matrix (see Section 4.4.1); 2. Idle periods of classes: for each class that has a gap that is not the last hour of the day, the following cost was added: \(\text{HCW}*(2*\text{BASE})^{\text{BASE}}\), contrary to the proposal of [PERSON] and [PERSON] [8], who use the formula \(\text{HCW}*\text{BASE}^{\text{BASE}}\); 3. Teacher conflicts--parallel teaching: for each teacher and for each period during which the teacher is assigned to more than one classes, i.e., K classes, the following cost was added: \(\text{HCW}*\text{BASE}^{\text{K}}\); 4. Teacher availability: for every period a teacher is assigned to teach when she/he is not available on the corresponding day, the following cost was added: \(\text{HCW}*\text{BASE}^{3}\); 5. Teacher-class-course assignment: this constraint is never violated due to the initialization process which is performed in accordance with the input data; 6. Co-teachings: the following cost was added for each class involved in co-teaching when the corresponding teacher was assigned to a period, while hers/his co-teacher is not assigned to the same period: \(\text{HCW}*(2*\text{BASE})^{\text{BASE}}\), contrary to the proposal of [PERSON] and [PERSON] [8], who use the formula \(\text{HCW}*\text{BASE}^{\text{BASE}}\). * Soft constraints (see Section 3.2) 1. Course allocation--class dispersion: for each class, the following cost was added: \(IDWC*HOURS*BASE^{DAYS}\), where \(HOURS\) is the number of hours a subject is taught and \(DAYS\) is the number of days when this takes place. For example, if a teacher is assigned to a class for three periods during a day, while she/he teaches only one lesson--subject in this class, then this subject occupies two hourly slots. Therefore, \(HOURS=2\). 2.