A hybrid grouping genetic algorithm for assigning students to preferred laboratory groups

8
A hybrid grouping genetic algorithm for assigning students to preferred laboratory groups Luis E. Agustín-Blas, Sancho Salcedo-Sanz * , Emilio G. Ortiz-García, Antonio Portilla-Figueras, Ángel M. Pérez-Bellido Grupo de Heurísticos Modernos de Optimización y Diseño de Redes (GHEODE), Department of Signal Theory and Communications, Universidad de Alcalá, 28871 Alcalá de Henares, Madrid, Spain article info Keywords: Timetabling Combinatorial optimization Grouping genetic algorithms Assignment problems abstract This paper presents a novel application of the hybrid grouping genetic algorithm in a problem related to university timetabling. Specifically, the assignment of students to laboratory groups is tackled. This prob- lem includes an important constraint of capacity, due to laboratories usually have a maximum number of equips or computers available, so the number of total students in a group is constrained to be equal or less than the capacity of the laboratory. In addition, our approach considers the case in which the stu- dents provide a sorted list of preferred laboratory groups, so the objective of the assignment must take this point into account. A variation of the problem in which a balanced number of students per group is required (lecturer preferences) is also studied in this paper. The performance of the approach is shown in different test problems and in a real application in a Spanish University. Ó 2008 Elsevier Ltd. All rights reserved. 1. Introduction Timetabling of lectures and laboratories is a problem that universities all around the world face every year (Beligiannis, Moschopoulos, Kaperonis, & Likothanassis, 2008; Beligiannis, Moschopoulos, & Likothanassis, 2007; Burke & Carter, 1998; Burke & Carter, 2001; Burke & Carter, 2003; Burke & Petrovic, 2002; Burke & Ross, 1996; Burke, Jackson, Kingston, & Weare, 1997; Carter, 2001; deWerra, 1985; Head & Shaban, 2007; Monfroglio, 1996a; Monfro- glio, 1996b; Mooney, Rardin, & Parmenter, 1996; Petrovic, Yang, & Dror, 2007; Pongcharoen, Promtet, Yenradee, & Hicks, 2008; Ross, Hart, & Corne, 2003; Santiago-Mozos, Salcedo-Sanz, dePrado-Cump- lido, & Bousoño-Calzón, 2005; Schaerf, 1999; Stamatopoulos, Viglas, & Karaboyas, 1998). The timetabling problem in a university consists of finding time slots for a set of events (exams or subjects for exam- ple) so that students can attend all respective events (Burke et al., 1997; Burke & Petrovic, 2002; deWerra, 1985). The work in university timetabling in the last few years has been massive, in part because the definition of a timetabling problem differs from one uni- versity to another (usually every university has different necessities and peculiarities for subject registration, exams or classes etc), so successful algorithms for specific situations or universities are often presented (Beligiannis et al., 2007; Beligiannis et al., 2008; Petrovic et al., 2007; Santiago-Mozos et al., 2005). Another interesting property of university timetabling, is that there are a number of associated subproblems once the main timet- abling is obtained (again, this depends much on the university or country where the university is located) (MirHassani, 2006; Mooney et al., 1996). Consider for example, the case of laboratory groups. In the majority of universities, once that the timetabling for theoretical and laboratory lectures is ready, an associated problem consists in assigning students to their preferred laboratory groups (in the case that there are several groups for a subject, which is a really common case in many universities). It is well known that two types of constraints can be defined in timetabling and associated problems: first, the constraints which are basic for the feasibility of the timetable obtained are usually called hard constraints. Second, the constraints which do not affect to the feasibility of the final solution, but their fulfilment makes it more appropriate in terms of some defined criteria. These con- straints are usually called soft constraints (Burke & Petrovic, 2002; Santiago-Mozos et al., 2005). We also have this kind of con- straints in the problem of assigning students to laboratory groups: the maximum capacity of the laboratory is a hard constraint, that cannot be violated to obtain feasible solutions. On the other hand, the preferences of students and/or lecturers can be seen as soft constraints, which should increase the value of the solution when fulfilled. Thus, the soft constraints are usually included in the objective function of the problem. This paper tackles the assignment of students to laboratory groups (ASLGP, hereafter), but considering an extra component: the preferences of students and lecturers. A number of laboratory 0957-4174/$ - see front matter Ó 2008 Elsevier Ltd. All rights reserved. doi:10.1016/j.eswa.2008.09.020 * Corresponding author. E-mail address: [email protected] (S. Salcedo-Sanz). Expert Systems with Applications 36 (2009) 7234–7241 Contents lists available at ScienceDirect Expert Systems with Applications journal homepage: www.elsevier.com/locate/eswa

Transcript of A hybrid grouping genetic algorithm for assigning students to preferred laboratory groups

Expert Systems with Applications 36 (2009) 7234–7241

Contents lists available at ScienceDirect

Expert Systems with Applications

journal homepage: www.elsevier .com/locate /eswa

A hybrid grouping genetic algorithm for assigning students to preferredlaboratory groups

Luis E. Agustín-Blas, Sancho Salcedo-Sanz *, Emilio G. Ortiz-García, Antonio Portilla-Figueras,Ángel M. Pérez-BellidoGrupo de Heurísticos Modernos de Optimización y Diseño de Redes (GHEODE), Department of Signal Theory and Communications, Universidad de Alcalá, 28871 Alcalá deHenares, Madrid, Spain

a r t i c l e i n f o

Keywords:TimetablingCombinatorial optimizationGrouping genetic algorithmsAssignment problems

0957-4174/$ - see front matter � 2008 Elsevier Ltd. Adoi:10.1016/j.eswa.2008.09.020

* Corresponding author.E-mail address: [email protected] (S. Salcedo

a b s t r a c t

This paper presents a novel application of the hybrid grouping genetic algorithm in a problem related touniversity timetabling. Specifically, the assignment of students to laboratory groups is tackled. This prob-lem includes an important constraint of capacity, due to laboratories usually have a maximum number ofequips or computers available, so the number of total students in a group is constrained to be equal orless than the capacity of the laboratory. In addition, our approach considers the case in which the stu-dents provide a sorted list of preferred laboratory groups, so the objective of the assignment must takethis point into account. A variation of the problem in which a balanced number of students per groupis required (lecturer preferences) is also studied in this paper. The performance of the approach is shownin different test problems and in a real application in a Spanish University.

� 2008 Elsevier Ltd. All rights reserved.

1. Introduction

Timetabling of lectures and laboratories is a problem thatuniversities all around the world face every year (Beligiannis,Moschopoulos, Kaperonis, & Likothanassis, 2008; Beligiannis,Moschopoulos, & Likothanassis, 2007; Burke & Carter, 1998; Burke& Carter, 2001; Burke & Carter, 2003; Burke & Petrovic, 2002; Burke& Ross, 1996; Burke, Jackson, Kingston, & Weare, 1997; Carter, 2001;deWerra, 1985; Head & Shaban, 2007; Monfroglio, 1996a; Monfro-glio, 1996b; Mooney, Rardin, & Parmenter, 1996; Petrovic, Yang, &Dror, 2007; Pongcharoen, Promtet, Yenradee, & Hicks, 2008; Ross,Hart, & Corne, 2003; Santiago-Mozos, Salcedo-Sanz, dePrado-Cump-lido, & Bousoño-Calzón, 2005; Schaerf, 1999; Stamatopoulos, Viglas,& Karaboyas, 1998). The timetabling problem in a university consistsof finding time slots for a set of events (exams or subjects for exam-ple) so that students can attend all respective events (Burke et al.,1997; Burke & Petrovic, 2002; deWerra, 1985). The work inuniversity timetabling in the last few years has been massive, in partbecause the definition of a timetabling problem differs from one uni-versity to another (usually every university has different necessitiesand peculiarities for subject registration, exams or classes etc), sosuccessful algorithms for specific situations or universities are oftenpresented (Beligiannis et al., 2007; Beligiannis et al., 2008; Petrovicet al., 2007; Santiago-Mozos et al., 2005).

ll rights reserved.

-Sanz).

Another interesting property of university timetabling, is thatthere are a number of associated subproblems once the main timet-abling is obtained (again, this depends much on the university orcountry where the university is located) (MirHassani, 2006; Mooneyet al., 1996). Consider for example, the case of laboratory groups. Inthe majority of universities, once that the timetabling for theoreticaland laboratory lectures is ready, an associated problem consists inassigning students to their preferred laboratory groups (in the casethat there are several groups for a subject, which is a really commoncase in many universities).

It is well known that two types of constraints can be defined intimetabling and associated problems: first, the constraints whichare basic for the feasibility of the timetable obtained are usuallycalled hard constraints. Second, the constraints which do not affectto the feasibility of the final solution, but their fulfilment makes itmore appropriate in terms of some defined criteria. These con-straints are usually called soft constraints (Burke & Petrovic,2002; Santiago-Mozos et al., 2005). We also have this kind of con-straints in the problem of assigning students to laboratory groups:the maximum capacity of the laboratory is a hard constraint, thatcannot be violated to obtain feasible solutions. On the other hand,the preferences of students and/or lecturers can be seen as softconstraints, which should increase the value of the solution whenfulfilled. Thus, the soft constraints are usually included in theobjective function of the problem.

This paper tackles the assignment of students to laboratorygroups (ASLGP, hereafter), but considering an extra component:the preferences of students and lecturers. A number of laboratory

L.E. Agustín-Blas et al. / Expert Systems with Applications 36 (2009) 7234–7241 7235

groups for a subject is determined by the school or faculty direc-tion, and the students must be assigned to these laboratories min-imizing an objective function, which measures the good quality ofthe assignment in terms of how many preferences of students and/or lecturers are fulfilled. Since laboratories usually have a maxi-mum number of equips or computers available, the number of totalstudents in a group is constrained to be equal or less than thecapacity of the laboratory. This is a hard constraint which cannotbe violated in any case. In addition, we consider the case in whichall the laboratory groups must have a similar number of students(lecturers preferences).

We propose the use of a hybrid grouping genetic algorithm tosolve the ASLGP. The grouping genetic algorithm was introducedby Falkenauer (1992). Since then, this approach has been success-fully applied to a large amount of assignment and location prob-lems (Brown & Vroblefski, 2004; De Lit, Falkenauer, &Delchambre, 2000; Falkenauer, 1992; Falkenauer, 1998; Hung,Sumichrast, & Brown, 2003; James, Brown, & Keeling, 2007; James,Vroblefski, & Nottingham, 2007), in very different fields. In ourcase, the grouping genetic algorithm is mixed with a local searchto even improve its performance in the ASLGP. An illustration ofthe approach in several randomly generated ASLGP instances anda real application in Universidad de Alcalá, Madrid, Spain, is carriedout in the experimental section of the paper.

The structure of the rest of the paper the following: Section 2introduces the problem and its extension to consider also prefer-ences of lecturers. Section 3 describes and analyzes the proposedgrouping genetic algorithm algorithm, including a local search pro-cedure to improve the algorithm’s performance. Section 4 showsthe results of the simulations performed in order to test the algo-rithm, we include in these simulations a real case in Universidadde Alcalá, Spain. Section 5 concludes the paper and offers some fi-nal remarks.

2. Problem definition

Consider the case, quite common in practice, of a universitysubject which includes theoretical and practical content. The prac-tical content of the subject is carried out in laboratories, at differ-ent hours and/or days from the theoretical part of the subject. Theassignment of students to laboratory groups starts then from a gi-ven timetabling of the course, in such a way that the times atwhich the laboratories must start are fixed in advance. Due to, inthe majority of cases, each laboratory has a maximum capacity,several groups at different hours are offered by the school or fac-ulty to the students. The problem we tackle in this paper consistsin the assignment of students to the laboratory groups, consideringthe capacity of the laboratory and the preferences of students andlecturers.

We state first the basic assignment problem, only consideringstudent’s preferences: Let G ¼ fg1; g2; . . . ; gNg be the set of N labo-ratory groups of a given subject. Each group gk has already as-signed the corresponding timetabling (days of the week andhours in which this laboratory will be carried out), and a maximumcapacity of students Cg . Let S ¼ fs1; s2; . . . ; sMg be the set of M stu-dents to be assigned the laboratories. Each student will have a pre-ferred group, depending on other subjects he/she has enrolled or inother personal considerations. Let us consider a preference valuePsg , associated to each student s and group g, such thatPN

g¼1Psg ¼ 100, i.e. each student s, must assign a large value of pref-erence P to the group or groups he/she want to be assigned, and asmall value to the groups he/she would not like to be assigned. As asmall example, in a case of four groups of laboratory, a given stu-dent s could prefer group 2 or group 4 (2 slightly better than 4),but he does not like at all group 3 because it is at the same day

and hour that another subject, and group 1, with is scheduledtoo early in the morning. Thus the preferences of this student couldbe Ps ¼ f10;50;0;40g. In order to state the definition of the prob-lem, we also need an M � N binary assignment matrix X, in whicheach element xsg ¼ 1 means that the student s has been assignedto the laboratory group g (xij ¼ 0 stands for no assignment). Ofcourse, one student must be assigned to one and only one labora-tory group ð

Pgxsg ¼ 1; 8sÞ, and all the students must be assigned

to a group ðP

s

Pgxsg ¼ MÞ.

With these previous definitions, we can now state the assign-ment of students to laboratory groups, considering students’ pref-erences (P1): Find X, such as

maxX

s

Xg

xsg � Psg

!; ð1Þ

in such a way thatXs

xsg 6 Cg ; 8g: ð2Þ

A small variant of this problem also considers the preferences oflecturers, in addition to the students’ ones. These preferencesconsist of having balanced groups, with similar number of stu-dents per group, instead of having some groups with plenty ofstudents and others with very few ones or even empty. In thiscase, the definition of the ASLGP is as follows (P2): Find X, suchas

maxX

s

Xg

xsg � Psg þ K2 � 1� rtol

� � !; ð3Þ

where

r ¼PN

i¼1

Psxsi � M

N

� �2

Nð4ÞX

sxsg 6 Cg ; 8g: ð5Þ

Note that problem P1 only takes into account the students prefer-ences, so one group may be full and other may have just one stu-dent. This is not appealing to lecturers, so in problem P2 thispoint is corrected by including a term in the objective functionwhich encourages a balance in the number of students in groups.This is carried out by the variable r, which is the variance of thenumber of students in each group respect to the mean of studentsper group. The variable tol stands for the tolerance of the variancewhich makes that second factor of Eq. (3) contributes to thefitness.

3. The hybrid grouping genetic algorithm proposed

The grouping genetic algorithm (GGA) is a class of evolutionaryalgorithm specially modified to tackle grouping problems, i.e.problems in which a number of items must be assigned to a setof predefined groups. It was proposed by Falkenauer (1992), whorealized that traditional genetic algorithms had some drawbackswhen they were applied to grouping problems (mainly, the tradi-tional encoding increases the space search size in this kind of prob-lems). Thus, in the GGA, the encoding, crossover and mutationoperator of traditional GAs are modified, to obtain a compact algo-rithm with very good performance in problems of grouping. TheGGA has been successfully applied to a number of problems, in dif-ferent fields such as telecommunications (Brown & Vroblefski,2004), manufacturing (James et al., 2007), industrial engineering(Hung et al., 2003), etc.

In the next subsection we show the main characteristics of thehybrid GGA we propose. Special attention will be paid to the

7236 L.E. Agustín-Blas et al. / Expert Systems with Applications 36 (2009) 7234–7241

encoding, genetic operators and the implemented local search toimprove the quality of solutions.

3.1. Problem encoding

The GGA initially proposed by Falkenauer is a variable-lengthgenetic algorithm. The encoding is carried out by separating eachchromosome in two parts, first an assignment part, in which theitem and the group it is assigned is encoded. Second, a group part,which defines which groups must be taken into account for thischromosome. In a general case, where the number of groups arenot previously defined, it is easy to see why this is a variable lengthalgorithm: the group part varies from one chromosome to another.However, in the ASLGP, the laboratory groups are fixed in advance,so in our case, the GGA uses a fixed-length encoding in which thegroup part is always of length N. In spite of this, note that the grouppart is used in the crossover and mutation operators, so it shouldbe always present in the chromosome. As an example of a chromo-some encoding, consider a ASLGP with three groups and 15 stu-dents, and the following specific assignment: 1 2 1 3 3 1 1 2 3 23 1 1 2 3 j 1 2 3. Note that in this case, the first laboratory groupwill have students {1,3,6,7,12,13}, the second group {2,8,10,14}and the third group {4,5,9,11,15}.

It is important to see that the assignment part of the chromo-some in the genetic algorithm is directly related to the matrix Xof assignment, defined in Section 2. In fact, given a chromosomec = [ajg], where a represents the assignment part of the chromo-some and g stands for the group part, the elements of matrix Xare defined as follows:

xij ¼1 if ai ¼ j

0 otherwise

�ð6Þ

father 1 4 2 4 4 3 3 1 4 1 2 4 1 2 2 ⏐1 2 3 4

mother 2 4 4 1 3 3 4 2 2 2 3 4 1 4 4 ⏐1 2 3 4

offspring 2 4 2 1 3 3 3 2 2 2 2 4 1 2 2 ⏐1 2 3 4

Fig. 1. Example of the crossover procedure implemented in the GGA.

3.2. Selection operator

In this paper we use a rank-based wheel selection mechanism,as the one described in James et al. (2007). First, the individualsare sorted in a list based on their quality, given by Eq. (1) in thecase of problem P1, or (3), in the case of the P2. The position ofthe individuals in the list is called rank of the individual, and de-noted Ri, i ¼ 1; . . . ; n, with n number of individuals in the geneticpopulation. We consider a rank in which the best individual x is as-signed Rx ¼ n, the second best y, Ry ¼ n� 1 etc. A fitness value asso-ciated to each individual is then defined, as follows:

fi ¼2 � Ri

n � ðnþ 1Þ ð7Þ

Note that these values are normalized between 0 and 1, dependingon the position of the individual in the ranking list. It is important tonote that this rank-based selection mechanism is static, in the sensethat probabilities of survival (given by fi) do not depend on the gen-eration, but on the position of the individual in the list. As a smallexample, consider a population formed by five individuals, in whichindividual one is the best quality one ðR1 ¼ 5Þ, individual 2 the sec-ond best ðR2 ¼ 4Þ, and so on. In this case, the fitness associated tothe individuals are {0.33, 0.26, 0.2, 0.13, 0.06}, and the associatedintervals for the roulette wheel are {0–0.33, 0.34–0.6, 0.61–0.8,0.81–0.93, 0.94–1}.

The process carried out in our algorithm consists of selectingthe parents for crossover using this selection mechanism. This pro-cess is performed with replacement, i.e., a given individual can beselected several times as one of the parents, however, individualsin the crossover operator must be different. Also, an elitist strategyis considered, in such a way that the best individual found so far inthe evolution is directly passed to the next generation.

3.3. Crossover and mutation operators

The crossover operator implemented in our grouping geneticalgorithm is based on the one proposed by Falkenauer (1998),and also used by James et al. (2007). Several differences arisesdue to, in our case, the number of groups are fixed, and the imple-mentation of the algorithm is not variable-length, but fixed-length.The process for performing the crossover is the following:

� First, two individuals are selected, one will be named father, andthe other mother. Only one offspring individual will be gener-ated from these two individuals.

� Equalize the offspring to the mother.� Select two groups in the groups part of the father.� Insert the elements of the father belonging to the two selected

groups into the offspring.� Repair the individual in order to avoid unfeasible solutions.

In order to illustrate this procedure, Fig. 1 shows an example inwhich 15 students must be assigned to four laboratory groups. Inthis case, groups 2 and 3 are selected, as indicated in the figure.Then, the offspring is generated by first equalizing it to the motherindividual, and then including the elements of the father belongingto groups 2 or 3. The repairing of the solution, necessary when agroup contains more students than its capacity, will be describedin a posterior section. The crossover operator is applied to couplesof individuals with a probability Pc.

Regarding the mutation operator used in our algorithm, it isbased on a swapping procedure between two students in a givenindividual. Fig. 2 shows and example of this operator, in which stu-dent #4 and student #10 swap their corresponding groups. Theelection of the students who interchange their groups is carriedout with a given mutation probability. This operator is applied toa given individual with a certain probability Pm.

3.4. Repairing of solutions

Once the a new offspring population is generated, a repairing ofsolutions is performed in each individual of the new population.This step is necessary to avoid individuals which do not fulfil thecapacity constraint of students per group. The process to repaireach individual in the new population is the following:

� Locate the groups with over-passed capacity.� Randomly choose a student assigned to one of these groups.� Assign this student to the most preferred group of the student

with enough capacity.� Continue this procedure until all groups are under their maxi-

mum capacity.

It is important to note that the repairing procedure takes intoaccount the preferences of the students when they are re-allocatedin different groups than the initial with over-passed capacity. Toshow the performance of this repairing heuristic, we analyze aASLGP example where 15 students must be assigned to 3 groups,

2 4 2 1 3 3 3 2 2 2 2 4 1 2 2 ⏐1 2 3 4

2 4 2 2 3 3 3 2 2 1 2 4 1 2 2 ⏐1 2 3 4

Fig. 2. Example of the mutation procedure implemented in the GGA.

L.E. Agustín-Blas et al. / Expert Systems with Applications 36 (2009) 7234–7241 7237

in a problem in which each group has a maximum capacity of 6students, using the definition P1 of the ASLGP. Let us consider aninitial individual (chromosome) c = [1 2 3 1 1 2 2 1 3 1 1 2 1 12j1 2 3], and preferences of the students given in Table 1. In thisexample, group 1 has eight students, group 2 has five studentsand group 3 has two students. We must, therefore, repairing theindividual in such a way that the number of students in group 1is reduced in two units. We first choose randomly a student as-signed to group 1 in order to start the repairing. Let us considerthat this student is student #8 for example (check that this studentis assigned to group 1 at the beginning). The preferences of student#8 (see Table 1) are 59 for group 1, 25 for group 2 and 16 for group3, so we re-allocate student #8 in group 2, which still has enoughcapacity to accept this reallocation. Next student to be reassignedis, for example, student #10, which has preferences 78 for group 1,8 for group 2 and 14 for group 3. Thus, in this case student #10 willbe assigned to group 3 which has enough capacity to allocate it.With this last reassignment, the final (repaired) individual isc = [1 2 3 1 1 2 2 2 3 3 1 2 1 1 2j1 2 3], which has an associatedobjective function value (problem P1) of 641.

Table 2Preferences of students in the example of Section 3.5

Students Group 1 Group 2 Group 3

#1 72 19 9#2 36 33 31#3 54 45 1#4 82 2 16#5 51 10 39#6 21 61 18#7 76 20 4#8 59 25 16#9 61 21 18#10 78 8 14#11 12 23 65#12 23 48 29#13 44 42 14#14 21 52 27#15 91 3 6

3.5. Local search

We use a local search procedure to try to find local optimums ina close neighborhood of an individual. The local search proposed isbased on small modifications of the current individual as far asthey produce increasing of the associated objective function. Thelocal search procedure is applied to every individual in the popula-tion, and produces, as we will show, a lamarckian hybrid algo-rithm, i.e. the chromosome is modified together with itsassociated objective function. The local search procedure usedcan be described as follows:

� Start by the first student, and go with the following in naturalorder.

� For each student, calculate the objective function obtained whenit is reassigned to a different laboratory group, if the capacitycondition is not violated.

Table 1Preferences of students in the example of Section 3.4

Students Group 1 Group 2 Group 3

#1 76 20 4#2 59 25 16#3 61 21 18#4 78 8 14#5 12 23 65#6 23 48 29#7 44 42 14#8 21 52 27#9 91 3 6#10 72 19 9#11 36 33 31#12 54 45 1#13 82 2 16#14 51 10 39#15 21 61 18

� If this assignment increases the objective function value of thechromosome, the assignment is kept, in other case, the newassignment is discarded, and the chromosome remains as itwas before the last group reassignment.

� This procedure continues until no improvement is obtained in acomplete round of reassignments.

As an example of the local search procedure, let us consider thea given individual c = [1 2 3 1 1 2 2 3 3 1 3 2 1 1 2j1 2 3], which hasan initial objective function value of 613 considering the students’preferences given in Table 2. As in the previous section, we con-sider an ASLGP instance with 15 students, to be assigned into threegroups (with a maximum of six students per group).

Tables 3 and 4 show the two first steps of our local search in thisspecific example (there is a third step equal to the second one). Inthe first step, (Table 3), there are three groups’ reassignment whichimprove the quality of the initial solution: specifically, the first oneconsists of reassigning student #3 from group 3 to group 2, the sec-ond one involves student #14, which is reassigned from group 1 togroup 3, and the third one consists of reassigning student #15 fromgroup 2 to group 1. With these reassignments, the final individualafter this first local search step results c = [1 2 2 1 1 2 2 3 3 1 3 2 1 31j1 2 3], with an associated objective function value of 751, as canbe seen in Table 3. In the second step of the local search, given inTable 4, a second round of reassignment is carried out, startingagain by student #1. In this case there is only one reassignmentwhich improves the quality of the solution: student #8 is reassignfrom group 3 to group 2, obtaining a fitness value of 760, and achromosome c = [1 2 2 1 1 2 2 2 3 3 1 2 1 3 1j1 2 3]. In the third

Table 3Example of the first step of the local search procedure described in Section 3.5.Objective function values are calculated using preferences given in Table 2

Students Group 1 Group 2 Group 3

#1 613 560 550#2 – 613 611#3 – 657 613#4 657 – 591#5 657 – 645#6 – 657 614#7 – 657 641#8 – – 657#9 – – 657#10 657 – 593#11 – – 657#12 – 657 638#13 657 – 627#14 – – 663#15 751 663 666

Table 4Example of the first step of the local search procedure described in Section 3.5.Objective function values are calculated using preferences given in Table 2

Students Group 1 Group 2 Group 3

#1 751 698 688#2 – 751 749#3 – 751 707#4 751 671 685#5 751 710 739#6 – 751 708#7 – 751 735#8 – 760 751#9 – – 760#10 760 – 696#11 – – 760#12 – 760 741#13 760 – 730#14 – – 760#15 760 – 675

Table 5Comparison of the best results obtained by the GGA and the greedy algorithm GRAHin the randomly generated ASLGP instances considered

Problem Hybrid GGA (P1) GRAH (P1) Hybrid GGA (P2) GRAH (P2)

75/4/25 4080 4080 4719 4719100/6/25 5028 5028 5259 5207150/8/25 6196 6196 6703 6660200/10/25 7187 7187 7743 7715250/12/25 8446 8446 9148 9135300/14/25 9379 9376 10046 10002400/18/25 11081 11059 11815 11783

Table 6Number of students in ith group in the best solutions found by our GGA, problem P1(results in the randomly generated ASLGP instances tackled)

Instance Number of students in ith group

75/4/25 25,25,16,9100/6/25 25,25,25,12,8,5150/8/25 25,25,25,25,21,13,10,6200/10/25 25,25,25,25,25,23,12,11,6,23250/12/25 25,25,25,25,25,25,22,23,20,15,8,12300/14/25 25,25,25,25,25,25,25,25,24,21,25,7,10,13400/18/25 25,25,25,25,25,25,25,25,25,25,25, 24,15,23,23,14,15,11

Table 7Number of students in ith group in the best solutions found by our GGA problem P2

7238 L.E. Agustín-Blas et al. / Expert Systems with Applications 36 (2009) 7234–7241

step of the local search there is not a further improve by reassign-ment, so the local search procedure is stopped at this point.

4. Experiments and results

We propose two types of experiments to show the performanceof our approach. First, we tackle a set of randomly generated ASLGPinstances, and compare the results of our algorithm with that of anexisting adaptive heuristic algorithm. Second, we present a realapplication of the ASLGP and our proposed GGA in Universidadde Alcalá, Madrid, where the authors of this paper serve aslecturers.

4.1. Experiments in generated ASLGP instances

In order to show the performance of our approach, we havetackled seven artificially generated ASLGP instances, with differentnumber of students and groups. Specifically, we consider instancesfrom 75 to 400 students, to be assigned to a different number oflaboratory groups. The instances are given under the notationM=N=Cg (total number of students, number of groups and maxi-mum capacity of the groups, respectively). The parameters of Eq.(1) used in the simulations are K2 ¼ 1000 and tol ¼ 36. We haverandomly constructed the preferences of students, using a modelconsisting of an uniform distribution Uð0; xÞ, with x the value ofpreference for the remaining groups. Fig. 3 shows an example ofpreference construction of one student in an example with fivegroups. In this case, a value of 64 is assigned as preference forthe first group, 17 for the second, 12, 3 and 4 for third, fourthand fifth group, respectively.

We compare our results with those of a greedy randomizedadaptive heuristic (GRAH), which has been applied before to thegeneralized assignment problem (Ramalhinho-Lourenço & Serra,2002). The generalized assignment problem (GAP) considers theminimum cost assignment of n jobs to m agents such that eachjob is assign to one and only one agent subject to capacity con-straints on the agents. Note that the ASLGP can be seen as a specialcase of generalized assignment, where jobs are students, agents are

U(0,100)=64 U(0,36)=17 U(0,19)=12

U(0,7)=3

100-ΣU(0,x)=4

Fig. 3. Example of a specific synthetic construction of the preferences of a student,in an ASLGP instance with five groups.

laboratories, the cost of an assignment is related with the prefer-ences of students, and the capacity of agents is given by the max-imum capacity of laboratories. For each ASLGP instance consider,10 runs of the compared algorithms were launched. Table 5 showsthe comparative results between our GGA and the GRAH inRamalhinho-Lourenço and Serra (2002) for problems P1 and P2.It is interesting to see that the proposed GGA for problem P1 workssimilar to the GRAH in all the ASLGP instances tackled, but in thecase of 300 and 400 students, where the GGA works slightly betterthan the GRAH. The performance of the GGA for the problem P2 ismuch better than the GRAH. The case of balanced groups is a moredifficult case, and our proposed algorithm outperforms in this casethe GRAH.

Table 6 shows the number of students in each group obtainedby the GGA, for all the instances tackled. It is also interesting thatthe most preferred groups are completely full (25 students), butthere are groups in which there are very few students (last groupsin our simulations). Usually, this situation is not appealing for lec-tures, which prefer balanced groups with similar number of stu-dents in them. Table 7 shows the number of students in eachgroup considering the term of balance (P2) in Eq. (3). Note thatin this case we have a balanced number of students in all thegroups, as requested.

4.2. A real application in a Spanish university

In order to complete the experimental section of the paper, wepresent a real application of the algorithm carried out in the Schoolof Telecommunications Engineering, Universidad de Alcalá, Madrid,

(results in the randomly generated ASLGP instances tackled)

Instance Number of students in ith group

75/4/25 22,18,18,17100/6/25 22,19,16,15,14,14150/8/25 23,21,20,18,17,17,16,18200/10/25 25,24,22,21,20,18,18,17,17,18250/12/25 24,22,22,22,20,20,20,20,19,18,18,25300/14/25 25,25,25,23,22,21,20,20,20,19,18,19,18,25400/18/25 25,25,25,25,25,24,23,22,22,21,20,20,20,20,20,19,19,25

100 101 102 1032300

2400

2500

2600

2700

2800

2900

3000

3100

3200

Generation

Fitn

ess

Fig. 5. Average fitness evolution (10 runs) obtained by our GGA in the realapplication in Universidad de Alcalá, considering the P1 version of the ASLGP.

100 101 102 1032300

2400

2500

2600

2700

2800

2900

3000

3100

3200

3300

Generation

Fitn

ess

Fig. 6. Average fitness evolution (10 runs) obtained by our GGA in the realapplication in Universidad de Alcalá, considering the P2 version of the ASLGP.

L.E. Agustín-Blas et al. / Expert Systems with Applications 36 (2009) 7234–7241 7239

Spain. In this school, the subject Digital Data Transmission is taught inthe third course of the Telecommunications Engineering degree, inthe first semester of the year. The subject is organized in theoreticaland laboratory lessons, where the students prepare computer pro-grams related to the theoretical part of the course. A maximum num-ber of 25 students per laboratory are allowed, due to equipmentrequirement (computers available). In 2007/2008 course, 79 stu-dents attended to the laboratory lessons, so at the beginning of thecourse, the school scheduled four laboratory groups: group 1, Mon-days from 12 to 14, group 2, Mondays from 15 to 17, group 3 Tues-days from 12 to 14 and group 4, Tuesdays from 15 to 17. Thestudents were requested to fill a form with their personal data andthe preferred order of assignment to laboratories. A summary of stu-dents’ preferences can be seen in Fig. 4, where the number of stu-dents which preferred group ith as jth option (priority) is shown.As can be seen in this graph, group 3 (Tuesday from 12 to 14) wasthe most preferred group as first option (24 students applied forit), and group 1 (Monday from 12 to 14) the less solicited group asfirst option. A similar trend can be seen in second, third and fourthpriorities. In general the students preferences were equally dividedinto the four possible groups.

Once we had all the forms with the students’ preferences, weassigned values of 40, 30, 20 and 10 points to the first, second, thirdand fourth preferences of the students. In this way the students’priorities fulfilled

PNg¼1Psg ¼ 100, as in the ASLGP definition given

in Section 2.We have run the proposed GGA algorithm to solve both variants

of the ASLGP (P1 and P2), and we have decided the composition ofthe groups based on the algorithm’s output. Ten runs of the algo-rithm were launched for P1 and P2. The parameters of the GGAwere: Pc ¼ 0:6, Pm varying linearly with the generations, fromPm ¼ 0:01 to Pm ¼ 0:05, and a fixed number of generations of1000. Figs. 5 and 6 show the fitness evolution (average of 10 runs)GGA for problems P1 and P2, respectively. Both cases present asimilar shape of the fitness evolution, with a good improvementof the fitness values. Note that in both cases, the process of fitnessimprovement is going flat about generation 1000, when we stopthe algorithm. Figs. 7 and 8 show the number of students in the dif-ferent groups, for problems P1 and P2 (average of the 10 GGAruns). In this case, we can see the differences between the two vari-ants of the ASLGP: if we consider problem P1 (Fig. 7), the groups’occupance varies from about 16 students in group 4 to the 25 stu-dents that the GGA consistently assigns to group 3. Recall thatgroup 3 was the first option of the majority of students, followedby group 2, 4 and 1 (see Fig. 4). It is also interesting to analyzethe percentage of students in their ith option, given in Figs. 9 and10. The algorithm is able to allocate all the students in their first

Fig. 4. Preferences of students in the real applica

or second priority options. In the case of problem P1, the GGA as-signs the 96% of the students in their first option, and the 4% in

tion of the ASLGP in Universidad de Alcalá.

Fig. 10. Evolution of the percentage of students in their ith group’s preference,problem P2.

Fig. 7. Groups occupancy evolution obtained by our GGA in the real application inUniversidad de Alcalá (P1).

Fig. 8. Groups occupancy evolution obtained by our GGA in the real application inUniversidad de Alcalá (P2).

Fig. 9. Evolution of the percentage of students in their ith group’s preference,problem P1.

7240 L.E. Agustín-Blas et al. / Expert Systems with Applications 36 (2009) 7234–7241

their second option. In the case of problem P2, the percentage ofstudents in their first option decreases until 93%, (7% in their sec-ond option). These data confirm that the performance of the GGAis extremely good in both variants of the problem considered. Fi-nally, in this specific application to the subject Digital Data Trans-mission in Universidad de Alcalá, we chose the assignment givenby the GGA to problem P2, in which over the 90% of students wereallocated in their first option, and groups with a similar number ofstudents were generated.

5. Conclusions

In this paper we have presented a grouping genetic algorithm tosolve the assignment of students to laboratory groups in universitycourses. This problem is quite common in universities after obtain-ing a timetabling of subjects. Some interesting particularities arisein this problem: first, there is a maximum capacity of students inlaboratories, due to constraints of equipment or space. Second,the problem involves preferences of students to attend a given lab-oratory, due to personal reasons, and also preferences of lecturersto have groups with similar number of students in them. A formu-lation of the problem which allows the treatment of these pointshas been considered in the paper. We propose a hybrid groupinggenetic algorithm to solve the problem. We have described themain characteristics of our proposal, and its performance in severalsimulations, where we have obtained good quality assignments interms of percentage of students in their first options of preference.A real application of the algorithm in Universidad de Alcalá, Spain,has also been discussed in the paper. As a final remark, note thatthe approach presented in this paper can be applied to differentassignment problems such as the one described in Fan, Chen,Mab, and Zhu (2009) with very few adaptations.

Acknowledgements

This work has been partially supported by Universidad de Alcaláand Comunidad de Madrid with a Grant No. CCG07-UAH/TIC-1894.E.G. Ortiz-Garcı́a and A.M. Pérez-Bellido are supported byUniversidad de Alcalá, under the University F.P.I. grants program.

References

Beligiannis, G. N., Moschopoulos, C., Kaperonis, P., & Likothanassis, S. D. (2008).Applying evolutionary computation to the school timetabling problem: TheGreek case. Computers and Operations Research, 35(4), 1265–1280.

L.E. Agustín-Blas et al. / Expert Systems with Applications 36 (2009) 7234–7241 7241

Beligiannis, G. N., Moschopoulos, C., & Likothanassis, S. D. (2007). A geneticalgorithm approach to school timetabling. Journal of the Operational ResearchSociety, 1, 1–20.

Brown, E. C., & Vroblefski, M. (2004). A grouping genetic algorithm for the microcellsectorization problem. Engineering Applications of Artificial Intelligence, 17(6),589–598.

Burke, E., Carter, M. (1998). The practice and theory of authomatic timetabling:Selected papers from the 2nd international conference, Toronto, 1997. Lecturenotes in computer science (Vol. 1408). Springer.

Burke, E., Carter, M. (2001). The practice and theory of authomatic timetabling:Selected papers from the 3rd international conference, Konstanz, 2000. Lecturenotes in computer science (Vol. 2079). Springer.

Burke, E., Carter, M. (2003). The practice and theory of authomatic timetabling:Selected papers from the 4th international conference, Gent, 2002. Lecture notesin computer science (Vol. 2740). Springer.

Burke, E., Ross, P. (1996). The practice and theory of authomatic timetabling:Selected papers from the 1st international conference, Edinburgh, 1995. Lecturenotes in computer science (Vol. 1153). Springer.

Burke, E., Jackson, K., Kingston, J., & Weare, R. F. (1997). Automated timetabling: Thestate of the art. The Computer Journal, 40(9), 565–571.

Burke, E., & Petrovic, S. (2002). Recent research directions in automated timetabling.European Journal of Operational Research, 140(2), 266–280.

Carter, M. W. (2001). In S. Gass & C. M. Harris (Eds.), Timetabling, encyclopedia ofoperations research and management science (pp. 833–836). Kluwer.

De Lit, P., Falkenauer, E., & Delchambre, A. (2000). Grouping genetic algorithms: anefficient method to solve the cell formation problem. Mathematics andComputers in Simulation, 51(3-4), 257–271.

deWerra, D. (1985). An introduction to timetabling. European Journal of OperationalResearch, 19, 151–162.

Falkenauer, E. (1992). The grouping genetic algorithm–widening the scope of theGAs. In Proceedings of the Belgian journal of operations research, statistics andcomputer science (Vol. 33, pp. 79–102).

Falkenauer, E. (1998). Genetic algorithms for grouping problems. New York: Wiley.Fan, Z. P., Chen, Y., Mab, J., & Zhu, Y. (2009). Decision support for proposal grouping:

A hybrid approach using knowledge rules and genetic algorithms. ExpertSystems with Applications, 36, 1004–1013.

Head, C., & Shaban, S. (2007). A heuristic approach to simultaneous course/studenttimetabling. Computers & Operations Research, 34, 919–933.

Hung, C., Sumichrast, Robert T., & Brown, E. C. (2003). CPGEA: A grouping geneticalgorithm for material cutting plan generation. Computers and IndustrialEngineering, 44(4), 651–672.

James, T. L., Brown, E. C., & Keeling, K. B. (2007). A hybrid grouping geneticalgorithm for the cell formation problem. Computers and Operations Research,34, 2059–2079.

James, T., Vroblefski, M., & Nottingham, Q. (2007). A hybrid grouping geneticalgorithm for the registration area planning problem. ComputerCommunications, 30(10), 2180–2190.

MirHassani, S. A. (2006). Improving paper spread in examination timetables usinginteger programming. Applied Mathematics and Computation, 179(2), 702–706.

Monfroglio, A. (1996a). Hybrid genetic algorithms for timetabling. InternationalJournal of Intelligent Systems, 11(8), 477–523.

Monfroglio, A. (1996b). Timetabling through constrained heuristic search andgenetic algorithms. Software – Practice and Experience, 26(3), 251–279.

Mooney, E., Rardin, R., & Parmenter, W. (1996). Large scale classroom scheduling. IIETransactions, 28(5), 369–378.

Petrovic, S., Yang, Y., & Dror, M. (2007). Case-based selection of initialisationheuristics for metaheuristic examination timetabling. Expert Systems withApplications, 33(3), 772–785.

Pongcharoen, P., Promtet, W., Yenradee, P., & Hicks, C. (2008). Stochasticoptimisation timetabling tool for university course scheduling. InternationalJournal of Production Economics, 112(2), 903–918.

Ramalhinho-Lourenço, H., & Serra, D. (2002). Adaptive approach heuristics for thegeneralized assignment problem. Mathware and Soft Computing, 2, 209–234.

Ross, P., Hart, E., & Corne, D. (2003). Genetic algorithms and timetabling. In A. Ghost& S. Tsutsui (Eds.), Advances in evolutionary computation, theory and applications(pp. 755–771). Springer.

Santiago-Mozos, R., Salcedo-Sanz, S., dePrado-Cumplido, M., & Bousoño-Calzón, C.(2005). A two-phase heuristic evolutionary algorithm for personalizing coursetimetables: A case study in a Spanish university. Computers and OperationsResearch, 32, 1761–1776.

Schaerf, A. (1999). A survey of automated timetabling. Artificial Intelligence Review,13, 87–127.

Stamatopoulos, P., Viglas, E., & Karaboyas, S. (1998). Nearly optimum timetableconstruction through CLP and intelligent search. International Journal onArtificial Intelligence Tools, 7(4), 415–442.