A greedy-tabu approach to the patient bed assignment problem in the Hospital Universitario San

. by the authors; licensee Growing Science, Canada 1 2 20 ©

Patient Bed Assignment (PBA) consists of assigning patients to hospital beds according to specific requirements such as patient diagnosis, equipment requirements, age and gender policies, among others. We worked in conjunction with the Hospital Universitario San Ignacio (HUSI) with the goal of designing an application to support decision-making during the bed assignment process. We introduced a mathematical model for the PBA. We used Analytic Hierarchy Process (AHP) to determine the weights attributed to each part of the objective function. Due to the long execution time required, we used a Greedy Algorithm and Tabu Search (TS) to optimize the match between the patient's requirements and the characteristics of the assigned bed. To test the algorithms, we created 15 test instances of various sizes. The results showed that the gap between the value of the objective function resulting from using the Greedy/TS in comparison with the optimal solution is on average 6.2%. Also, the TS takes 84% less time than the MILP for medium and large instances. We collected data from real life instances and compared the actual method with the designed metaheuristic. On average, the value of the objective function resulting from using the proposed Greedy/Tabu algorithm is 8.6% higher. .

Introduction
Since the mid-twentieth century, Operations Research has experienced a great surge in solving problems in multiple sectors. One of the sectors in which this discipline has made great progress is the health sector, which involves highly complex tasks and critical decision-making situations (Romero-Conrado et al., 2017). Moreover, satisfaction of patients is one of the critical aspects for all clinical services around world (Almomani et al., 2020). These issues have generated the need of using quantitative models in health care centers to support the decision-making process in order to improve operational efficiency, optimize the use of resources and minimize operating costs so that the desired service levels are met. Hulshof et al. (2012) identified a hierarchical division within the hospital decision-making process composed of three levels: strategic, tactical and operational. The strategic level involves defining the mission of the organization and guiding long-term decision-making to accomplish this mission during the development of the health care delivery process. The tactical level translates strategic planning decisions into guidelines that facilitate operational planning decisions. Finally, the operational level is responsible for the short-term decision making, following the tactical planning to design execution plans at the individual patient level and the individual resource level. In this last level, there are two types of planning: offline and online, also called static and dynamic planning respectively. Offline planning comprises the detailed coordination of activities with respect to a current situation. In this type of planning, patients have an admission date that is known in advance and, usually, the problem is solved only once during the planning horizon. Online planning consists of control mechanisms that are responsible for monitoring processes and reacting to unplanned events, taking into account patients who arrive without having been previously programmed. The latter is closer to reality due to the inherently uncertain nature of the medical care processes.
One of the main problems that a hospital must face at the operational level is Patient Admission Scheduling (PAS), which, as described by Guido et al. (2018) is concerned with deciding which patient to admit and at what time. Within this problem, there is a sub-task called Patient Bed Assignment (PBA), which aims to assign patients to appropriate beds taking into account medical restrictions, patient needs and availability of beds. The goal of this sub-task is to maximize the efficiency of the operational management as well as the comfort of the patient in order to improve the effectiveness of the treatment and the service provided. According to Thomas et al. (2013), the PBA is a complex decision-making function that requires an enterprise-wide view of the hospital, evaluating multiple alternatives and making difficult trade-offs. In addition, there are limited resources that must be distributed correctly to achieve a balance between the needs of the patient and the effective use of resources in the hospital. Furthermore, when assigning a patient to a bed, multiple variables must be considered, such as gender and age policies, the departments or specialties required by the diagnosis, the required machines and equipment, patient preferences, and isolation needs, among others. The PBA is, therefore, a combinatorial optimization problem, which has been demonstrated to be NP-Hard by Vancroonenburg et al. (2011) and which has been addressed previously with the use of techniques such as metaheuristics and linear programming, as described later in the Literature Review section.
The importance of the PBA lies not only in the optimization of resources, but also in that it contributes to the continuity of the hospital's internal processes. For example, if a patient who has had surgery cannot move to a bed in the general ward, he or she must remain in the recovery room, preventing the surgery room from being released to receive a new surgical patient. Therefore, the correct allocation of patients to beds plays a critical role in the patient flow, defined by Cote (2000) as the movement of patients through different locations in a medical center. Inadequate management of the patient-flow generates queuing and prolonged stays, which, according to Kloehn (2004) leads to missed revenues, higher costs of care, and decreased patient and staff satisfaction. The traditional method to perform the PBA is manually. As explained by Demeester et al. (2010), this task is often carried out by a central admissions office that individually contacts every appropriate department a few days before the effective admission of the patient. On the other hand, other hospitals choose to delegate this responsibility directly to the departments, in which case, the lack of an overview may result in under-occupancy given that patients may be refused in one department while free suitable beds are available in another department. At the Hospital Universitario San Ignacio (HUSI), where this project was carried out, the PBA is currently performed by the admissions office jointly with nursing professionals who occupy administrative positions called hospital bed managers. The latter are in charge of coordinating and executing the operational management of the process of assigning patients to beds and making sure each patient's discharge requirements are met. Currently, there are 345 hospital beds and 9 hospital bed managers, each of which is in charge of managing the beds of a specific department (e.g., isolation, pediatrics, oncology, orthopedics, etc.).
Every morning, the admissions office sends a list of the patients who require a bed to every hospital bed manager. Based on this information, each manager decides which patient will be assigned to each bed in his or her department. If there are no available beds for a patient in the department corresponding to his or her diagnosis, the manager in charge reaches out to the other managers in order to try to find an available bed in another department that meets the requirements of the patient. Additionally, due to the dynamics of the hospital, managers can receive new bed requests throughout the day through multiple means such as email, phone calls, mobile messaging applications and even going to other departments to inquire about the status of patients who may require a bed. Therefore, hospital bed managers must invest most of their time and energy in the process of assigning beds, both for previously scheduled patients as well as for the bed requests they receive during the day. This, added to the large installed capacity of the hospital and the lack of standardized communication channels, translates into a time consuming and exhausting process. Previously, the criteria used for deciding the priority of a bed request in the bed assignment process at the HUSI were based on the subjective judgment of those in charge of the process. Consequently, the Hospital Services Area identified the need to establish basic guidelines for this procedure in order to have objective and fair criteria. As a result, in 2018 the manual Lineamientos generales para la asignación de camas hospitalarias (General Guidelines for the Assignment of Hospital Beds) was created. Hospital bed managers currently use this manual as a guide to determine the patients' priorities for assignments to a bed. Once the priority for each patient has been determined, the managers decide the patient-bed assignment based on their knowledge of the characteristics of the beds they are responsible for and the conditions required by each patient given their clinical history. However, despite the efforts invested in the standardization of the process, the PBA in the HUSI continues to be a manual procedure susceptible to the criteria of each manager. Moreover, the hospital does not have qualitative or quantitative measurement criteria to determine the match between the characteristics of the assigned bed and the requirements of the patient, nor to evaluate the quality of the patient-bed assignment process carried out. Considering that this is a complex process that requires the analysis of multiple alternatives and a global vision of the medical center, performing it manually may lead to inefficient utilization of critical resources and lower patient satisfaction (Turhan & Bilgen, 2017). Additionally, there is substantial empirical evidence that human intuitive judgments and decision-making can be far from optimal, even more so in complex and/or stressful situations, which increases the risk of error (Thomas et al., 2013).
For these reasons, the HUSI has identified the need for new decision-making support tools to contribute to the standardization, optimization and automation of the bed assignment process. Thus, the present paper aims to answer the question: How to design a patient-bed assignment process in the HUSI that maximizes the match between the patient's requirements and the characteristics of the assigned beds.

Background
PBA was introduced by Demeester et al. (2010) as a challenging combinatorial optimization problem. They presented a TS algorithm hybridized with both a token-ring and a variable neighborhood descent approach to automatically assign patients to hospital beds. They defined and developed for the first time an algorithm that assigned patients to beds in the appropriate departments, satisfying as much as possible the patients' wishes and all the necessary medical constraints. The algorithm also aimed to balance the number of patients between the different departments in order to distribute equally the workloads and the use of resources within the hospital. The algorithm was presented after showing that solving the problem with integer programming exhibited a high computational complexity. Ceschia and Schaerf (2011) presented a multineighborhood local search procedure as an approach to solve the PBA problem, analyzing how different combinations of neighborhoods can have diverse effectiveness for different sets of weights of the cost components that constitute the objective function. They computed many lower bounds based on the relaxation of some constraints and outperformed previous work on the problem in terms of quality and computational time. Bilgin et al. (2012) proposed a general high-level hyper-heuristic approach to solve both the PBA and the nurse rostering problem. Additionally, regarding the patient admission scheduling problem, they provided new benchmark instances and a validation tool that allowed to compare the performances of various algorithms. Ceschia and Schaerf (2012) proposed a metaheuristic based on simulated annealing and a complex neighborhood structure to solve both the static (predictive) and the dynamic (daily) versions of the PBA. They decomposed the dynamic problem into a series of static sub-problems that considered new information collected about the current situation of the hospital. This was achieved by assigning beds daily using the information of all patients who were known at that time.  designed another dynamic approach to the problem by creating two ILP-models. The first model targeted the optimal assignment for newly arrived patients by making the assignment decision shortly before patient arrival and only considering current room availability. The second model assigns all patients who are registered to arrive, meaning it also accounts for future, but planned, arrivals. The authors showed that the second model yields a better global result than the first model, since it considers more available information on future arrivals. Continuing with their research on the subject,  carried out a study on Patient Admission Scheduling, combining the PBA with the programming of surgery rooms in order to determine how scheduling surgical and non-surgical admissions impacts room assignment issues at hospital wards, and how these can be avoided. Thomas et al. (2013) developed a tool that supports the hospital's decision-making by periodically recommending patient-bed assignments based on the solution obtained by solving the problem with mixed-integer goal programming. Their system receives real-time information on the hospital state, solves the mathematical programming model, analyzes the assignments and, if necessary, automatically reruns the model with relaxed constraints. Range et al. (2014) proposed a heuristic based on Branch and Bound, Column generation and Dynamic constraint aggregation. The program was run for twelve different instances from a publicly available repository and five of these obtained better solutions than those previously reported in the literature. The computational results obtained showed that a column generation based heuristic approach using aggressive variable fixing is a viable approach for identifying highquality solutions for PAS. For this algorithm, the weight assigned to each of the soft constraints was proposed similarly to Demeester et al. (2010). Ceschia and Schaerf (2016) presented a more elaborate model for PBA that considers constraints on the utilization of operating rooms for patients requiring surgery. It included a flexible planning horizon and a complex notion of patient delay. Their solution was based on local search, which explores the search space using a composite neighborhood. They developed an instance generator that uses real-world data and statistical distributions to synthesize realistic and challenging case studies. They concluded that operating rooms can be effectively incorporated in a model of patient admission, however, this entails a more elaborate management of delays and more complex neighborhood relations. Lusby et al. (2016) developed a metaheuristic using an adaptive large neighborhood search (ALNS) procedure and a Simulated Annealing framework to solve the PBA. The proposed methodology developed a dynamic model of continuous optimization based on the available information (it was done daily). The results showed that the metaheuristic created was an efficient and flexible method that can solve problems of different sizes and with different time horizons. The program was run for small, medium and large instances and in most cases, the method showed better results than the one suggested by Ceschia and Schaerf (2012). Turhan and Bilgen (2017) designed MIP based heuristics called Fix-and-Relax and Fixand-Optimize to the PAS problem, decomposing the problem into sub-problems by separating patients based on their preferences and length of stays and decomposing the planning horizon into optimization windows. Their method found feasible solutions in low computational times and their overall results were on average 14% away from the best-known solutions. Guido et al. (2017) defined an optimization model to manage offline patient admission scheduling and suggested a method to set weights used to penalize constraint violations. They tested three new penalty value settings on a set of benchmark instances, showing improvements in the schedule quality. Bolaji et al. (2018) presented a metaheuristic-based algorithm based on a method named late acceptance hill-climbing (LAHC) for solving the PAS. The LAHC-based algorithm used three neighborhood structures embedded within its operators to navigate the solution search space rigorously in order to generate a new candidate solution and utilized the solutions stored in the table arrays to escape being trapped in local minima. Due to this property, the proposed algorithm proved to be suitable and efficient when employed to tackle different problems of high dimensionality like the PAS. Guido et al. (2018) proposed a matheuristic solution framework based on a re-optimization approach, which they called FiNeMath. This metaheuristic obtains the initial solution by solving a relaxed mathematical model that is then exploited to obtain a feasible solution if necessary. Finally, the algorithm seeks to improve the initial solution by an iterative scheme characterized by a sequence of sub-problems solved by an ILP solver.
All these papers consider the variables referring to the department or specialty required, necessary machines and/or equipment, gender policies and patient's preferences. We have analyzed and summarized the additional variables considered, together with the objective function, in Table 1.

Table 1
Variables and objective functions considered for the patient bed assignment in previous research

√ √ √
Minimize the penalty incurred from assigning patient p to room r based on the compatibility with specialty of the department where room r is located, preferred equipment, and patient preference of room category multiplied by the number of nights the patient is staying. Bolaji et al. (2018) √ √ √ Minimize the weighted sum of all the violations of the soft constraints relating to gender penalties, number of transfers and room penalties.
Considering previous research, our proposed metaheuristic considers the variables referring to the department or specialty required, the necessary machines and / or equipment, gender policies and age policies, as well as additional variables that were identified as relevant for the patient-bed assignment process in the HUSI. To our knowledge, this had not been previously done in any hospital in Colombia.

Characterization of the current patient bed assignment process
The process of assigning patients to beds in the HUSI begins when the attending physician identifies the need to hospitalize a patient and generates the hospitalization order in the information system. As soon as the order is generated, a message is automatically sent to the admissions office, where an employee is responsible for manually entering the patient information into a database. Once the list of patients is consolidated in the database, it is sorted according to the department in which each patient must be admitted so that a list with the patients headed to each department can be sent to the corresponding bed department manager. Bed managers can also receive scheduled patients and patients who are transferred from other services (e.g., patients leaving the surgery room or patients transferred from ICU). The latter performs the patient-bed assignments and proceeds to send this information to the admissions office to be entered into the system. The process is shown in Fig. 1.

Fig. 1. General patient bed assignment process
Regarding the patient-bed assignment made by the bed department manager, first, the list of patients is sorted according to the priority of care they need, giving preference to scheduled patients, those referred from the ICU and those who leave a surgery room. If there are still available beds after assigning these patients, patients coming from the emergency room will be admitted, as long as their EPS has a contract with the hospital or if it is a vital emergency situation. Additionally, the severity of the patient´s diagnosis and his/her age are considered to determine the severity of the patient's need for a bed in a specialized department. Once the list of the patients has been sorted, the bed department manager carries out a survey of the beds that are available. With this information, the manager proceeds to assign each available bed to a patient, taking into account the attributes of the bed and the requirements of the patient, seeking to satisfy the conditions needed for the treatment of the patient's diagnosis. However, considering that the number of patients that require a bed could be larger than the number of available beds, it is not guaranteed that all patients will have a bed assigned in the department. When this happens, the bed department manager calls his/her colleagues of other departments to ask them if they have an available bed that can be accommodated to satisfy the requirements of the patient that was not assigned to a bed. If a bed in another department cannot be found, the patient must continue waiting. Fig. 2 represents the patient-bed assignment made by the bed department manager.

Fig. 2. Specific department patient bed assignment process
It is important to note that HUSI has some specifications regarding the patient-bed assignment process:

Patient classification:
Each patient has a priority level. This level is determined by the bed managers taking into account the manual "General guidelines for the assignment of hospital beds in HUSI". In summary, this priority levels are: • Priority 1: Patients who require an ICU bed. • Priority 2: Patients who are leaving ICU or surgery rooms to be assigned to a bed. • Priority 3: Oncology patients who belong to Compensar EPS or Nueva EPS or patients who have a special contract with the hospital.
• Priority 4: Patients with more than 48 hours of stay at the emergency room with hospitalization order. • Priority 5: Patients with special bed isolation requirements. • Priority 6: External referred patients Additionally, a patient can be extra prioritized according to other conditions like: • Scheduled patients: Patients who have a fixed admission date and must be assigned in that specific day. • SIPE/VIP patients: International services patients, patients with a special plan, prepaid medicine patients, and patients who must be located in the VIP floor of the hospital (Ninth floor).
• Special patients: Patients who are recommended by the hospital directors, patients who belongs to the Jesuit community and patients with special or critical health conditions.
• Special Aged patients: Patient who are younger than 12 years old, or, older than 65 years old.

Bed/Room Classification:
• Room capacity: Each room can have one or multiple beds. A patient may express a preference for the capacity of the room they will occupy.
• Bed isolation level: A bed can have different isolation characteristics. The HUSI has 6 types of isolation: All rooms have the same basic equipment; however, there are six distinguishing features necessary to treat particular pathologies that can or cannot be present in a bed: · Water point · Suction system · Vent system · Individual bathroom · Baby crib · Exterior view window • Room gender policy: Each room can be assigned only to male or female patients. Under no circumstances can men and women be simultaneously assigned to the same room. The gender of each room can vary depending on the needs of the arriving patients.

Department Classification
There are twenty service departments at the hospital. However, given the fact that there are services that have very specific characteristics and therefore are managed independently, it was determined that the services to be included in the study would be: Each room belongs to one department and each patient must be assigned to the department that is best qualified for his/her treatment. In some cases, patients can be assigned to a bed in a different department from the one he/she was supposed to be

Mixed integer linear programming modelassigned to if there are no available beds in his/her department
In order to represent and solve the bed assignment process, we proceeded first to formulate the Mixed Integer Linear Programming model (MILP) that fulfills all the requirements and specifications of the bed assignment process previously characterized as shown below:

Objective function and constraint
The objective function (1) is the weighted sum of rewards obtained from assigning patients to beds minus the penalties for deviating from hospital goals. The first addend of the objective function accounts for the reward obtained for assigning patients to the department best suited for treating their illness. Then, addends 2 to 8 of the objective function account for the reward for assigning: VIP patients to the VIP department, special and scheduled patients to any bed in the hospital, patients who are older than 65 or younger than 12 years old to a bed, and patients to a bed according to their priority level (Patient types). The ninth addend of the objective function accounts for the penalty incurred when a patient has a different assignment from the start of model run (is transferred). Constraint (2) ensures that a patient cannot be assigned to more than one bed. Constraint (3) ensures that a bed can only be assigned to one patient. Constraint (4) ensures that every bed must meet all the required features of the assigned patient. Constraint (5) ensures that the bed must meet the minimum required isolation type of the assigned patient. Constraint set (6) ensures that all patients assigned to one room are of the same gender. Constraint (7) ensures that a patient can only be assigned to a bed if he/she has a contract with the hospital, if he/she is a VIP, or if he/she is a special patient. Constraint (8) ensures that if a patient is not assigned to the VIP department, yp must take the value of 0. Constraint (9) ensures that if a patient has a different assignment from the start of the model run (is transferred), wp must take the value of 1. Constraint (10) ensures that if a patient is not assigned to the department best suited for treating his/her illness, kp must take the value of 0. Constraint (11) ensures that if a patient must be assigned to the department best suited for treating his/her illness, kp must take the value of 1. Constraint (12) ensures that if a patient was assigned to a bed at the start of model run, he/she must be assigned to a bed at the end of the model run. Finally, Constraint set (13) ensures that if a patient must be located in a specific department (Pediatric, UADO, UADP, Marrow Transplant or Isolation) then he/she cannot be assigned to a different department. Also, patients assigned to a department different from the aforementioned departments cannot be assigned there.
As we can see, the model incorporates variables that were identified as relevant for the patient-bed assignment process in the HUSI such as: departments with special conditions in the hospital (Oncology, UADO, UADP, Marrow Transplant, Pediatric), patients that can or cannot be assigned to a bed given the type of contract that they have, and the patient-bed assignment taking into account the priority of the patient set by the hospital's assignment guidelines. Also, the classification of beds according to types of isolation and the prioritization and assignment of patients given the type of isolation they need, is a concept that to the best of our knowledge, had not been used in any model previously designed to solve the PBA.

Estimation of the weights of the factors of the objective function
As our objective function is composed of a variety of rewards and penalties, we applied the Analytic Hierarchy Process (AHP) method, which is designed to solve multi-criteria problems (Liu et al., 2013), in order to estimate the average weight for each one of the factors taken into account by our model. It is important to note that these factors were defined together with bed managers according to the mental process they use when doing the bed assignment process, seeking to include all the elements (even the subjective ones) that are currently considered when assigning a patient to a bed. Saaty (2008) summarizes the AHP with four steps. The first one is to determine the objective function or goal, as we did with the objective function of the MILP. The next step is to determine the criteria and factors to be analyzed, therefore constructing a hierarchy by decomposing the problem into smaller sub-problems to be subsequently evaluated. The criterion used by the bed managers to measure each factor was the global benefit for the hospital including every aspect, from the patient's satisfaction to the institutional profit. We then defined the following factors for our problem: • Ideal Department: Refers to assigning a patient to the ideal department for treating his/her diagnosis.
• VIP to Ninth Floor: Refers to assigning a VIP patient to the ninth floor.
• VIP to Another Floor: Refers to assigning a VIP patient to any hospital bed regardless of floor.
• Special Admission: Refers to assigning a bed to a patient that is special or recommended.
• Scheduled Admission: Refers to assigning a bed to a previously scheduled patient.
• Patient Priority: Refers to giving priority to patients with a higher level of assignment priority.
• Isolation Patient: Refers to giving priority to patients who require a higher level of isolation.
• No transfer: Refers to not transferring a patient who is already assigned to a bed. • Special Age: Refers to giving priority to patients over 65 and under 12 years old.
The third step is to apply a pairwise comparison between the previously determined factors to identify their relative importance and calculate the weight of each one of these. To collect this data, we proceeded to design and apply a survey to be answered by the Hospitalization Services Area director and bed managers. This survey was composed of 36 questions, one question for each pair of factors, where the respondent had to slide an indicator towards the factor that he/she considered most important when assigning a patient to a bed and its magnitude according to the AHP verbal judgment of preference scale. We collected 7 survey responses and calculated the average score for each pair of factors. We then proceeded to apply the AHP method. The weights for the criteria based on the pairwise comparisons are shown in Table 2. Finally, the fourth step of the AHP is to perform a consistency inspection to verify whether the consistency rate is adequate or not. The results can be considered consistent if the resulting ratio is less than 10% (Saaty, 2008). Once all the comparisons were made, we performed the consistency test and obtained a consistency ratio of 8.2%. This indicates an acceptable result that can be used to weight the penalties and rewards of the objective function for the MILP we proposed.

Initial Solution (Greedy)
To obtain the initial solution, we used a Greedy algorithm. Greedy algorithms are widely used to address the test-case prioritization problem, which focuses on always selecting the current "best" test case during test-case prioritization (Lou et al., 2019). We used the same basic idea to prioritize the patients waiting to be assigned by evaluating each available bed and always choosing the "best" patient we could assign to that bed.
Due to the different characteristics of each department, we divided the problem into sub-problems as follows:

Assigning scheduled patients
Given that scheduled patients must have a guaranteed bed in their assigned department, we assign these patients first using the following process for each:

Set
as the list of beds where a patient ∈ can be assigned. This list includes all beds located in a room in the department assigned to this patient, taking into account that the room must be empty or be occupied by patients of the same gender as the patient waiting to be assigned. Then, do Algorithm 1. Algorithm 1. Pseudocode for assigning the best-suited bed ∈ for patient ∈ 1: = Best value of objective function for patient 2: Set the initial value of as 0 3: = Bed that has the best value of objective function when assigned to patient 4: for ℎ = 1 to 5: = Value of the objective function calculated for bed B 6: if > and patient can be assigned to bed then 7: = 8: = 9: end if 10: next ℎ 11: Assign patient to

Assigning patients with no special conditions to beds
Patients with no special conditions are those who are not scheduled, are not pediatric or oncology patients and were not assigned to any department with special conditions. We assign these patients first using the following process: For every department, create the list of all rooms with beds that have not been assigned to a patient. For each room that has available beds, evaluate the gender of the patients already assigned to a bed in this room. Set as the list of unallocated patients that can be assigned to a bed in the room. If there is at least one female patient already in the room, set as (the list of all female patients that are unallocated and do not have any special conditions) and do Algorithm 2. If there is at least one male patient already in the room, set as (the list of all male patients that are unallocated and do not have any special conditions) and do Algorithm 2.
If there is no patient already assigned to any bed in the room, evaluate the two different options. First, do Algorithm 2 with every bed in the room setting as and evaluate the objective function; then, repeat the process setting as . Compare the objective functions and use the resulting assignment of the scenario with the best objective function.
Algorithm 2. Pseudocode for assigning the best-suited patient for bed ∈ 1: = Best value of objective function for bed ∈ 2: Set the initial value of as 0 3: = Patient that has the best value of objective function when assigned to bed 4: for = 1 to 5: = Value of the objective function calculated for patient ∈ 6: if > and patient can be assigned to bed then 7: = 8: = 9: end if 10: next 11: Assign to bed 12: Remove from

Assigning patients to the Oncology and Pediatric departments
For patients in the Oncology and Pediatric departments, given that these patients cannot be placed in a department different from the one they were assigned to, we use the same process as the one used with patients with no special conditions starting in step number 2 of Algorithm 2 and setting: • For oncology: Let be the list of all male oncology patients that are unallocated and the list of all female oncology patients that are unallocated.
• For pediatric: Let be the list of all male pediatric patients that are unallocated and the list of all female pediatric patients that are unallocated.
Since patients with no special conditions can go to the oncology department, we then evaluate each room of this department and assign patients with no special conditions using the process explained in the section above.

Assigning patients to departments with special conditions: VIP, Isolation, Obstetric, UADO, UADP and Bone Marrow Transplant Hospitalization Service
Given that patients who have been assigned to departments with special conditions cannot be placed in another department, and taking into account that each room at this departments has only one bed or can receive only patients of the same gender (Obstetric and UADP department beds can only be assigned to female patients) we use Algorithm 2 for each department setting U_r as the list of all patients that were assigned to the department and are unallocated. Due to the fact that female patients with no special conditions can go to the obstetric department, we then evaluate each room of this department and assign female patients with no special conditions using the Algorithm 2.

Tabu Search algorithm
Using the initial solution resulting from the greedy algorithm, we then use the TS algorithm as an intensification strategy. TS was proposed by (Glover, 1989) and it is a good metaheuristic because it uses local search (which always provides a feasible solution even after a few moments of calculation) while also adding memory to the search procedure, which allows escaping from local optima (Demeester et al., 2010). The solution of the TS algorithm is the result of iteratively changing small parts of the current solution into a candidate solution by applying neighborhood moves. From this set, the move leading to the best solution is selected and executed, creating a new solution (Demeester et al., 2010). The concept of memory is used to prevent cycling back to previously visited solutions by saving the last applied moves in a tabu list or list of forbidden moves (Gendreau & Potvin, 2010). The search stops when a pre-determined number of consecutive iterations do not show any improvement. In the next section, we describe the three essential elements that should be present in any local search method, as proposed by (Demeester et al., 2010).

The representation of a solution
We represent the solution as an array consisting of two rows. The first row indicates the bed and the second row represents the patient assigned to that bed as shown in Fig. 3. ∈ 7 3 5 2 ∈ 3 14 5 8

Fig. 3. Graphical representation of a solution
The example array represents a scenario where patient 3 is assigned to bed 7 and patient 8 is assigned to bed 2. The patients that were not assigned to a bed in the initial solution given by the greedy algorithm can be included in candidate solutions through the use of "ghost beds". These beds can be assigned to any patient except those who were previously assigned to a bed, but they do not add any value to the objective function. Using these beds allows the TS to evaluate the possibility of assigning a bed to a patient who would not have been admitted in the initial solution.

Neighborhood structure
A neighborhood is made of all solutions obtained by applying a single local transformation to the current solution (Gendreau & Potvin, 2010). We use two different kinds of moves to create different neighborhoods. The first kind of move (type A) is made by swapping the assigned patients between two beds. For this exchange to occur, the candidate solution must be feasible, meaning that each bed must have the features and conditions required by the new patient assigned. In Fig. 5, vector (b) represents the candidate solution created by using a move of type A with positions 1 and 2 of the initial solution represented in vector (a). The second kind of move (type B) is the swap of patients between three beds. Vector (c) shown in Fig. 5 represents the candidate solution created by using a move of type B with positions 1, 2 and 3 of the initial solution represented in vector (a). For this kind of move the candidate solution must also be feasible.

Cost function
The cost function is evaluated with the same parameters as the mathematical linear model.

Partition of the main problem into sub-problems
Given the different nature of each department, the hospital's gender policy, and to avoid using time and computational space evaluating changes that we know from the start will not be feasible, we divided the problem into sub-problems. Each department with a special condition constitutes a different sub-problem, given that they cannot be switched with a patient from a different department. Also, for the department with no special conditions, the problem was solved independently for female patients and for male patients in order to avoid creating candidate solutions with a violation of the gender policy. We used a TS algorithm for each sub-problem independently first using the moves of type A and then evaluating a second TS using the moves of type B.

Tabu search parametrization
To set the value of the parameters used in the TS we proceeded to do an ANOVA. We used the tabu list number (factor 1) and the maximum number of iterations without improvement (factor 2) as the independent variables and the objective function as the dependent variable. The levels selected were (3,5,9) and (30, 60, 100) respectively. The results of the ANOVA were used to evaluate the effect that each factor has in the objective function, as well as the effect of the interaction of both factors. The goal was to find the parameters that produce the best results when executing the TS. The homogeneity of variance and the normality were tested beforehand. The algorithm was executed for 3 instances of different sizes (small, medium and large). The instances were determined as blocking factor. For factor 1, there were no statistically significant differences between group means as determined by the ANOVA (F(2) = 0.99, p = 0.39). We concluded that the tabu list number does not have a significant influence in the objective function. For factor 2, there were statistically significant differences between group means as determined by the ANOVA (F(2) = 4.76, p = 0.02). This indicates that the maximum number of iterations without improvement has a significant influence on the value of the objective function. After performing a post-hoc Tukey test we concluded that there is a difference between the means of the objective function when the maximum number of iterations without improvement is set as 30 and when it is set as 100. The number that produces the best objective function is 100. The interaction of factor 1 and factor 2 does not have a significant influence on the value of the objective function as determined by the ANOVA (F(4) = 0.12, p = 0.97).

Design of a prototype of the application
To facilitate the bed manager's work, we designed a graphic interface using Visual Basic (VBA). This interface, together with the metaheuristic developed, will support bed managers and those involved in bed assignment during the decisionmaking process. This application seeks to reduce the execution time of the process and optimize the match between the patient's needs and the available bed resources. As described by Alshamrani and Bahattab (2015), the software development process is an iterative process composed of a 4-step spiral model life cycle: Planning, Analysis, Design and Evaluation. We applied this methodology to create a user-centered application as shown below:

Planning
Our users (the immediate people who will use the application) are the bed managers, therefore, in order to get to know their current work conditions, we proceed to visit their work stations and to identify the space and assets they have at their disposal (computer, hardware and software, Internet access, etc.). Additionally, we interviewed each one of them to identify the elements, tools, and channels they currently use in the bed assignment process. For the next step, we explained the idea of our application in order to give the bed managers a global idea of the prototype we were planning to design. We then asked them to list the elements they thought were necessary or desirable to include in the design phase of our prototype. We took into consideration all the elements listed.

Analysis
With the analysis of the features mentioned by the bed managers, we identified 5 essential and feasible elements to include at the prototype: • Patients data input to feed a waiting list • A list of available beds at the hospital • A dashboard with the results of the assignment executed • A layout view with the occupied and unoccupied beds • An option for the bed managers to make manual changes to the resulting assignation

Design and development
To include all the features identified during the analysis phase we opted to use multiple screens placed in different tabs following the logical sequence of the process. On the first tab, the user can see all the patients who are currently waiting for a bed and their information. In this tab, they have also a button to add new patients to the waiting list and a button to execute the metaheuristic. This tab has two buttons: "Add New Patient" and "Execute Assignment". When clicking the "Add New Patient" button, the application will open a form where the bed manager must put the patient's personal information, such as name, ID, age, gender, and EPS. Additionally, they must indicate all the patient's needs, such as the department where he/she should be assigned, his/her priority assignment level, his/her mandatory bed features, his/her isolation type required, and his/her special conditions like VIP, scheduled or recommended patient (if applicable). To prevent the entry of wrong information each one of these fields has data validation commands (e.g., mandatory fields, only integer number fields, checkboxes, multiple-choice boxes, and predetermined selection lists). This information is then recorded in an Excel worksheet to generate the database for the waiting patients. Once the parameters have been entered, the assignment can be executed with the recorded data, and if necessary, this information can be modified or deleted directly from the spreadsheet.
On the second tab the user will be able to see the list of available beds at the hospital, its location, the capacity of the room where each bed is located, the gender of the bed according to the gender policies and the bed's type of isolation. After pressing the "Execute Assignment" button the result will be shown at a third tab. In this tab the user will be able to see the assignment of the executed application. For each patient assigned to a bed it will show the service where the bed is located, the number of the bed, the name of the assigned patient and the ID number, EPS, age and gender of the assigned patient as shown in Fig. 6.

Fig. 6. Assignment Execution Results
Additionally, this tab has two buttons: "Patient Exit" and "Modify Assignation". The first button will give the bed manager the option to release a bed when a patient is discharged from the hospital. When saved, the application will automatically add this bed to the available bed list and will remove the patient from the assignment results list.
The second button will give the bed manager the option of modifying the current bed assignment. It is possible that the bed manager does not agree with some of the assignments made to the patients. In this case, the application can exchange patients between two beds or to assign a patient to an available bed. These changes can be made even when a bed does not fulfill all the patients' requirements (this can occur in critical or emergency situations where it is better to admit a patient rather than keep him/her on the waiting list). To reduce the risk of assigning a patient to a bed that does not fulfill all the requirements and to avoid the breach of allocation policies the application will show an alert message to notify the user when any of the cases below happens: -When assigning a patient to a bed that does not fulfill all the patient features requirements.
-When assigning a patient to a bed with lower isolation level than required -When assigning a male or female patient to a bed located in a room of the opposite gender -When assigning a patient who should go to the pediatric, obstetric, oncologic, UADO, UADP or Bone Marrow Transplant department to a different service than the ideal for his/her diagnosis.
Finally, on the last tab, the user will view a selection dashboard where he/she can select any department to access the layout of the beds at each one of them. The layout shows all the available beds and the occupied ones with the information of the patient assigned to each bed.

Testing and Envoirnment
Seven users tested the application. In order to measure its performance and to identify improvement opportunities, we proceeded to design a Likert scale based survey where each bed manager could evaluate from 1 to 5 some key elements requested by the hospital. The average results are shown below:  (colors, layout, typography) 4.71 As we can see in the results obtained from the survey, the graphic interface proposed was considered as easy to understand, use and navigate. Also, the visual presentation obtained a high score. The lowest score was given to the execution time.
The users considered the time as reasonable to perform the assignment when there was a long list of patients during the day. However, their opinion was that it is a long time to wait for short lists of patients that can arrive continuously during the day. To solve this problem, we suggest using the Greedy/Tabu algorithm in the morning when the majority of patients are assigned, and in cases of small changes to data when a new patient arrives and needs to be assigned, the application can run only the Greedy algorithm.

User-Interface Relation
In order to represent and summarize the relationship between the user and the application, we proceeded to create an interaction diagram. The diagram shows the crucial elements of the graphic interface. Fig. 7 presents our users (hospital bed managers) and the resources (hardware and software) and physical space that they have (hospital services management desks). Additionally, the illustration shows the workflow of the activities to be carried out during the process. We identified 5 essential steps to be followed by the user during the process of assigning a patient to a bed when using our application: introduction of patient data, execution of the application (Greedy/Tabu algorithm), intervention and modification of data and results by the user, control and data validation, and presentation and interpretation of the results.

Fig. 7. User-Application Interaction Diagram
It is important to note that each activity is related to at least one of the screens or tabs included in our graphic interface. This way our user is able to interact directly with all of the elements included in our application to facilitate the execution, modification, and interpretation of the information needed during their daily labor giving flexibility and control over the tool.

Performance comparison
After formulating the MILP and designing the metaheuristic procedure, we proceeded to create 15 instances to measure their performance. These instances were generated with randomly created patients and hospitals that have different and specific characteristics taking into account: the coherence between the patient's diagnosis and needs, departments and room capacities, bed features and resources, and the parameter's output based on realistic hospital situations . The results obtained and the execution time when testing the MILP, the Greedy algorithm and the TS on the 15 instances created are shown in Table 4. This table also presents the improvement gap percentage between each pair of methods applied. The results in Table 4 show that, on average, the gap between the value of the objective function obtained with the MILP and that resulting from the Greedy algorithm is 11.38%. When using the results given by the Greedy algorithm as an initial solution for the TS, the value of the objective function improves on average by 5.95%. In conclusion, the gap between the objective function resulting from using the proposed Greedy/TS in comparison with the optimal solution obtained with the MILP is on average 6.21%. Regarding the execution time, we can see that the time needed to obtain a solution with the TS is considerably shorter than the execution time needed for the MILP for medium and large instances. On average, the TS takes 84% less time than the MILP. Moreover, for instances of the same size as the real-life conditions in the hospital, the execution time exceeded thirty minutes, which was the maximum execution time established for the MILP. For these reasons, we conclude that the Greedy and TS algorithms presented in this paper produce adequate solutions in a short amount of time and is therefore a good solution method for the Patient Bed Assignment problem.

Performance Comparisons with Real Instances
To compare the performance of the proposed solution methods with the actual process of assignment performed by the hospital, we collected real-life data from that process in the HUSI. First, we collected the information of the layout of the hospital beds and the features of each bed. Most of the features that the designed algorithms take into account to perform the match between the patient's requirements and the characteristics of the bed were not previously recorded anywhere. Therefore, a meeting with each hospital bed manager was necessary to acquire the information needed. We then asked each hospital bed manager to record the information of the list of patients waiting for a bed each day and the features each patient needed, including the patients who were waiting but could not be assigned. For this purpose, we created a shared drive where all the needed information could be easily recorded. The duration of the data gathering agreed with the hospital was ten days. The key performance indicator that we used to compare the results of the patient-bed assignment done by the hospital bed managers with the solution generated by executing the Greedy and TS algorithms was the assignment accuracy. This indicator evaluates the match between the patient's requirements and the characteristics of the assigned bed. In the MILP and the Greedy/TS the indicator is given by the objective function and we used the same calculation to obtain the indicator for the real-life instances. The assignment accuracy was not previously used by the hospital because the information needed to evaluate this indicator was not easily obtainable. However, it was agreed that this indicator should be measured given that it follows with the hospital's goal of giving the best possible service to the patients. Another indicator that we used was the average occupancy rate. This indicator is currently used by the hospital to evaluate the process and shows how efficient the results are in terms of the resource utilization. The results are presented in Table 5. As we can see in Table 5, the assignment accuracy resulting from using the proposed Greedy/TS is on average 9% better than the results obtained when the assignment was done by the hospital bed managers. This indicates that the algorithm makes good decisions in terms of matching the bed's features to the patient's requirements. Also, the average occupancy rate obtained from the proposed algorithm is 4% lower than that from the current method. The reduction of the occupancy rate can be explained by the fact that bed managers can use alternative resources and strategies to assign additional patients to hospital beds that are not considered in the proposed algorithm. These are very special situations like adapting a bed or room temporarily to increase its level of isolation or meet the necessary requirements, blocking empty beds in a room to receive a new patient that requires strict isolation, assigning pediatric patients to adult beds in case the height is greater than the size of the beds of the pediatric department, among other rare cases that may occur throughout the day. We also compared the average time the process takes when being done by the nine different hospital bed managers and the time it takes to execute the Greedy and Tabu algorithms. The results show that the Greedy/TS takes 10 minutes on average, whereas the process done by the nine hospital bed managers takes one to two hours. As we can see, using the designed algorithm saves time, which is critical for the hospital. Another main difference is that the process can be performed by just one person and gives an overview of the hospital as a whole. This is a great improvement for the hospital given that the assignment is currently executed by nine nurses doing administrative work. These nurses can now be assigned to nursing duties, which translates into a better-quality attention to patients. Also, the lack of an overview may result in an assignment mismatch given that patients may be refused in one department while better available and suitable beds are available in another department.

Concluding remarks, limitations and future work
We have solved the Patient Bed Assigning Problem in the HUSI to maximize the match between the patient's requirements and the characteristics of the assigned beds. Firstly, we proposed a MILP model, but the execution time was too high for those medium and large instances similar to the hospital's conditions. Then, we presented a Tabu Search (TS), with a Greedy Algorithm as initial solution, to solve the problem. The greedy algorithm was used to find an initial solution to the problem, seeking to find the current best patient that can be assigned to that bed. The TS was then used as an intensification strategy. The neighborhood structure for the TS was created by using two different kinds of moves: swapping assigned patients between two beds and swapping assigned patients between three beds. Given the different nature of the different departments in the hospital and the hospital's gender policy, the main problem was divided into sub-problems that were solved independently by the Greedy Algorithm as well as by the TS. Fifteen instances of different sizes were generated to test the results of the Greedy and TS algorithm versus the mathematical model. The results showed that the gap between the values objective function resulting from using the Greedy/TS in comparison with the optimal solution is on average 6.21%. Regarding the execution time, on average, the TS takes 84% less time than the MILP for medium and large instances. Also, for the instances that are the same size as the real-life conditions in the hospital, the execution time for the MILP exceeded the maximum time established. We collected the real-life data of the list of patients waiting for a bed each day for a period of two weeks and compared the results of the patient-bed assignment done by the hospital bed managers with the solution generated by executing the Greedy and TS algorithms. The results showed that the proposed Greedy/TS algorithm is on average 9% better than the results obtained when the assignment was done by the hospital bed managers. A main limitation that we faced during our work was that the features required by each patient are not recorded anywhere. They are determined by the hospital bed manager based on the patient's conditions when he/she arrives to the hospital and are not registered in any database. This made the real-life data gathering increasingly more challenging. Also, through our study it was made evident that as the features needed can vary drastically from one patient to another depending on multiple factors, such as age, gender, illness and medical record, the intervention of a human expert will always be needed. Finally, we can conclude that the hospital bed assignment process can be optimized through the use of this application as it saves time and staff resources, which translates into economic savings for the hospital. It can also provide multiple benefits for the patients as it lets bed managers invest their time on nursing activities instead of administrative ones. Additionally, the algorithm minimizes the reliance on subjective human judgement and the occurrence of error, as it considers bed assignments according to the maximization of the global benefit considering different scenarios to choose the best one possible among them. For future work, we recommend the integration between the hospital's management system and the application designed so that the information needed can be obtained faster and the solution can be implemented faster and more efficiently. Also, we suggest expanding the model for all twenty departments in the hospital so that the assignment can be done with a wider view. We also recommend using the Greedy/TS algorithm for the first assignment of the day and executing only the Greedy algorithm in case of small changes to the data occurring during the day (when few patients arrive at the hospital at the same time) to speed up the execution time taken to run the application. A future research direction, as proposed by Thomas et al. (2013), is to use predictive information about future hospital states, such as forecast unit capacities, within the algorithm, to proactively manage the bed capacity and patient flow. However, they acknowledge that generating predictive information for a complex, dynamic hospital environment in a robust manner is challenging.