Harmony Search Algorithm for Patient Admission Scheduling Problem

Abstract The patient admission scheduling (PAS) problem is an optimization problem in which we assign patients automatically to beds for a specific period of time while preserving their medical requirements and their preferences. In this paper, we present a novel solution to the PAS problem using the harmony search (HS) algorithm. We tailor the HS to solve the PAS problem by distributing patients to beds randomly in the harmony memory (HM) while respecting all hard constraints. The proposed algorithm uses five neighborhood strategies in the pitch adjustment stage. This technique helps in increasing the variations of the generated solutions by exploring more solutions in the search space. The PAS standard benchmark datasets are used in the evaluation. Initially, a sensitivity analysis of the HS algorithm is studied to show the effect of its control parameters on the HS performance. The proposed method is also compared with nine methods: non-linear great deluge (NLGD), simulated annealing with hyper-heuristic (HH-SA), improved with equal hyper-heuristic (HH-IE), simulated annealing (SA), tabu search (TS), simple random simulated annealing with dynamic heuristic (DHS-SA), simple random improvement with dynamic heuristic (DHS-OI), simple random great deluge with dynamic heuristic (DHS-GD), and biogeography-based optimization (BBO). The proposed HS algorithm is able to produce comparably competitive results when compared with these methods. This proves that the proposed HS is a very efficient alternative to the PAS problem, which can be efficiently used to solve many scheduling problems of a large-scale data.


Introduction
The patient admission scheduling (PAS) problem is a combinatorial optimization problem, which belongs to the NP-complete category in almost all its variations [18]. NP means that a problem can be solved using non-deterministic computer in a polynomial time. An NP-complete problem means that we can reduce all the problem instances into another form in a polynomial time. On the other hand, NP-hard problem X represents a problem for which there is an NP-complete problem Y for which we can reduce X into Y in a polynomial time using a non-deterministic computer [12]. This problem is tackled by assigning a set of beds to hospital rooms, while taking into account a set of constraints like the medical equipment in the room and the medical expertise of the staff in the patient's room. These constraints are classified into hard and soft constraints. The satisfaction of the hard constraints is mandatory for the PAS solution to be feasible, while the violations of the soft constraints should be minimized as much as possible. In general, the PAS solution quality is measured by summing the soft constraint cost violation.
During the recent years, the metaheuristic methods are considered successful techniques that have been used to find satisfactory solutions for the PAS problem within a reasonable time. These metaheuristic methods are classified into: first, population-based techniques such as genetic algorithm [7,20] and biogeography-based optimization (BBO) [14]. Second, local search-based techniques like great deluge [15], simulated annealing (SA) [6], and adaptive large neighborhood search procedure [16].
In this paper, the HS algorithm is investigated for the PAS problem. We study the effect of each HS algorithm operator on the quality of the obtained solution. The PAS standard benchmark datasets are used in the evaluation. Initially, a sensitivity analysis of the HS algorithm is studied to show the effect of its control parameters on the HS performance. Six instances of the PAS problem dataset are used to evaluate the algorithm. The comparison with nine algorithms from the literature shows that the proposed algorithm is able to yield competitive results against state-of-the-art comparative methods using the same datasets.
The remainder of this paper is organized as follows: Section 2 presents the formulation of the PAS problem. The application of the HS algorithm for the PAS problem is described in Section 3. The experimental results and analysis of the findings are presented in Section 4. The last section provides the conclusion and possible future directions.

PAS Definition
The PAS problem formulation that we will use involves different inputs to the problem such as patients, rooms, departments, and time slots [4]. The description for each input of the PAS problem is presented as follows: patient attributes as the patient is a person with some treatment demands, gender, room preference, age, and class. The patient must spend a period in the hospital, and s/he should be assigned to a bed in a room for a fixed admission and discharge dates within the planned treatment; a time slot, which represents a day of the patient stay; a planned patient stay, which is the set of all the days the patient will stay in the hospital; room attributes as each room has different features, for example, medical equipment, room capacity, and the department in which the room is located; department as each department has multiple specialisms at different levels of expertise; speciality as each patient needs one or more specialists for her/his treatment; room gender policy expressed by letters as follows: D means that the room can have male or female patients, but they must be of the same gender in any specific day, F means that the room can be occupied by females only, M means that the room can be occupied by males only, and N means that the room can contain patients of both genders; age policy as some departments specify how old the patient can be in minimum or maximum to be accepted in the department (e.g. department of pediatrics).
In the PAS problem, the main objective function is to respect all the hard constraints and to minimize the violations of the soft constraints while maintaining all the medical or personal preferences for the patient. The hard constraints (HC) are summarized as follows: only one patient is assigned to the bed at any time slot (HC1), the dates for admission and release are pre-defined (HC2), the patient visit period is continuous (HC3), and the capacity of the room cannot be exceeded (HC4).
The soft constraints (SC) are summarized as follows: the room gender policy needs to be attained (SC1), the patient needed and preferred room properties should be satisfied (SC2). Missing one or more features should be penalized, and the needed feature has a higher penalty than the preferred feature. The department should have the needed speciality to treat the patient (SC3), the room needs to have the required speciality to treat the patient (SC4), the age of the patient should correspond to the maximum or minimum age of the department (SC5), the total number of transfers between the rooms has to be decreased (SC6), and the patient room preference has to be satisfied (SC7).
In order to simplify the computation of the objective function, we adapt the preprocessing steps given by Ref. [6]. We merge the penalties of violating the SC2, SC3, SC4, SC7, and partially SC1 soft constraints in the patient-room penalty matrix (PRC). This penalty is computed only once for all patient-to-room assignments when reading the input file. The room gender policy SC1 is included partially in the PRC. If the room gender is of type F or M, then, the penalty is added to the matrix PRC, and if it is N, then, there is no penalty. Gender policy D is the only case that cannot be merged with the matrix PRC, as it relies on other patient assignments. Table 1 presents the weights of violating the soft constraints.

PAS Formulation
In order to compute the objective function, we identify the mathematical model of the PAS problem. First, we define the symbols, which define different sets in the problem; then, we represent the decision variables used to develop the mathematical model as follows: P represents the set of patients, B represents the set of beds, R represents the set of rooms, T represents the set of days or time slots, c r represents the capacity of room r, P F represents the set of female patients, and P M represents the set of male patients.
We use the following decision variables to formulate the mathematical model of the PAS problem: -X p,r,t : have the value 1 if the room r on the timeslot t is selected for the patient p and the value 0 otherwise. -g p : have the value 1 if the patient p is a male and 0 if the patient is a female. -f r,t : in the room r at the timeslot t, the number of the female patients is equal to .
p pr t p P g X -m r,t : in the room r at the timeslot t, the number of the male patients is equal to ∈ ⋅ ∑ , , . p pr t p P g X -PS P : is the set of patient stays, which is defined as {t ∈ T | t > = t s,p ∧ (t < t s,p + d p )}, where t s,p is the patient p admission day, and d p is the patient's visiting period. -Transferring a patient from one room to another is defined using:

Hard and Soft Constraints Mathematical Formulation
-In order to select a room for the patient's visit period, the following equation is used: -In order to ensure that the capacity of each room cannot be exceeded, the following equation is used: , .
-The total penalties for violating the room gender soft constraint SC1 is calculated using the following equation: Note that W RG represents the weight of the room gender policy constraint. -The total penalties of transferring the patient from one room to another one (soft constraint SC6) can be defined using the following equation: Note that T r W represents the weight of the transfer constraint. -The total room penalty of soft constraints (SC2, SC3, SC4, SC7, and partially SC1) is achieved using the following equation, assuming that C p , r is the penalty of assigning patient p to room r: PRC p r t p r p P r R t PS P F X C (5)

Objective Function
The objective function represents the generated solution quality. It is computed as the sum of the soft constraint violation cost when solving the PAS problem as follows:

Harmony Search Algorithm for PAS Problem
HS algorithm was developed by Geem et al. [13]. It starts with a population of random decision variables, which are used to generate a feasible solution. The HS algorithm is driven by three operators to generate a new solution: considering a solution from the memory, considering a randomly generated solution, and adjusting the solution using a predefined pitch. Memory consideration operator is used by the algorithm to share in generating a new solution by means of combining the features of the existing solutions in the population (or the so-called HM). The diversity of the new solution is accomplished by visiting new regions in the problem search space using the random consideration operator. Furthermore, the pitch adjustment operator is used to enhance the new solution locally by applying a number of a predefined neighborhood strategy. If the new solution quality is superior to the population worst solution, then, the HS algorithm replaces the new solution with the worst one. This process keeps going until the stop criterion is met.
The pseudo-code of the HS algorithm for solving the PAS problem is shown in Algorithm 1.
In the HS, the random consideration will be used to assign a new value for ′. j x The pseudo-code for filling R j is shown in Algorithm 2.
During the random consideration stage, we select a viable value to ′ j x from its appropriate range X j with the probability of 1-harmony memory consideration rate (HMCR). The elements of X j can be any value within the search space of the problem. A new value for ′ j x is assigned using memory consideration and using random consideration operators as follows: In the pitch adjustment stage, a neighborhood strategy to change ′ j x is selected. The purpose is to adjust the selected variables into a new allocation with a small perturbation of the current solution with the probability of pitch adjustment rate (PAR), where PAR ∈[0, 1].
where rnd is a randomly generated number between (0,1). The five-pitch adjustment techniques obtain a neighboring value as follows: 1. N1: the patient of ′ j x allocation is transferred into another randomly selected bed (from the HM) with a probability of [0, PAR/5]. 2. N2: for the patient P1 with ′ j x allocation, we select another random patient P2 and then swap the rooms of their entire stay period with the probability [PAR/5, (2*PAR/5)]. At least a 1-day overlap must happen for the period of visit of the two patients. 3. N3: the patient with ′ j x allocation is transferred into another randomly selected bed. This neighborhood strategy attempts to assure that all patient soft constraints are satisfied. We cancel the new selected bed if it cannot satisfy at least one of the soft constraints, and the patient is transferred into another bed with the room that matches the patient preferences and medical needs with a probability of [(2*PAR/5), (3*PAR/5)]. 4. N4: for the patient P1 with ′ j x allocation, we select another random patient P2. Assign P1 to the P2's bed, and assign P2 into a randomly selected bed, which matches minimally one of the P2's soft constraints with the probability of [(3*PAR/5), (4*PAR/5)]. The visiting period has to overlap minimally in 1 day for the two patients. 5. N5: for the patient P1 with ′ j x allocation, if the patient move requires a relocation, then, we select a new room, a relocation day, and the entry and release date. Such move is applied with a probability of [(4*PAR/5), PAR].
Note that in some pitch adjustment techniques such as N2, N3, and N4, the feasibility of the new harmony solution should be maintained during the improvisation process. Notably, in some pitch adjustment techniques, the bed availability will not be recognized, and thus, the feasibility cannot be maintained. As a consequence, the pitch adjustment operator will neglect the chosen technique and start over again to choose another one.

Experiments and Results
In this section, the performance of the proposed HS algorithm to solve the PAS problem is evaluated. The proposed HS algorithm is evaluated using six standard datasets with different complexity and characteristics as discussed in Section 4.1. A sensitivity analysis of the HS algorithm is studied to show the effect of its control parameters (i.e. HMCR, PAR, and harmony memory size [HMS]) on the HS performance as discussed in Section 4.2. The comparative evaluation of the proposed method and nine well-regarded methods using the same datasets is described in Section 4.3.
Note that the proposed HS algorithm is programmed using Java, under Windows 7, on an Intel Machine with Core(TM) i3-2350 M CPU with 2.3 GHZ, and 4GB RAM. The time complexity of the proposed algorithm is not considered in this section due to the fact that this kind of problem is not a real time, and it does not run frequently. Therefore, the time complexity is not a major factor to evaluate such a new method.

Dataset Used
The dataset used for the experiments has six problem instances freely available from Demeester (https:// people.cs.kuleuven.be/wim.vancroonenburg/pas/). Their features are summarized in Table 2. The instances vary in terms of size and complexity. The number of patients P represents the actual number that is included in the problem after omitting the patients with 0 day of stay or that have the entry day that is after the end of the planned visiting period. We include the total number of patients in the parentheses. Although there are more than six datasets, these instances are selected because their structure is more homogeneous. Also, there are a number of comparative methods that use the same datasets to evaluate their proposed methods. These comparators are summarized in Section 4.3.

Sensitivity Analysis of the Proposed HS Algorithm
In this section, the ad hoc sensitivity analysis of the HS algorithm on its three parameters (HMCR, PAR, and HMS) is intensively studied to show their effect on the algorithm performance. Nine convergence cases are established and summarized in Table 3. The first three convergence cases are set to study the effect of HMCR on the performance of the HS algorithm. The second three convergence cases are set to study the effect of PAR on the performance of the HS algorithm, while the last three convergence cases are set to study the effect of HMS on the performance of the HS algorithm. At each stage, the configuration of the best case yielded the best results and is retained and used in the consecutive experimented cases. The following three subsections describe each convergence case's stage. Note that for sensitivity analysis study, NI = 100,000.

The Effect of HMCR on the HS Algorithm Performance
This section presents the study of the effect of using different variations of HMCR on the algorithm convergence behavior and performance. The averages and standard deviations (stds) of the results obtained when applying the HS algorithm on the dataset of six instances is summarized in Table 4. These results are generated with fixed values of HMS = 10 and PAR = 0.005. The values for HMCR used are 0.90, 0.95, and 0.99. The best results (lowest is best) on all the datasets is obtained when HMCR = 0.99 (case 3). The selection of such value increases the probability of using the HM, which decreases the exploration of the algorithm. Such action allows the algorithm to dig down deep to achieve the satisfactory results.

The Effect of PAR on the HS Algorithm Performance
The convergence and performance of the HS algorithm is studied in this section using different values of PAR. The results are statistically presented in terms of averages and stds when the HS algorithm is applied on the six instances of the dataset. The produced results are when HMCR = 0.99 and HMS = 10. The following are the variety of values used to set PAR 0.005, 0.05, and 0.10. Table 5 shows that the best results are obtained when PAR = 0.10 (case 6). This value increases the diversity of the solutions and, thus, increases the exploitation of the HS algorithm. Such behavior of the algorithm can make it not easily stuck in the local minima.

The Effect of HMS on the HS Algorithm Performance
The effect of the value of HMS on the HS algorithm convergence and performance is studied in this section. Table 6   Best results are in bold.

Comparative Evaluation and Discussion
The parameter values of the proposed method used in comparative evaluation are set based on the experiments conducted in the previous section. In order to obtain comparative results, the parameter values are set as follows: HMS = 10; HMCR = 0.98; PAR = 0.1; and NI = 2,000,000. We compare the proposed method with the nine other well-regarded methods using the same PAS datasets. These comparative methods are abbreviated in Table 7. Table 8 shows the best, average, std, and the rank based on the average and std (presented as a/b) for our approach and the other state-of-the-art algorithms using the abbreviation mentioned before. The following example clarifies how the rank value is computed. The rank (a/b) can be calculated for TestData1 to equal (1/2). This means that the proposed HS method is ranked first in terms of the average results and its std is ranked second. Note that this ratio of rank (1/2) is relevant to the order of all the nine methods.
Note that in some comparative methods, the Best obtained results are not recorded, namely: HH-SA, HH-IE, and TS. These are marked in Table 8 as "NA". Therefore, the only available results are presented in the comparison. Table 8 summarizes the results of the proposed method in terms of best, average, and std of the 10 runs accomplished for each dataset. The results presented in Table 8 prove that the proposed method is able to  Best results are in bold. obtain competitive results when compared to all other state-of-the-art algorithms in terms of the best and average, which is highlighted in bold font. Our proposed method is ranked fifth for almost all datasets based on the average. However, based on the std for each data instance, our approach is ranked nearly in the sixth place. The results prove that the proposed HS approach is a very efficient alternative algorithm for PAS, which is able to compete well with the other well-regarded methods. Table 9 summarizes the violation of the soft constraints (SC1-SC7) for the best results recorded for all the datasets experimented. The numbers in the table refer to the proposed algorithm efficiency in satisfying the soft constraints. Apparently, the total number of transfer constraint (SC6) is satisfied in all the datasets due to the fact that the solution representation does not allow the violation of this soft constraint. The age constraint (SC5) also is fulfilled in all the best solutions recorded. The room preference constraint (SC7) is the    most violated constraint. This means that the proposed algorithm cannot deal properly in satisfying such constraint. A very few violations of the soft constraints (SC1, SC2, and SC3) are reported for the best solutions. SC4, which is the room needs speciality, is modestly violated. Notably, all soft constraints related to room activities is violated more than those related to the patient activities. This is because most of the local neighborhood structures used in pitch adjustments N1-N5 are considering patient preferences rather than room preferences. It is worthy to mention that all hard constraints are satisfied in these solutions.
To further study the performance of the proposed HS algorithm for the PAS problem, Figure 1 shows the box-and-whisker diagram for all the PAS problem instances used. The figure reveals the result distributions for all the instances. In Figure 1, we can see the differences in the skewness pattern for each data instance, where the box plots show that the spreading of the solutions has different patterns. For example, in Test-Data1 and TestData6, most of the results are condensed in the scale lower bound; then, the results are right skewed. Moreover, the results are spread evenly split at the median for TestData2 and TestData4. This shows that the distributions are symmetric for these instances. For TestData3 and TestData5, the distributions of the results are skewed to the upper end of the results. From Figure 1, we can observe that the behavior of the HS algorithm differs from one instance to another, due to the differences in the structures of the data instances.

Conclusion and Future Work
A daily routine of hospitals is patient admission scheduling. However, the medical resources are limited, and the hospitals will try to achieve patient satisfaction by taking their preferences into consideration. A computer program that can provide a feasible solution that does not break the problem constraints is required, as it can help the hospital in planning for allocating the patients to the rooms with the needed facilities.
In this study, we develop the novel HS algorithm to solve the PAS problem. The algorithm is modified to ensure the feasibility of the obtained solution. We intensively tune the different parameters of the HS algorithm using several convergence cases. The parameter values that obtain the best results are HMS = 10, HMCR = 0.98, and PAR = 0.1. These values are then used to solve the PAS problem. The proposed HS algorithm is ranked fifth when compared with other nine algorithms that are state-of-the-art.
In the future, we plan to hybridize the proposed HS algorithm with other local search methods to improve its performance. As a future direction, the proposed algorithm can be applied to the dynamic patient admission problem [19] and into other instances of the dataset.