# Metaheuristic with Cooperative Processes for the University Course Timetabling Problem
## 2 University Course Timetabling Problem (UCTP)
### Optimization Model  
According to what [PERSON] raised in [13; 26; 41], a feasible solution is the one in which all events are scheduled, assigning them in the possible 45 existing timeslots for each room. This schedule of events considers the capacity of the room, the facilities offered by the room, the needs required by the event and the students who will attend the event. The optimization model is made up of sets of soft constraints and sets of hard constraints. Hard constraints are constraints that must be met to obtain a feasible solution. These constraints are related to the physical resources. Soft constraints are constraints that are preferable to comply with, but they do not need to be met for the solution to have a feasible result. A penalty is assigned, in the objective function, which is to minimize, when the constraints are not met. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Slot**} & \multicolumn{5}{c}{**Day**} \\ \cline{2-6}  & **Monday** & **Tuesday** & **Wednesday** & **Thursday** & **Friday** \\ \hline
1 & 1 & 2 & 3 & 4 & 5 \\ \hline
2 & 6 & 7 & 8 & 9 & 10 \\ \hline
3 & 11 & 12 & 13 & 14 & 15 \\ \hline
4 & 16 & 17 & 18 & 19 & 20 \\ \hline
5 & 21 & t (5, 2) = 22 & 23 & 24 & 25 \\ \hline
6 & 26 & 27 & 28 & 29 & 30 \\ \hline
7 & 31 & 32 & 33 & 34 & 35 \\ \hline
8 & 36 & 37 & 38 & 39 & 40 \\ \hline
9 & 41 & 42 & 43 & 44 & 45 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Two-dimensional table of schedules assigned to a room with 45 timeslots. Figure 1: Three-dimensional table of schedules assigned to various rooms (\(r_{1}\) to \(r_{10}\)). The optimization model presents the following sets. The set of events \(E=\{1,2,3,\ldots,\)\(n_{E}\}\), the set of timeslots \(T=\{1,2,3,\ldots,\)\(45\}\), the set of days \(D=\{1,2,3,4,5\}\), the set of periods \(P=\{1,2,3,4,5,6,7,8,9\}\), the set of rooms \(R=\{1,2,3,\ldots,\)\(n_{R}\}\), the set of students \(S=\{1,2,3,\ldots,\)\(n_{S}\}\) and the set of facilities \(F=\{1,2,3,\ldots,\)\(n_{F}\}\). Equation (1) minimizes the objective function which exclusively accounts for violations committed to the soft constraints, _Soft1_, _Soft2_ and _Soft3_, that are related to each student and that are implicit in functions \(F1\), \(F2\) and \(F3\). The soft constraint _Soft1_ indicates that a student \(s\in S\) should not have class in the last period of the day. The soft constraint _Soft2_ indicates that a student should not have more than two adjoining classes. The soft constraint _Soft3_ indicates that a student should not have a single class per day, from the set \(T=\{1,2,3,\ldots,\)\(45\}\) of timeslots, which represents \(45\) h available in a \(5\)-day school week with \(9\) periods per day. Events can be scheduled with students and the schedule table can be found for each room, where each room can offer different facilities and each event can have different needs. The UCTP optimization model is presented with the formulation from (1) to (7). \[min\;OF=\sum\limits_{s=1}^{n_{A}}F1(s,Soft1)+\sum\limits_{s=1}^{n_{A}}F2(s, Soft2)+\sum\limits_{s=1}^{n_{A}}F3(s,Soft3) \tag{1}\]  
s.t. \[X(e,\  
Moreover, each event can be scheduled only once in the week and, because of this, the equality must always be 1. The set of constraints in (4) indicates that, in each room alone, there will be one event at a time. When in some timeslot \(t\in T\) and some room \(r\in R\), \((e,\Phi(t,r))=1\), then the event \(e\) is scheduled in the timeslot \(t\) of room \(r\), \((\Phi(t,r)=1)\). So \(X(e^{\prime},\Phi(t,r))=0,\ \forall e^{\prime}\in E\), with \(e^{\prime}\
eq e\). The set of constraints in (5) indicates that room \(r\) must have sufficient capacity to attend to the student of the event. To define this constraint, from the expression (10) that indicates that for each student \(s\in S\), this will be true, if the student \(s\) is attending the event \(e\) that occurs in the timeslot \(t\) of room \(r\), \((\Phi(t,r)=1)\). So, the number of students in class should not exceed the capacity of the room. \[Z(s,X(e,\Phi(t,r)))=