SciELO - Scientific Electronic Library Online

 
vol.24 número1A Method for Expressing Integrity Constraints in Database Conceptual ModelingMejora eficiente de la luminosidad en imágenes del cerebro humano utilizando redes neuronales pulso-acopladas índice de autoresíndice de materiabúsqueda de artículos
Home Pagelista alfabética de revistas  

Servicios Personalizados

Revista

Articulo

Indicadores

Links relacionados

  • No hay artículos similaresSimilares en SciELO

Compartir


Computación y Sistemas

versión On-line ISSN 2007-9737versión impresa ISSN 1405-5546

Comp. y Sist. vol.24 no.1 Ciudad de México ene./mar. 2020  Epub 27-Sep-2021

https://doi.org/10.13053/cys-24-1-3191 

Articles

An Integer Linear Programming Model for a Case Study in Classroom Assignment Problem

Luis Eduardo Urbán Rivero1  * 

Maite Regina Benítez Escárcega2 

Jonas Velasco1 

1 Centro de Investigación en Matemáticas, (CIMAT A.C.), Aguascalientes, México. luis.urban@cimat.mx, jvelasco@cimat.mx

2 Universidad Autónoma de Querétaro, Facultad de Ingeniería, México. maitereginabenitez@gmail.com


Abstract

The management of human and physical resources of a university is a complex additive activity because in many cases the number of variables to be considered are many, which produces errors of the decision maker. Deciding in which classrooms the courses should be taught seems a simple task but in reality, it is complicated by a large number of courses that occur during a period in the university, the availability of personnel and the limited physical infrastructure. In this paper, we propose an integer programming model that avoids the problems of overlapping courses, besides ensuring that courses can be given in the appropriate classrooms. The model shown here was used for the planning of the 2019 courses at the Faculty of Engineering of the Autonomous University of Queretaro. An improvement in the planning time was obtained, which went from approximately 20 days manually to only a half hour as mentioned by the authorities of the University. The decision maker reports that even with the last minute changes the whole process takes no more than two days.

Keywords: Timetabling; ILP; MAP; assignment

1 Introduction

One of the main problems in university management is successful management of limited physical or human resources. Physical resources are the spaces designated to university activities. We focus on the main activity of a university which is the taught of undergraduate and postgraduate courses.

For this purpose are needed classrooms, laboratories, workshops, medical and art spaces to teach the classes. The management of human and physical resources for the above purpose is named as Timetabling or Multidimensional Assignment Problem (MAP), depending on whether we refer to the application or the theoretical problem respectively. The MAP has had an extensive study over the years. In [13] a compilation of some MAP results is shown. The decision problem associated with the MAP is NP-Complete, even with three assignment levels [8].

Due to the complexity of the problem, over the years, heuristics and metaheuristics have been developed both to solve the MAP and concrete application cases associated with timetabling. In the case of the timetabling applications that are of interest in this work, there is the additional difficulty of modeling the specific operating conditions of each case, that is, although, in essence, a timetabling problem is a MAP with other constraints. These constraints are the consequence of the specific operation of each school.

The timetabling problem can be viewed as two problems: Professor Assignment Problem (PAP) and Classroom Assignment Problem (CAP). In the first one, the objective is to satisfy the course requirements in an academic institution depending on the availability of academic staff.

In CAP we assume that each course has a professor and the objective is to find the most appropriate assignment of classroom depends on the availability of physical resources (classroom) which courses are taught. In this paper we deal with the CAP.

In [3,4,9,7] both solution methods and models for timetabling are shown. In the case of solution techniques, they focus on constraint satisfaction. In our case, we deal with constraint satisfaction or constraint programming (CP) as it allows us to model the problem with decision variables and restrictions. The reason why CP is used to model and solve timetabling problems is that there is no objective function to optimize and there is only a set of constraints to satisfy, and these restrictions are divided into two types [3]:

  • — Hard: Those related to the availability of resources, such as lecturers, professors or classrooms in a period.

  • — Soft: Those related to situations that would be desirable in an assignment such as the preference of schedule or course by academic staff, preference of classrooms for certain types of courses, academic performance of a member of academic staff for a specific course.

In [2] the timetabling is presented as a candidate problem to be solved by CP due to its unique characteristics, but no model associated with the problem in question has shown. In the same article, authors say that the model is a simplified case and that it does not reflect a real situation. However, the main idea in that work is how the limitations in infrastructure and personnel resources should be model.

Also in [12] it is mentioned that the problem can be seen as a matching problem in multi-party graphs in which case they solve the problem in each sub-level (each bipartition of the graph) as a classic linear assignment problem by the Hungarian method [10] although this does not ensure the optimality [8]. Additionally, in [12] some models are presented where they contemplate the preferences of the students and the availability of teachers as well as a cost function that varies from the needs of each institution. In [12] Shafer et al. propose the following possibilities.

  • — Academic cost: related to the preferences of students and teachers or with an evaluation of the performance of a professor for a specific course.

  • — Organizational costs: related to minimizing the difference between the availability of resources and real demand.

  • — Staff cost: related to the availability of academic personnel.

In our case, we consider the organizational costs since we have to deal with the availability of classrooms with enough space for the students enrolled in the courses.

On the other hand, for specific applications, in [5,6] shows an ILP model for two application cases in Greek universities. In those jobs, the hard constraints have become into constraints of the integer program, and soft constraints are part of the objective function. In both cases are considered six levels of assignment which are group, course, teacher, classroom, period and day. The objective function in both cases has academic and organizational purposes, in other words, the course would be assigned to the most qualified professor and that the classroom assigned to a course is the most appropriate under the University criteria.

In [1] another model for a Turkish University is presented. In this case, it is intended to satisfy the needs of the student in terms of covering the credits of their curriculum in the time specified by the university. The students have a teacher assigned with which they like to take some class, and at the same time, the teacher is trying to assign the course that he chose.

In the case of Mexico in [13] a case of an application associated with the Metropolitan Autonomous University Azcapotzalco at the Department of Basic Sciences and Engineering is shown. In that case, Perez proposed a model of three extended assignment levels. He collapses two or more assignment levels, and the size of each partition increase, it is solved by local search algorithms and a memetic algorithm proposed in [14,11].

The ILP model in this work is a novel one because we considering sessions with different length, in different periods for each day, for each course. In [6,5,1] they consider that all classrooms have the same capacity. We introduce the concept of capacity coefficient in order to assign the best possible classroom option for each course (related with capacity). In [6], they consider multi-period sessions, but they considered this situation as a soft constraint. In our case, we considering multi-period sessions as a hard constraint.

In all the above cases the size of the instances are small or medium because in [6] they considering 72 courses and 18 classrooms, 13 periods, and five days.

On the other hand, the ILP model of [1] tries to minimize the professors and students dissatisfaction and solves an instance with 50 courses, eight classrooms 12 periods, and five days. In [13] consider an instance with 3123 courses, ten periods, and five days but not consider the classroom, only the course requirement in each academic department. In the same work, Pérez-Pérez solves UAM instance by the department with no more than 377 courses by department.

In all above cases they purposes an ILP model and solves with a commercial MILP solver as Gurobi, CPLEX, or LINGO. FI-UAQ instance has 757 courses, 50 classrooms of different capacity, 30 periods, and five days.

In the specific case of the Faculty of Engineering of the Autonomous University of Queretaro (FI-UAQ) we considering the following specific conditions for our model:

  • — University assigned the student load to the entire group without inference from the students.

  • — The university gives the professor-course-schedule assignment in a previous stage.

  • — The courses have lengths between 1 hr and 4 hr with periods of 1/2 hr.

  • — The courses are taught from Monday to Friday from 7:00 a.m. to 10:00 p.m (30 periods of 1/2 hr).

  • — If a course has a schedule on a specific day, the same course cannot be assigned to a different time on the same day. For example, if a course has a schedule on Monday from 7:00 to 9:00, the same course can not have another schedule on the same Monday.

  • — The classrooms may have different capacities.

  • — Each course is associated with a group, and the capacity of the course is the capacity of the group.

2 Methodology

Now we model the specific conditions associated with the different duration of the sessions of the courses and the different capacities of the available classrooms. In our case the problem will be modeled as a MAP with five levels of assignment (group (g), course (c), room (s), period (t), day (k) ).

To build the model, we use the following definitions:

Def 1 A Basic Time Unit (BTU) is a set of 30 continuous minutes.

Def 2 A block is a set of at least one contiguous BTUs.

Def 3 A course consists of one or more blocks in one or more days. To refer to the blocks that form a course c in a day k we denote it as B(c, k).

Def 4 A group is a set of courses. To refer to the courses of a group g we write it as C(g). The set of all groups is G.

Def 5 The capacity of a group is the maximum number of students who can be enrolled in a group and is written as |g|. The capacity of a course is the capacity of the associated group.

Def 6 The capacity of a classroom is the maximum number of students who can be allowed in the classroom, and it is written as |s|.

Def 7 An overlapping set consists of courses that generate overlap in a classroom s during an BTU t and it is denoted as OS(s,t).

Now to model the availability of classrooms we considering the following conditions.

  • — A classroom can be used by at most one course in a BTU t on a specific day k.

  • — A BTU of a block of a course should be taught in one of the available classrooms.

  • — If taught a BTU of a block of a specific course into a specific classroom, the entire block must be taught in the same classroom.

2.1 ILP Model

To build the integer linear programming (ILP) model, we define the following decision variables and constraints:

xg,c,st,k=1if a classroom s is assigned to a course cof group g during the BTU t on day k.0Otherwise

yg,cs,k=1if a classroom s is assigned to a course cof group g on day k.0Otherwise

sSxg,c,st,k=1,gG,cCg,tBTUBc,k,k1,,5, (1)

cOSs,txg,c,st,k1,gGOSs,t,sS, tBTUBc,k, k1,,5, (2)

tBTUBc,kxg,c,st,k=Bc,kyg,cs,k,gG,cCg, k1,,5, (3)

sSyg,cs,k=1,gG,cCg,k1,,5. (4)

In constraint (1) every BTU of a block of each course must be assigned to a classroom. Constraint (2) ensures that a classroom can be assigned at most to one course during a specific BTU. In constraints (3, 4) if a classroom is assigned to a course all block of the course must be taught in the same classroom.

Constraints (1, 3) are redundant because the constraint (1) is implicit in (3) due to if in last one each BTU of a block must be assigned to a classroom. Now it is possible remove constraint (1) from the model.

Additionally, if we assign a block to a classroom on a specific day, then the course must be assigned in the same room all week, in equation 5 we can observe this situation:

yg,cs,k=yg,cs,k',gG,cCg,sS,k,k'1,,5|k<k'. (5)

The objective function minimizes the cost of the assignment, in our case this cost it is organizational, in other words, we try to assign a classroom to a specific course if the classroom has enough space for the students of course as described below:

z=gGcCgsSk1,,5μg,syg,cs,k,

where μg,s=gs . Now the model considered for solving the real instance of FI-UAQ is viewed in equations (6-7):

minz, (6)

Subject to: (2-5). (7)

3 Results

In this section, we show an illustrative example to visualize the structure of the input and output of an instance of our problem.

In Tables 1 and 3 we show a small example of the input for the model. Table 1 contains the schedule of all courses in the planning and the capacity of each group and Table 3 contains the capacity of each available classroom. To solve the ILP model we use Gurobi and its python interface.

Table 1 Instance: courses 

Group Capacity Course Monday Tuesday Wednesday Thursday Friday
0 20 c0 11:00-
13:00
13:00-
15:00
0 20 c1 13:00-
15:00
11:00-
13:00
14:00-
15:00
0 20 c2 17:00-
19:00
18:00-
20:00
0 20 c3 19:00-
20:00
15:30-
18:00
18:30-
20:00
0 20 c4 15:00-
17:00
18:00-
19:00
16:00-
18:00
0 20 c5 13:00-
15:00
17:30-
18:30
13:00-
15:00
1 30 c6 17:00-
20:00
1 30 c7 18:00-
20:00
14:00-
16:00
1 30 c8 10:30-
13:00
10:30-
13:00
1 30 c9 10:00-
12:00
10:00-
12:00
12:00-
13:00

Table 3 Instance: classrooms 

Classroom Capacity
s1 20
s2 20
s3 30

The solution of the example is in Fig. 1, Fig. 2 and Table 2. In Fig 1 we represent the use of all classrooms all day for each day of the week, in Fig 2 we represent the use of a specific classroom during the week and in Table 2 it can see the values of μ(c,g).

Fig. 1 Classroom use during the week 

Fig. 2 Use of classroom s2 

Table 2 Classroom assignment 

Course Classroom μ(g, s)
c0 s1 1
c1 s1 1
c2 s1 1
c3 s2 2/3
c4 s2 2/3
c5 s2 2/3
c6 s2 1
c7 s2 1
c8 s2 1
c9 s2 1

FI-UAQ instance consists of 757 courses and 50 classrooms with different capacity. This instance input and results are in complementary material.

All instances solved in a server with 24 Gb of ram and six processors INTEL XEON of 2.8 GHz each one.

We solved FI-UAQ instance with optimality in 403.92 seconds; therefore, it is not necessary the use of heuristic methods.

The main advantages obtained with the ILP model were:

  • — The speed in generating a proposal for the decision maker.

  • — It provides an outlook for the decision maker to make last minute adjustments.

  • — A planning that occupies less than the available classrooms, which allows in terms of infrastructure to increase the enrollment in the university.

4 Conclusions and Future Work

At the FI-UAQ the assignment of classrooms to the courses was done manually until the year 2018. The assignment process took about one month and was susceptible to errors that had to be corrected once the classes started.

This work makes it possible to obtain an assignment proposal in a few minutes. The decision maker only needs a couple of days to make adjustments to the initial assignment.

As future work, we considering the proximity of classrooms to minimize the classroom changes for a group during each day.

References

1. Bakir, M. A. & Aksop, C. (2008). A 0-1 integer programming approach to a university timetabling problem. Hacettepe Journal of Mathematics and Statistics, Vol. 37, No. 1, pp. 41-55. [ Links ]

2. Brailsford, S. C., Potts, C. N., & Smith, B. M. (1999). Constraint satisfaction problems: Algorithms and applications. European journal of operational research, Vol. 119, No. 3, pp. 557-581. [ Links ]

3. Burke, E. K. & Petrovic, S. (2002). Recent research directions in automated timetabling. European journal of operational research , Vol. 140, No. 2, pp. 266-280. [ Links ]

4. Carter, M. W. & Laporte, G. (1997). Recent developments in practical course timetabling. international conference on the practice and theory of automated timetabling, Springer, pp. 3-19. [ Links ]

5. Daskalaki, S. & Birbas, T. (2005). Efficient solutions for a university timetabling problem through integer programming. European journal of operational research , Vol. 160, No. 1, pp. 106-120. [ Links ]

6. Daskalaki, S., Birbas, T., & Housos, E. (2004). An integer programming formulation for a case study in university timetabling. European journal of operational research , Vol. 153, No. 1, pp. 117-135. [ Links ]

7. de Werra, D. (1985). An introduction to timetabling. European journal of operational research , Vol. 19, No. 2, pp. 151-162. [ Links ]

8. Karp, R. M. (1972). Reducibility among combinatorial problems. In Miller, R. E., Thatcher, J. W., & Bohlinger, J. D., editors, Complexity of Computer Computations. Springer US, Boston, MA, pp. 85-103. [ Links ]

9. Lewis, R. (2008). A survey of metaheuristic-based techniques for university timetabling problems. OR spectrum, Vol. 30, No. 1, pp. 167-190. [ Links ]

10. Munkres, J. (1957). Algorithms for the assignment and transportation problems. Journal of the Society for Industrial and Applied Mathematics, Vol. 5, No. 1, pp. 32-38. [ Links ]

11. Pérez Pérez, S. L., Valencia, C. E., & Martínez Zaragoza, F. J. (2018). A new local search heuristic for the multidimensional assignment problem. In NEO 2016. Springer, pp. 183-202. [ Links ]

12. Pérez Pérez, S. L. (2017). Personnel assignment problems through the multidimensional assignment problem. Ph.D. thesis, Universidad Autónoma Metropolitana. [ Links ]

13. Schaerf, A. (1999). A survey of automated timetabling. Artificial intelligence review, Vol. 13, No. 2, pp. 87-127. [ Links ]

14. Valencia, C. E., Martínez, F. J. Z., & Perez, S. L. P. (2017). A simple but effective memetic algorithm for the multidimensional assignment problem. 2017 14th International Conference on Electrical Engineering, Computing Science and Automatic Control (CCE), pp. 1-6. [ Links ]

Received: May 08, 2019; Accepted: September 03, 2019

* Corresponding author is Luis Eduardo Urban Rivero. luis.urban@cimat.mx

Creative Commons License This is an open-access article distributed under the terms of the Creative Commons Attribution License