1,846
Views
0
CrossRef citations to date
0
Altmetric
Research Article

Dormitory Assignment Using a Genetic Algorithm

& ORCID Icon
Pages 2276-2297 | Received 09 Feb 2021, Accepted 20 Oct 2021, Published online: 08 Jan 2022

ABSTRACT

This study proposes a genetic algorithm based algorithm for assigning freshmen’s dormitory rooms according to five living habits and preferences. In the proposed genetic algorithm, we used a locally exhaustive crossover method to avoid divergence results, and then got better fitness values for this dormitory assignment problem. In addition, we used a half-half selection strategy to reduce the time consumption during the iteration procedure. Experimental results have shown that the proposed algorithm could have acceptable performances with reasonable computational time. In addition, two counterpart methods were used to evaluate the performance of the proposed algorithm: a simulated annealing method and a random assignment method. The comparative results have also shown that 1) the execution time of the proposed algorithm was significantly less that of the simulated annealing method; 2) the fitness value of the proposed algorithm was significantly less than that of the random assignment method; 3) the fitness value of the proposed algorithm is almost the same as that of the simulated annealing method; 4) the proposed algorithm is stable to repeated executions; 5) the proposed algorithm is still suitable even when the capacities (beds) of rooms are different.

Introduction

Dormitory assignment is one of important issues in school administration. Each year when freshmen come to universities, schools’ dormitory management staffs need to arrange dormitory rooms for the freshmen. Traditional dormitory assignment methods might specify dormitory rooms by a random method or simply by students’ identification numbers. The traditional methods do not consider students’ living habits and preferences such that some students might request to change their rooms due to the diversities of the habits and preferences between them and their roommates. Based on (Chang Citation2019), this study proposes a more intelligent method to assign students’ dormitory rooms with the consideration of students’ habits and preferences.

How to match students’ habits and preferences is originally a stable marriage problem (SMP), and was first proposed by Gale and Shapley in 1962 (Gale and Shapley Citation1962). It is basically a matching problem to find optimal matching between men and women according to preference lists of opposite gender. Mathematically, the SMP can be formulized as follows (Iwama and Miyazaki Citation2008). Consider an instant set of I consisting of n men and n women. If a man m prefers woman 1 (denoted as w1) to woman 2 (denoted as w2), we use notation w1 >mw2 to express the about preference order in m’s preference list of women. Similarly, m1 >wm2 expresses the preference order that a women w prefers men 1 (m1) to man 2 (m2) in her preference list of men. A match set M of I is a set that consists of a series of disjoint man-woman matching pairs of I. Consider a man m and a woman w forming a matching pair. We use notations M(m) = w and M(w) = m to indicate this matching pair of w and m. A block pair for M is formed for m and w, if the following three conditions are met (Iwama and Miyazaki Citation2008).

  1. M(m) ≠ w;

  2. w>mMm;

  3. m>wM(w) .

M is unstable if there is a block pair for M, otherwise, M is stable. A SMP is to find stable matching for I. Besides, Gale and Shapley have also proposed an algorithm, called the Gale-Shapley Algorithm, to find a stable matching of I with time O(n2) (Gale and Shapley Citation1962).

Essentially, a SMP is an optimization problem with respect to four kinds of matching criteria (Le Hong, Hoang Huu, and Chung Citation2016). Consider a man m and a woman w in I. mr(m, w) is the rank of w in m’s preference list, and wr(w, m) is the rank of m in w’s preference list. The cost functions for the SMP are defined as follows (Le Hong, Hoang Huu, and Chung Citation2016).

Costman=m,wMmrm,w
Costwoman=m,wMwrw,m

where M is the set of matching pairs of men and women in I.

The optimization problems are based on four kinds of matching criteria as follows (Le Hong, Hoang Huu, and Chung Citation2016).

  • Man-optimal, which minimizes Costman

  • Woman-optimal, which minimizes Costwoman.

  • Egalitarian, which minimizes Costman+Costwoman

  • Sex-equal, which minimizes CostmanCostwoman

Originally inspired by the Darwin’s Theory of Evolution, Genetic algorithms (GAs) are one of well-known artificial intelligence methods to get solutions, where genes and chromosomes are the fundamental elements to perform GA computing. Similar to the Darwin’s Theory of Evolution, a chromosome is constructed by a sequence of genes. A fitness function is used to evaluate the performance of a GA according to its chromosomes. Basically, GA computing follows an evolutionally iterative process to find solutions within acceptable computational time. There are three basic operations in GAs: crossover, selection, and mutation. Crossover methods recombine the genes from the chromosomes of parent generations, and thus to rebuild new possible chromosomes for child generations. The common crossover methods include one-point, two-point, and uniform crossovers. Selection methods are utilized to choose better chromosomes from a pool of parent generations in order to produce possible child generations. Two popular selection methods are employed in GAs: roulette-wheel and tournament selections. A mutation operation randomly changes the values of genes under a certain probability which is called a mutation rate. The criteria for the SMP might be case by case with variant types of models, and the searching space for these problems might be huge. Thus, to simplify the computational complexity, this study proposes a GA to assign dormitory rooms for freshmen according to five living habits and preferences. In the proposed GA, we used a locally exhaustive crossover method to avoid divergence results, and then got better fitness values for this dormitory assignment problem. In addition, we also used a half-half selection strategy when performing a roulette-wheel selection, in order to reduce the time consumption during the GA’ iteration procedure. This study also conducted experiments to validate the performance of the proposed algorithm, where the data were collected from 691 freshmen at a national university in southern Taiwan.

Related Work

A general survey about the SMP has been presented by (Iwama and Miyazaki Citation2008). In this survey, a basic type of SMP has been defined mathematically together with different variants. These variants included incomplete preference list, preference list with ties, incomplete list with ties, one-sided preference list, stable roommate problem, hospitals/residents problem, man-exchanging stable marriage, many-to-many stable marriage, student-project allocation problem, and 3-dimensional stable matching problem (Iwama and Miyazaki Citation2008). Ren et al. (Citation2021) have generally discussed the nature of matching problems, and have classified these matching problems into two categories: explicit matching and implicit matching. The explicit matching included three models: one-to-one, many-to-one, and many-to-many (Ren et al. Citation2021); on the other hand, the implicit matching consisted of retrieve matching, user-item matching, entity-relation matching, and image matching (Ren et al. Citation2021). To solve a tie and bounded preference list problem for SMP, Trang et al. (Citation2019) have proposed an algorithm to get a maximum cardinality weakly stable matching. The algorithm proposed by Trang et al. began with a random selection of matching pairs, and then found out the most and the least constrained variables to delete blocking pairs by an iterative procedure.

The SMP is one of the important topics in the area of operation research. Many real-world problems related to the SMP have been solved in different areas such as computer science, healthcare, education, and management, etc. For example, in computer networks, the problem of choosing suitable switches and hosts is essentially a matching problem and was solved by (Alimudin, Winarno, and Ishida Citation2019). In wireless communications, the matching of device-to-device (D2D) communication is similar to the SMP (Xiao et al. Citation2016). Socially aware D2D communication can transfer the social relationship among user devices to useful information in order to select a suitable physical D2D communication system (Xiao et al. Citation2016). Therefore a framework has been presented to analyze the socially aware D2D communication, as a belief-based stable marriage game, in order to solve a spectrum sharing problem (Xiao et al. Citation2016). In computer vision, Madi, Paquet, and Kheddouci (Citation2019) decomposed a 3-D object into a set of sub-structures, and proposed a SMP-based algorithm to solve 3-D object recognition and classification problems.

In healthcare systems, how to determine the best matching between patients and physicians is one of the important issues. Chen, Chen, and Yang (Citation2020) have proposed a framework to reduce patients’ waiting time and to improve the matching effectiveness. In this framework, a discrete deferred acceptance scheme with the consideration of issuance types has been utilized to reduce the waiting time and regrets, instead of using a traditional continuous deferred acceptance scheme. Experimental results have shown that the framework proposed by Chen et al. could reduce the waiting time of finding suitable physicians for patients. Team-matching problems, a variant of the SMP, have been widely utilized in many areas such as education, management, government administration, etc. Meulbroek et al. (Citation2019) have applied the Gale-Shapley Algorithm and a web-based team management tool called CATME to build student teams in order to choose the students’ favorite projects according to their preference lists. Experimental results have shown that with the algorithm proposed by Meulbroek et al. 93.84% of students could select top three favorite projects according to their preference lists (Meulbroek et al. Citation2019). For developing countries such as Bangladesh, people might have special needs (e.g., location, rent, house space, etc.) to select their rented houses. Therefore, Bristi, Chowdhury, and Sharmin (Citation2019) have proposed a framework for tenants to select their house owners based on the Gale-Shapley Algorithm. Experimental results have also shown that with the framework proposed by Bristi et al., tenants and house owners received high satisfactory about the tenant-owner matching results (Bristi, Chowdhury, and Sharmin Citation2019).

The dormitory room assignment problem is furthermore considered as a stable-roommates problem (Gale and Shapley Citation1962; Irving Citation1985; Pittel and Irving Citation1994), trying to find best matching pairs under certain criteria. In such a problem, if the number of persons being matched increases, the probability of finding feasible solutions decreases (Pittel and Irving Citation1994). The stable-roommates problem can be further extended to crew matching problem (Katarı́na and Ferková Citation2004) and kidney exchange problem (Roth, Sönmez, and Ünver Citation2005). Irving (Citation1985) has presented an algorithm to efficiently examine the stable-matching problem. Practically, in stable-roommates problems, if the numbers of rooms and persons are large, the searching space is huge. Moreover, some studies have presented mathematics-based methods to solve the stable-roommates problems using theorems and proofs (Abraham, Biró, and Manlove Citation2005; Biró, Iñarra, and Molis Citation2016; Irving and Manlove Citation2002; Tan Citation1990). These mathematical methods might require huge searching spaces to solve the problems. To reduce searching spaces, some studies used soft computing methods in order to find sub-optimal solutions with acceptable computational time. These soft computing methods include simulated annealing algorithms, fuzzy systems, and evolutionary algorithms.

Some early studies used GAs to solve the SMP (Nakamura et al. Citation1995; Vien and Chung Citation2006). For, example, in the work by Nakamura et al., a sex-equal SMP has been solved where a lattice structure had been built according to the preference lists of men and women. The lattice structure was then transferred to a directed graphic to indicate the transitions on the lattice structure. A node in the directed graphic indicated a bit in a chromosome string. In the work by Vien and Chung, four criteria have been presented to evaluate matching performance: man-optimal, women-optimal, egalitarian, and sex-equal (Vien and Chung Citation2006); the chromosome structure of their work simply used arrays to indicate the preference lists for men and women. They have also presented a crossover method for two parent chromosomes. This crossover method followed three steps: (1) making a copy of the first parent; (2) selecting an arbitrary part from the second parent; (3) making minimum changes to fit the selected part (Vien and Chung Citation2006).

Recently, Albalawi and Maashi (Citation2021) have proposed a GA-based framework to select and optimize a software development life cycle (SDLC) where two parts were utilized: a selection mechanism and an optimization process. In the selection mechanism, a selection matrix was established to indicate the relationship between project parameters (e.g., clarity of requirements, project size, complexity, etc.) and software development techniques (e.g., waterfall, agile, spiral, etc.). In the optimization process, a GA was applied to find the best SDLC where a chromosome represented a SDLC, and each gene in this chromosome indicated a single phase of this SDLC. A multi-points crossover was then employed to make reproductions. Experimental results have shown that the framework proposed by Albalawi and Maashi could reduce the completion time for different SDLC models (Albalawi and Maashi Citation2021). Zayed and Maashi (Citation2021) have proposed a hybrid framework to optimize software testing where two stages were conducted: a maximum process and a minimization process. In the maximization process, a GA was used to maximize test coverage; in the minimization process, a greedy algorithm was utilized to minimize the size of test suite. In the GA proposed by Zayed and Maashi, a chromosome represented a testing case, and a gene in this chromosome indicated a statement. A single-point crossover was then conducted to make reproductions. Zayed and Maashi argued that their framework could solve real-world testing problems and consequently satisfy the software requirements of high reliability, security, and safety (Zayed and Maashi Citation2021).

Based on students’ habits and preferences, Settanni (Citation2000) has proposed a method to solve a dormitory room assignment problem using a simulated annealing algorithm. Moreover, Trung and Anh (Citation2009) have proposed three modified simulated annealing algorithms for dormitory room assignment problems: informed simulated annealing (ISA), simulated annealing with non-monotonic reheating (SA_REHEAT), and very fast simulated re-annealing (VFSA). In the work by Trung and Anh, two kinds of conditions were employed: hard conditions (e.g., gender, room capacity, students’ special needs, etc.) and soft conditions (e.g., types of rooms, bed locations, floor number, learning habits, music and game preferences, etc.). Trung and Anh have further indicated that ISA had a shortest computational time but its performance was worse; SA_REHEAT had a best performance with acceptable time; VFSA had unstable computation time to get acceptable results. In simulated annealing algorithms, how to design annealing strategies is an important issue. It might try different parameters to tune performance via a lot of experiments.

Yu and Sun (Citation2016) have presented a fuzzy clustering method to solve a dormitory room assignment problem, which considered students’ accommodation preferences. In this fuzzy clustering method, the dataset was the students with their accommodation preferences, and the number of cluster centers was equal to the number of rooms. Yu and Sun (Citation2016) also conducted a simulation to validate their algorithm, where eight students were assigned to two rooms, and three accommodation preferences were considered: hygiene, bedtime, and sports habits.

Wang, Li, and Ma (Citation2009) formulated the dormitory room assignment problem as a resource allocation problem, and utilized a backtracking algorithm to solve the problem. In this backtracking algorithm, students’ preferences were considered as required conditions, and rooms as resources. The backtracking algorithm was a tree-structured architecture with nodes and branches. When preforming searching, a node in a searching path tried to find any possible child nodes for acceptable solutions. If it was impossible to fine any suitable child nodes for a particular node, the searching path went back to a previous node of this particular node. The searching space for this backtracking algorithm might be huge, when the numbers of students and rooms increase. This might result in long computational time to find the solutions.

Eslami and Afzali (Citation2007) have presented a GA-based approach to solve a dormitory room assignment problem, which assigned rooms according to students’ nationalities, religions, and course schedules. In the work by Eslami and Afzali, an experiment was conducted where 10 students were assigned to five rooms. The comparative table between the experiment in (Eslami and Afzali Citation2007) and our experiment is demonstrated in .

Table 1. The comparative table between the experiment in (Eslami and Afzali Citation2007) and our experiment

Experiment Design

Questionnaire

The participating students were 691 freshmen who entered a national university in southern Taiwan in the autumn semester of 2017. This study conducted an online survey for these freshmen. In the survey the freshmen were asked to answer five living habits and preferences with a one-to-one correspondence. Each question had three answers; the freshmen selected only one of the three answers for each question. In addition, the students were asked to give a degree of importance for each question, which was an integer between 1 and 10 (1 = least important; 10 = most important). The questions and their associated answers are demonstrated as follows:

  • (1) Do you prefer to live with the roommates from the same department as yours?

  • Answer 1: I only want to live with the roommates from the same department as mine.

  • Answer 2: I prefer to live with the roommates from the same department as mine. If it is impossible, I can accept living with the roommates from a different department.

  • Answer 3: I don’t care whether or not my roommates are from the same department as mine.

  • (2) Do you prefer living with the roommates who will keep your room clean?

  • Answer 1: I often clean my room, and hope that my roommates can do the same thing as I do.

  • Answer 2: I occasionally clean my room, and hope that my roommates can do the same thing as I do.

  • Answer 3: I don’t care whether or not my room is often cleaned. I only hope that my room can be kept in a basic cleanness situation.

  • (3) The interaction with my roommates

  • Answer 1: I have an extroversion character, and I want my roommates can interact with me with a hustle and bustle way.

  • Answer 2: I have an introversion character, and I want my roommates can interact with me with a quiet way.

  • Answer 3: I don’t care whether my roommates interact with me in a hustle and bustle way, or in a quiet way.

  • (4) The preference of using an air-conditioning system (cooling system)

Answer 1: I often use an air-conditioning system, and hope that my roommates can do the same thing as I do.

Answer 2: I don’t often use an air-conditioning system, and hope that my roommates can do the same thing as I do.

Answer 3: I don’t care whether the air-conditioning is often used or not.

  • (5) My sleeping habit

Answer 1: I usually go to bed before 11 p.m.

Answer 2: I usually go to bed between 11 p.m. and 1 a.m.

Answer 3: I usually go to bed after 1 a.m.

  • (6) Preference of roommates’ sleeping habit

Answer 1: I hope my roommates can sleep before 11 p.m.

Answer 2: I hope my roommates can sleep between 11 p.m. and 1 a.m.

Answer 3: I hope my roommates can sleep lately, or I don’t care the time my roommates go to bed.

GA Design

shows the flowchart of the GA computing used in this study. The encoding structures of genes and chromosomes are shown in . In , a single room is considered as a single chromosome. Each student in a room is considered as a gene encoded with his or her living habits and preferences. The encoded data are then fed into a fitness function to calculate fitness values. It is important to note that the size of a room (i.e., how many beds in a room) is equal to the student capacity of a room since a student just owns a bed in his or her room.

Figure 1. The flowchart of the GA computing.

Figure 1. The flowchart of the GA computing.

Figure 2. The encoding and structures of genes and chromosomes.

Figure 2. The encoding and structures of genes and chromosomes.

Crossover Method

In our real-world experiments, the rooms possibly had some unavailable beds. The sizes of chromosomes (i.e., beds of rooms) might be different. Therefore, we could not use traditional crossover methods (e.g., single-point crossover, two-point crossover, etc.) to perform the crossover operations during our experiments. We then used a special crossover method which randomly exchanged two students in two chosen rooms. The results of using this special crossover method led to unstable divergent results (i.e., the fitness values became worse and worse during the iteration process). We therefore used a locally exhaustive crossover method to solve this problem. In this method, for two parent chromosomes (rooms), we tried any possible combinations of genes for the two rooms, and found the best crossover result from all of the possible combinations of genes. Theoretically, the time complexity of the locally exhaustive crossover will be acceptable, if the sizes of two rooms are small. In this study, in most cases, the size of room was 4 (i.e., 4 beds in a room). The time consumption of using the locally exhaustive crossover method in our experiments was acceptable. We then claim that the locally exhaustive crossover method is suitable for this study.

To perform a crossover operation, two rooms from the parent chromosome pool are randomly selected as a crossover pair. We find exhaustively the best exchanging combination over all possible crossover pairs from the parent chromosome pool. The pseudo code for the crossover operation is shown in . In this figure, lines 1 to 3 perform the initialization of parameters; lines 4 and 5 do a two-dimensional for looping operation; line 6 exchanges two students in Ri and Rj; line 7 recalculates the new fitness values for Ri and Rj after the exchanging done by line 6; lines 8 to 12 find the best fitness value, best Ri, and best Rj in the two-dimensional looping operation; lines 13 and 14 end the two-dimensional looping operation. After the crossover operation Ri and Rj are the best chromosomes among all possible crossover pairs.

Figure 3. The pseudo code for the crossover operation.

Figure 3. The pseudo code for the crossover operation.

Selection Method

At the beginning, we put all chromosomes (rooms) into the selection pool (i.e., the pool storing all parent chromosomes), and performed the locally exhaustive crossover method. The time consumption was huge. To reduce the computational time, we then used a half-half strategy when performing roulette-wheel selections. In this strategy, we first selected 50% of the chromosomes out of the entire selection pool using a roulette-wheel selection. These chosen chromosomes were reserved as seed chromosomes which would be automatically selected for the next iteration. The rest of chromosomes in the selection pool then performed the locally exhaustive crossover method to generate their offspring chromosomes for the next iteration. After using the half-half strategy, the computational time significantly decreased, and the performance (fitness values) was almost the same as the one which used the entire selection pool.

The selection method is demonstrated in . In this figure, the parent chromosome pool consists of all rooms. The child chromosome pool is established by two sets (Set A and Set B). The following steps are the procedure of performing the selection method:

Step 1: Forming Set A: use roulette-wheel selection operations to select half of the rooms from the parent chromosome pool.

Step 2: Forming Set B: perform crossover operations for the rest chromosomes in the parent chromosome pool.

Figure 4. The selection method.

Figure 4. The selection method.

Sets A and B form the child chromosome pool for the next generation.

Mutation Method

The following steps are the procedure of performing the mutation method:

Step 1: Randomly select two rooms (chromosomes).

Step 2: Randomly choose two students from the two chosen rooms, respectively.

Step 3: The two chosen students exchange each other.

shows an example of a mutation operation. In this figure, suppose that R002 and R023 are the two rooms randomly chosen for the mutation (Step 1). S210 and S049 are the two students randomly chosen from R002 and R023, respectively (Step 2). During mutation, S210 and S049 exchange each other (Step 3). After mutation, S049 is in R002, and S210 is in R023. In , the gray markers denote the changes before and after the mutation operation. In this study, the mutation rate is set to 0.002.

Figure 5. The mutation method.

Figure 5. The mutation method.

Termination Strategy

The maximum number of iterations is 500, i.e., the GA stops the procedure after 500 generations.

Fitness and Objective Functions

Consider a room set R ={s1, s2,  ,sNs} where Ns is the number of students in this room. Let Q=i1, i2, , i5 be a question set (the questionnaire) consisting of five items (questions) corresponding to the five living habits and preferences in the questionnaire, respectively.

The fitness function for R is formulated as follows:

(1) fR=x=1SxRNsy=1SyRNsz=15PSx,AzPSy,Az×DSx,Iz/Ns/Ns+1(1)

where

Sx :The xth student in R.

Sy :The yth student in R (Sy is considered the roommate of Sx).

PSx,Az :The answer of the zth item in Q, done by Sx.

PSy,Az :The answer of the zth item in Q, done by Sy.

DSx,Iz :The degree of importance for the zth question, which is specified by Sx. This degree is an integer ranging from 1 (least important) to 10 (most important).

|‧|: Absolute value operation.

Ns :The number of students in a room.

In EquationEquation (1), PSx,AzPSy,Az×DSx,Iz is called a weighted preference distance from Sx to Sy since the preference distance (PSx,AzPSy,Az) between Sx and Sy is multiplied by importance degree DSx,Iz. It is important to note that in EquationEquation (1), 1 is added to this formula to avoid a divided-by-zero error. This error will occur, if all weighted distances are zeros. This will cause an infinite fitness value (un-computable value), when we perform a roulette-wheel selection.

The goal of this study is to minimize the overall fitness value for all rooms. Therefore, the objective function for the proposed GA is

(2) minr=1NrfRrNr(2)

where

Rr : The rth room in the dormitory.

Nr : The number of rooms in the dormitory.

Experiments and Results

To validate the proposed GA, this study conducted three experiments. The computer settings for these experiments are shown as follows:

  • Operation system:Windwos 10 (Virtual Machine)

  • CPU:Interl Xeom CPU E5620 2.4 GHZ (4-core processor)

  • RAM:16 GB DDR3-1333

  • Hard disc drive:160 GB

Experiment 1: The Room Capacity Is Constant

In Experiment 1, each room had 4 beds (i.e., capacity of 4 students). Three cases were considered. The student sizes and the number of rooms for the three cases are shown as follows:

  • Case 1: 33 students assigned to 9 rooms

  • Case 2: 290 students assigned to 73 rooms

  • Case 3: 691 students assigned to 173 rooms

The iterative results of the three cases in Experiment 1 are shown in , , . From these figures, we find that the more numbers the students and rooms have, the more smoothly the fitness decrease. In addition, two counterpart methods were used to evaluate the performance of the proposed algorithm: a simulated annealing method and a random assignment method. The comparative results are also demonstrated in . From this table, one concludes

  • The execution time of the proposed algorithm is much faster than that of the simulated annealing method.

  • The fitness value of the proposed algorithm is much better than that of the random assignment method.

  • The fitness value of the proposed algorithm is almost the same as that of the simulated annealing method.

Table 2. Comparative results of experiment 1

Figure 6. Iterative results of Case 1 (33 students assigned to 9 rooms).

Figure 6. Iterative results of Case 1 (33 students assigned to 9 rooms).

Figure 7. Iterative results of Case 2 (290 students assigned to 73 rooms).

Figure 7. Iterative results of Case 2 (290 students assigned to 73 rooms).

Figure 8. Iterative results of Case 3 (691 students assigned to 173 rooms).

Figure 8. Iterative results of Case 3 (691 students assigned to 173 rooms).

Experiment 2: Stability of the Proposed Algorithm

To test the stability of the proposed algorithm, the procedure in Experiment 1 independently executed 100 times for each case. The results of the 100 executions for each case are shown in , , , respectively. From these figures, for the proposed algorithm, the fitness values of the 100 executions for each case do not change sharply. The stability of the proposed algorithm is acceptable. For the simulated annealing method, the fitness values of the 100 executions for each case do not change sharply. For the random assignment method, the fitness values of the 100 executions for each case change a little bit sharply.

Figure 9. Stability test of Case 1: 33 students assigned to 9 rooms.

Notes: x-axis: execution number; y-axis: fitness value; *: Standard Deviation.
Figure 9. Stability test of Case 1: 33 students assigned to 9 rooms.

Figure 10. Stability test of Case 2: 290 students assigned to 73 rooms.

Notes: x-axis: execution number; y-axis: fitness value; *: Standard Deviation.
Figure 10. Stability test of Case 2: 290 students assigned to 73 rooms.

Figure 11. Stability test of Case 3: 691 students assigned to 173 rooms.

Notes: x-axis: execution number; y-axis: fitness value; *: Standard Deviation.
Figure 11. Stability test of Case 3: 691 students assigned to 173 rooms.

Experiment 3: Different Capacities of Rooms

In Experiment 3, the capacities (beds) of rooms were different. The room information for this experiment is shown as follows:

  • Number of rooms consisting of 6 beds: 30

  • Number of rooms consisting of 5 beds: 10

  • Number of rooms consisting of 4 beds: 101

  • Number of rooms consisting of 3 beds: 10

  • Number of rooms consisting of 2 beds: 10

  • Number of rooms consisting of 1 bed: 10

shows the iterative results of Experiment 3. From this figure, the fitness values stably decrease until approximately 350 generations. Again, the two counterpart methods were also used to evaluate the performance of the proposed algorithm. shows the comparative results of using the proposed algorithm, the simulated annealing method, and the random assignment method. These results are similar to those of Experiment 1, i.e.,

  • The execution time of the proposed algorithm is significantly less than that of the simulated annealing method.

  • The fitness value of the proposed algorithm is significantly less than that of the random assignment method.

  • The fitness value of the proposed algorithm is almost the same as that of the simulated annealing method.

Table 3. Comparative results of experiment 3

Figure 12. Iterative results of Experiment 3.

Figure 12. Iterative results of Experiment 3.

Conclusions

Dormitory room assignment is essentially a stable roommates problem. Some previous studies discussed this problem from the viewpoint of mathematics. The searching space for solving the dormitory room assignment is huge when the numbers of students and rooms become large. To reduce the searching space, this study proposed a GA based algorithm to find sub-optimal solutions with reasonable computational time. This study considered five living habits and preferences when assigning dormitory rooms.

Unlike popular crossover methods and selection methods used in traditional GAs, this study has presented a modified crossover method (i.e., locally exhaustive crossover method) and a modified selection method (i.e., half-half selection strategy). In the locally exhaustive crossover method, for two chromosomes (rooms), we tried any possible gene’s combinations for the two rooms, and found the best crossover result. This could avoid divergence results during the GA’s iterations, and thus got better fitness values for this dormitory assignment problem. In the half-half selection strategy, instead of using the entire selection pool, we selected the half of chromosomes from the entire selection pool using a roulette-wheel selection method; the other half of chromosomes then performed the locally exhaustive crossover method to get their offspring chromosomes. This would significantly reduce the time consumption during the GA’s iterations, and the performance (fitness values) was almost the same as the one that used the entire selection pool.

This study also conducted experiments to validate the proposed algorithm. Experimental results have shown that the proposed algorithm could have acceptable performances with reasonable computation time. In addition, two counterpart methods were used to evaluate the performance of the proposed algorithm: a simulated annealing method and a random assignment method. The comparative results have suggested that

  • The execution time of the proposed algorithm is much faster than that of the simulated annealing method.

  • The fitness value of the proposed algorithm is much better than that of the random assignment method.

  • The fitness value of the proposed algorithm is almost the same as that of the simulated annealing method.

  • The proposed algorithm is stable to repeated executions.

  • The proposed algorithm is still suitable even when the capacities (beds) of rooms are different.

The future studies might possibly address the following directions:

  • Adding more living habits and preferences.

  • Increasing the numbers of students and rooms.

  • Optimizing the computational time.

Disclosure Statement

No potential conflict of interest was reported by the author(s).

References

  • Abraham, D. J., P. Biró, and D. F. Manlove. 2005. Almost stable’ matchings in the roommates problem. Approximation and Online Algorithms Lecture Notes in Computer Science 3879:1–14.
  • Albalawi, F. O., and M. S. Maashi. 2021. Selection and optimization of software development life cycles using a genetic algorithm. Intelligent Automation & Soft Computing 28 (1):39–52. doi:https://doi.org/10.32604/iasc.2021.015657.
  • Alimudin, A., I. Winarno, and Y. Ishida. 2019. Defining network switch preference by network traffic using stable marriage problem. Paper presented at the 2019 International Electronics Symposium (IES), Surabaya, Indonesia, September 27-28.
  • Biró, P., E. Iñarra, and E. Molis. 2016. A new solution concept for the roommate problem: Q-stable matchings. Mathematical Social Sciences 79:74–82. doi:https://doi.org/10.1016/j.mathsocsci.2015.12.001.
  • Bristi, W. R., F. Chowdhury, and S. Sharmin. 2019. Stable matching between house owner and tenant for developing countries. Paper presented at the 2019 10th International Conference on Computing, Communication and Networking Technologies (ICCCNT), Kanpur, India, July 6-8.
  • Chang, -C.-C. (2019). Applying a genetic algorithm to dormitory assignment optimization. Master Thesis, National Kaohsiung Normal University, Kaohsiung, Taiwan.
  • Chen, R., M. Chen, and H. Yang. 2020. Dynamic physician-patient matching in the healthcare system. Paper presented at the 2020 42nd Annual International Conference of the IEEE Engineering in Medicine & Biology Society (EMBC), Montreal, QC, Canada, July 20-24.
  • Eslami, H., and M. Afzali. 2007. Applying genetic algorithm for allocating students to the dormitory rooms. Iran Data Mining Conference, Tehran, Iran, November 20, 2007, 1–8.
  • Gale, D., and L. S. Shapley. 1962. College admissions and the stability of marriage. The American Mathematical Monthly 69 (1):9–15. doi:https://doi.org/10.1080/00029890.1962.11989827.
  • Irving, R. W. 1985. An efficient algorithm for the ‘stable roommates’ problem. Journal of Algorithms 6 (4):577–95. doi:https://doi.org/10.1016/0196-6774(85)90033-1.
  • Irving, R. W., and D. F. Manlove. 2002. The stable roommates problem with ties. Journal of Algorithms 43 (1):85–105. doi:https://doi.org/10.1006/jagm.2002.1219.
  • Iwama, K., and S. Miyazaki. 2008. A survey of the stable marriage problem and its variants. Paper presented at the International Conference on Informatics Education and Research for Knowledge-Circulating Society (icks 2008), January 17-17.
  • Katarı́na, C., and S. Ferková. 2004. The stable crews problem. Discrete Applied Mathematics 140 (1–3):1–17. doi:https://doi.org/10.1016/j.dam.2003.05.003.
  • Le Hong, T., V. Hoang Huu, and T. Chung. 2016. Finding “optimal” stable marriages with ties via local search. Paper presented at the 2016 Eighth International Conference on Knowledge and Systems Engineering (KSE), Hanoi, Vietnam, October 6-8.
  • Madi, K., E. Paquet, and H. Kheddouci (2019). New graph distance based on stable marriage formulation for deformable 3D objects recognition. Paper presented at the 2019 IEEE/ACS 16th International Conference on Computer Systems and Applications (AICCSA), Abu Dhabi, UAE, November 3–7.
  • Meulbroek, D., D. Ferguson, M. Ohland, and F. Berry. 2019. Forming more effective teams using CATME teammaker and the gale-shapley algorithm. Paper presented at the 2019 IEEE Frontiers in Education Conference (FIE), October 16-19.
  • Nakamura, M., K. Onaga, S. Kyan, and M. Silva. 1995. Genetic algorithm for sex-fair stable marriage problem. Paper presented at the Proceedings of ISCAS’95 - International Symposium on Circuits and Systems, April-May 30-3.
  • Pittel, B. G., and R. W. Irving. 1994. An upper bound for the solvability probability of a random stable roommates instance. Random Structures and Algorithms 5 (3):465–86. doi:https://doi.org/10.1002/rsa.3240050307.
  • Ren, J., F. Xia, X. Chen, J. Liu, M. Hou, A. Shehzad, N. Sultanova, X. Kong, et al. 2021. Matching algorithms: fundamentals, applications and challenges. IEEE Transactions on Emerging Topics in Computational Intelligence. 5(3):332–50. doi:https://doi.org/10.1109/TETCI.2021.3067655.
  • Roth, A. E., T. Sönmez, and M. U. Ünver. 2005. Pairwise kidney exchange. Journal of Economic Theory 125 (2):151–88. doi:https://doi.org/10.1016/j.jet.2005.04.004.
  • Settanni, E. (2000). Improving dorm room assignments using simulated annealing, Master Thesis, The University of New Mexico.
  • Tan, J. J. M. 1990. A maximum stable matching for the roommates problem. Bit 30 (4):631–40. doi:https://doi.org/10.1007/BF01933211.
  • Trang, L. H., N. T. Hoa, T. V. Hoai, and H. H. Viet. 2019. Finding MAX-SMTI for stable marriage with ties and bounded preference lists. Paper presented at the 2019 International Conference on Advanced Computing and Applications (ACOMP), November 26-28.
  • Trung, N. T., and D. T. Anh. 2009. Comparing three improved variants of simulated annealing for optimizing dorm room assignments. 2009 IEEE-RIVF International Conference on Computing and Communication Technologies, Da Nang, Vietnam, 1–5.
  • Vien, N. A., and T. Chung. 2006. Multiobjective fitness functions for stable marriage problem using genetic algrithm. Paper presented at the 2006 SICE-ICASE International Joint Conference, Busan, Korea, October 18-21.
  • Wang, W.-F., Z.-L. Li, and Y. Ma. 2009. Application of backtracking algorithm in college dormitory assignment management. 2nd IEEE International Conference on Computer Science and Information Technology, Beijing, China, August 8-11, 2009, 272–74.
  • Xiao, Y., D. Niyato, K. Chen, and Z. Han. 2016. Enhance device-to-device communication with social awareness: A belief-based stable marriage game framework. IEEE Wireless Communications 23 (4):36–44. doi:https://doi.org/10.1109/MWC.2016.7553024.
  • Yu, Q., and X.-A. Sun. 2016. A research on the model of university apartment occupancy distribution based on the student preferences. International Conference on Logistics, Informatics and Service Sciences (LISS), Sydney, Australia, 24-27 July, 2016, 1–5.
  • Zayed, H. A. B., and M. S. Maashi. 2021. Optimizing the software testing problem using search-based software engineering techniques. Intelligent Automation & Soft Computing 29 (1):307–18. doi:https://doi.org/10.32604/iasc.2021.017239.

Reprints and Corporate Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

To request a reprint or corporate permissions for this article, please click on the relevant link below:

Academic Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

Obtain permissions instantly via Rightslink by clicking on the button below:

If you are unable to obtain permissions via Rightslink, please complete and submit this Permissions form. For more information, please visit our Permissions help page.