Abstract
During recent years, the outpatient scheduling problem has attracted much attention from both academic and medical fields. This paper considers the outpatient scheduling problem as an extension of the flexible job shop scheduling problem (FJSP), where each patient is considered as one job. Two realistic constraints, i.e., switching and preparation times of patients are considered simultaneously. To solve the outpatient scheduling problem, a hybrid imperialist competitive algorithm (HICA) is proposed. In the proposed algorithm, first, the mutation strategy with different mutation probabilities is utilized to generate feasible and efficient solutions. Then, the diversified assimilation strategy is developed. The enhanced global search heuristic, which includes the simulated annealing (SA) algorithm and estimation of distribution algorithm (EDA), is adopted in the assimilation strategy to improve the global search ability of the algorithm.?Moreover, four kinds of neighborhood search strategies are introduced to?generate new?promising?solutions.?Finally, the empires invasion strategy?is?proposed to?increase the diversity of the population. To verify the performance of the proposed HICA, four efficient algorithms, including imperialist competitive algorithm, improved genetic algorithm, EDA, and modified artificial immune algorithm, are selected for detailed comparisons. The simulation results confirm that the proposed algorithm can solve the outpatient scheduling problem with high efficiency.
Keywords
Introduction
Hospitals are critical elements of health care systems and access to their services is very competitive around the world. As the core department of the hospital, outpatient service is considered as the “facade” of the hospitals, accounting for a large proportion of hospitals’ expenditures and profitability. Outpatient service, however, is very challenging due to its conflicted preferences and priorities from many stakeholders and limited resources to meet the needs. In response, scheduling is introduced to optimize outpatient visits [1].
Scheduling problems have been investigated in recent years and have been utilized in many practical problems. One of the most difficult problems in this area is the job shop scheduling problem (JSP). However, a type of classical JSP that is similar to a real-world manufacturing situation is called the FJSP [2]. There are lots of meta-heuristic algorithms which have been proposed to solve the FJSP, such as the genetic algorithm (GA) presented by Chen et al. [3] which can find the global optimal solution of the optimization problem. The imperialist competitive algorithm (ICA) proposed by Atashpaz-Gargari [4] with fast convergence speed, high convergence accuracy and strong global convergence. The particle swarm optimization algorithm investigated by Boukef et al. [5] with strong robustness. Luo et al. [6] presented the multi-objective grey wolf optimization algorithm with strong convergence performance, few parameters and easy to implement. Furthermore, Li et al. [7] studied an improved multi-objective algorithm for realistic distributed scheduling problems to minimize two objectives. Du et al. [8] proposed a hybrid estimation of distribution algorithm for distributed FJSP where makespan and total energy consumption are considered as objectives. Cao et al. [9] presented a knowledge-based cuckoo search algorithm to the FJSP with a mating operation, in which a reinforcement learning algorithm with self-adjusting parameters is used to solve the problem of parameter selection.
In recent years, much attention has been paid to the outpatient scheduling problem. Zhu et al. [10] transformed the designated bidding method into a group role assignment problem to solve the outpatient scheduling problem. By analyzing some scenarios that study the tradeoff between patient-related measures and doctor-related measures or system-related measures, a Markov decision model is proposed to determine the optimal outpatient scheduling problem [11]. Geng and Xie [12] proposed a finite-horizon Markov decision process model for optimal outpatients scheduling by considering their waiting time target, i.e., the maximal waiting time the patient can endure. Creps and Lotf [13] proposed a dynamic approach for outpatient scheduling where patients are expected to have multiple appointments, such as physical therapy, occupational therapy, primary care, and dentistry. Deceuninck et al. [14] studied outpatient scheduling with unpunctual patients and no-shows and introduced a numerical methodology for the evaluation of outpatient schedules to obtain accurate performance predictions at a low computational cost. Sun et al. [15] established the optimal appointment schedule in outpatient-inpatient hospital system to minimize the total cost of outpatient waiting time, radiology equipment idle time, day shift staff overtime, and the number of inpatient exam cancellations during the day shift. Li et al. [16] propose an integrated optimization approach for patient-centered outpatient scheduling to improve patient satisfaction.
From previous studies, it can be found that outpatient scheduling has been studied extensively, but most of the studies are general and consider the outpatient scheduling process as a whole. Therefore, it is not suitable for practical application. This study systematically analyzed the whole process of outpatient scheduling problem, including the selection of medical resources at each stage and the time consumption between different stages, so as to make effective outpatient scheduling in advance. During the novel Coronavirus epidemic period, effective outpatient scheduling can promote hospital personnel mobility, reduce potential risks and promote the effective use of resources.
Keeping the above consideration in mind, this study proposes a hybrid ICA, named HICA, to solve the outpatient scheduling problem with switching and preparation times. Our main contributions are as follows: (1) the mutation strategy with different mutation probabilities is utilized to generate feasible and efficient solutions; (2) the diversified assimilation strategy is developed; (3) the enhanced global search heuristic, which includes the simulated annealing (SA) algorithm and estimation of distribution algorithm (EDA), is adopted in the assimilation strategy to improve the global search ability of the algorithm;(4) four kinds of neighborhood search strategies are introduced to generate new promising solutions; and (5) the empires invasion strategy is proposed to increase the diversity of the population.
The rest of the paper is organized as follows. The problem formulation is described in Section 2. Then, Section 3 describes the proposed algorithm with all of the components. The simulation tests and analysis are presented in Section 4. Finally, Section 5 gives the conclusions and future research directions.
Problem description
Problem description
Considering a realistic process in a typical outpatient scheduling system, as shown in Fig. 1, the patient is generally considered as scheduling unit. The process considers different stages, including registration, consultation room, and so on. Each patient has its own route dynamically assigned according to the current medical device state; that is, the route differs for different patients. In each stage, each patient selects one medical resource from the candidate medical resource set; medical resource selection is thus flexible. Based on the above analysis of the outpatient scheduling problem, we can model this scheduling as an FJSP, in which the patients are treated as jobs.

Outpatient scheduling process.
There are a set of patients J ={ J1, …, J n } and a set of medical resources M ={ M1, …, M m }. Each independent patient J j contains n j stages of seeking medical treatment Oj,q, where q = 1, …, n j . Each stage can be processed by a set of medical resources in a certain sequence. Then, the two realistic constraints, i.e., the switching and preparation times of patients are considered. Furthermore, considering the time it takes for the patient to arrive at the first medical resource, a dummy medical resource with zero processing time, say medical resource 0, is defined.
The assumptions in this study are described as follows: All patients are ready at time zero. Each patient has a given number of stages of seeking medical treatment. Each stage of seeking medical treatment can only be processed by an available medical resource. Pre-emption is not feasible, which means each stage of seeking medical treatment must be fulfilled without interruption as soon as it initiates. All the stages of seeking medical treatment belonging to the same patient should be processed one after another in a fixed order. The status of medical resources is known before scheduling begins. The switching and preparation times of patients are considered.
The notations used in this section are described in Table 1. The position-based mathematical model which considers the position of the patient on the medical resource is developed. The objective is to minimize the makespan of the outpatient scheduling. Therefore, the objective function can be expressed as:
Notations definition
The objective function is to minimize the makespan. Constraint (2) represents that the first stage of every patient is exactly assigned to one position of one available medical resource. Constraint (3) guarantees that every stage (except the first stage) should be allocated to only one position of one medical resource among all of the available medical resource. Constraint (4) guarantees that each position of each medical resource is occupied once. Constraint (5) enforces that every stage (except the first stage) of seeking medical treatment of each patient should be processed on the feasible medical resources. Constraint (6) enforces that the first stage of seeking medical treatment of each patient should be processed on the feasible medical resources. Constraints (7) and (8) guarantee that Oj,q-1 is processed by medical resource k when Oj,q is processed by medical resource i. Constraints (9) and (10) are logical precedence constraints that take into account the switching and preparation times of patients. The completion time of the latter stage is greater than or equal to the completion time of the previous stage of the same patient. While ensuring that each medical resource deals with only one stage of patient at a time, constraints (11)-(18) describe that the completion time of the later stage is greater than or equal to the completion time of the previous stage of the same resource. Constraint (19) defines the makespan, and constraint (20) defines the values of the decision variables.
Framework of HICA
To solve the outpatient scheduling problem in hospital systems, we propose a hybrid ICA, named HICA. The HICA is based on the ICA. ICA consists of mutation, assimilation, imperialist competition, and so on. The main features of the HICA are as follows: (1) the mutation strategy with different mutation probabilities is utilized to generate feasible and efficient solutions, which is described in Section 3.4; (2) the diversified assimilation strategy is adopted, which is described in Section 3.5; (3) the enhanced global search heuristic, which includes the SA algorithm and EDA, is developed in the assimilation strategy to improve the global search ability of the algorithm, which is presented in Section 3.6; and (4) the empires invasion strategy?is?proposed to?increase the diversity of the population, which is presented in Section 3.9. The framework of the HICA is shown in Algorithm 1.
1: Generate initial population
2: Construct the initial empires, select Nim best individuals from population as imperialists
3:
4:
5: Conduct the mutation strategy with different mutation probabilities (c.f. Section 3.4)
6: Perform the diversified assimilation strategy (c.f. Algorithm 2)
7: The enhanced global search heuristic is used (c.f. Section 3.6)
8: Update the empires (c.f. Section 3.8)
9: Execute the empires invasion strategy (c.f. Section 3.9)
10:
11:
Encoding scheme
Encoding explains how to represent a real solution. In this paper, we use the encoding scheme proposed by Zhang et al. [17]. The solution consists of two parts: medical resource selection (MRS) and the treatment stage sequence (TSS), as illustrated in Fig. 2. The MRS part stores the available medical resource number, while the TSS part contains the patient number. Moreover, in the MRS part, the local selection was adopted. In the TSS part, the sequence of all the stages is randomly determined.

Representation of a solution.
In the HICA, countries with better fitness values are imperialists and others are the colonies of these imperialists. The population size (Pop) includes several imperialists (Nim) and their colonies (Ncl), that is an empire includes an imperialist and its colonies. The number of colonies in each empire is expressed as NCx, where x =1, 2,..., Nim.
The roulette wheel selection procedure is used to calculate the power of each imperialist as
Mutation is a strategy adopted by imperialists to reduce duplication and increase diversity of solutions. Through many experiments, it could be found that the higher the fitness, the better the solution can be obtained by mutation. Therefore, the probability formula of mutation is described as follows:
We use different mutation methods depending on the component. For the MRS part, mutation is performed by randomly changing the available medical resource of the relevant stage. For the TSS part, the crossover operator is conducted. The mutation process is illustrated in Fig. 3.

The mutation procedure of algorithm.
Assimilation strategy is the main strategy to produce new solutions. Generally, the strategy is implemented in the same way. In this study, the diversified assimilation strategy is adopted. For the Empire 1, there are two strategies: (1) all the colonies in the empire adopt the assimilation strategy, (2) randomly select colonies to perform the assimilation strategy. For the remaining Empire x, the assimilation strategy is conducted by learning from any other imperialists.
In the process of assimilation, for the MRS part, the two-point crossover strategy is adopted. First, two points of the imperialist are selected randomly. Then, the elements between the two points are inserted into the corresponding positions of the new colony, and the remaining positions insert the elements of the old colony. For the TSS part adopts the POX crossover strategy. First, several elements are selected at random. Then, the elements selected from the imperialist are inserted into the new colony, and the remaining elements are inserted into the new colony according to the position of the old colony. In the assimilation strategy, the enhanced global search heuristic which includes the SA algorithm and EDA is adopted to improve the global search ability of the algorithm. The main steps of assimilation are displayed in Algorithm 2.
1:
2:
3: r = rand () % 2
4:
5: All colonies in the Empire 1 are chosen for assimilation
6:
7:
8: Randomly select colonies for assimilation
9:
10:
11: if x >1&x <Nim
12:
13: Each colony in the Empire x can learn from other randomly selected imperialist and performs assimilation strategy with the chosen imperialist
14:
15: The enhanced global search heuristic is used, that is
16: ⌊α× NC x ⌋ good colonies improve by SA
17: ⌊β× NC x ⌋ poor colonies improve by EDA
18:
19:
Enhanced global search heuristic
Simulated annealing algorithm
Simulated annealing (SA) algorithm as an intriguing technique for optimizing functions of various variables. The basic algorithm of SA may be described as follows: Beginning with a high temperature (T), the metal is slowly cooled, so that the system is in thermal equilibrium at every stage. At high temperatures, the metal is in liquid phase, and the atoms of the system are disordered and arranged randomly. By gradually cooling the metal, the system becomes more ordered, until it finally reaches a “frozen” ground state (ΔT), where the energy of the system has acquired the globally minimal value.
To overcome the problem of stagnating in local optima, SA utilizes a certain probability to accept a worse solution. The algorithm starts with a randomly generated solution (initial solution). In each iteration, the best neighborhood solution is generated according to the two randomly selected neighborhood structures in Section 3.7.
Annealing rate is another important module of the SA. Annealing rate has a significant relation with the acceptance probability of inferior solutions, which can directly affect the speed and accuracy of the SA. The SA algorithm terminates when the temperature recedes to the specified temperature. The annealing rate function is as follows:
1:
2:
3: Execute the neighborhood structure to create a new solution, as discussed in Section 3.7
4:
5: Accept this new solution
6:
7: Calculate the probability of accepting the new solution (rr) [18], accept the new solution with the probability of rr
8:
9: Update the current temperature by (24)
10:
11:
Estimation of distribution algorithm (EDA) is a relatively new paradigm in the field of evolutionary computation, which employs explicit probability distributions in optimization.
In this paper, two probability matrices P1 and P2 are designed for the MRS and TSS parts. The element Mj,q,i (L) of the probability matrix P1 represents the probability of processing stage Oj,q is processed by medical resource i in generation L. mj,q represents the array of available medical resources for the q
th
stage of seeking medical treatment of patient j. The probability matrix P1 is initialized as follows:
1:
2:
3: A new solution is generated from random sampling of the probabilistic models P1 and P2
4: Compare the newly generated solution to the previous one
5:
6: Accept this new solution
7:
8:
9:
The neighborhood structures N1, N2, N3, and N4 are described below. Neighborhood structure N1 is performed by replacing a randomly selected position of the MRS part. Neighborhood structure N2 acts on the TSS part, selecting two elements in a random manner and swapping them. Neighborhood structure N3 is performed by selecting two positions r1 and r2 at random, where r1 < r2, the element of r2 is inserted before r1 in the MRS part. Neighborhood structure N4 generates a new solution by performing one swap operator two times in the TSS part (Fig. 4).

Examples of neighborhood structures.
Through the iterations, colonies may obtain greater power than their imperialists. In this case, the colony with greatest power becomes the new imperialist, colonies under the old imperialist are assigned to the new imperialist, and the old imperialist becomes a colony of the new imperialist. Then, the worst empire is updated by EDA.
Empires invasion
With the development of the empire, great changes will occur in each empire. To gain more power, some empires may conduct empires invasion strategy, that is, powerful empires occupy several colonies of other weak empires. Provided that colonies under the rule of the imperialist no longer exist, and the empire perished. The main steps of empires invasion strategy are shown in Algorithm 5.
1: Select the better empires which with the better fitness
2:
3: Occupy the colonies of poorer (unselected) empires randomly
4:
5: Ascribe the imperialist of the empire to other empires
6:
7:
Simulation analysis
This section evaluates the effectiveness of the proposed HICA on the outpatient scheduling problem. The compared algorithms are coded in C++ on a Lenovo PC with a 3.3-GHz processor and 4-GB memory running Windows 7. Before the experiment, five different cases in a large third-class hospital were analyzed within one week. According to the research problem, through analysis, the data obtained are used in the experimental instances, and the experiment is carried out. After the experiment, the outpatient scheduling schedule is obtained, and the schedule established in advance is applied to outpatient scheduling.
Sensitivity analysis
To study the influence of some important parameters on the value of the objective function, four parameters, the country size (pop), the ratio of the imperialist to countries (Nim/pop), the ratio of good colonies improved through SA (α) and the ratio of poor colonies improved through EDA (β), are selected to conduct the sensitivity analysis, and the results are shown in Fig. 5.

Sensitivity analysis on important parameters.
From Fig. 5, it can be found that the objective function has a downward trend at first and then an upward trend with the parameter pop. The objective function has a downward trend at first and then an upward trend with the parameter Nim/pop. For parameter α, the objective function first showed a downward trend and then an upward trend in the selection interval. For parameter β, at first the objective function has a descending trend then it arrives to a stable state.
To verify the quality of the proposed algorithm for solving the outpatient scheduling problem, this section compared HICA and CPLEX. The settings for the exact solver are as follows. The maximum number of threads was 3, and the time limit was set to 3 h. For the HICA, due to its ability to obtain a satisfactory solution within an acceptable time, the CPU stop time was set to 30 s. Then, 15 small-scale instances of outpatient scheduling problem were randomly generated.
With an increase in the number of patients and stages, there is an exponential increase in time to solve the problem to optimality on CPLEX because of the NP-hard property. Thus, for some large-scale instances, the optimal solutions cannot be obtained on CPLEX within 3 h. Table 2 presents the comparison results between the proposed algorithm and the CPLEX solver. The first column lists the instance name (where jXmY represents X patients and Y stages), the second column displays the best fitness values for each instance. The fitness values for each instance are provided in the third and fourth columns, while the fifth and sixth columns provide the deviation of the objective value of each algorithm compared with the best value.
Comparison results for the CPLEX solver and HICA
Comparison results for the CPLEX solver and HICA
To verify the effectiveness of the proposed mutation strategy, we performed detailed comparisons of the two algorithms, namely, the algorithm with all of the components of the proposed HICA except for the proposed mutation strategy (hereafter called the HICA_NMS) and the proposed HICA with all of the components. Each calculation instance was executed 30 times independently, each for 30 s. To determine whether the resulting comparisons were significantly different, we performed a multifactor analysis of the variance (ANOVA). The confidence level was set to be 95%. When the p-value was less than 0.05, the difference between the algorithms was significant. Figure 6 shows the ANOVA results obtained by comparing the two algorithms. It can be concluded from Fig. 6 that the proposed mutation strategy can increase the probability of the algorithm to obtain a better solution.

ANOVA of the mutation strategy.
To investigate the effectiveness of the diversified assimilation strategy, three variants of HICA were constructed: (1) HICA1 did not include the SA strategy, but the remainder of the content was consistent with the HICA; (2) the difference between HICA2 and HICA was that the EDA was eliminated from HICA; (3) and HICA3 with the canonical assimilation strategy as described in [19]. Each calculation instance was executed 30 times independently, each for 30 s, and the results were obtained. Figure 7 presents the ANOVA results obtained by comparing the four algorithms. It can be concluded from Fig. 7 that the proposed diversified assimilation strategy can obtain significantly better results.

ANOVA results of HICA and its variants.
The empires invasion strategy discussed in Section 3.9 is another contribution to the proposed algorithm. To evaluate its performance, we compared the following two algorithms: HICA_NEI with all the components except the empires invasion strategy and HICA with all components discussed in Section 3. All other components of the two compared algorithms were identical. Figure 8 provides ANOVA comparisons of the two algorithms. The figure indicates that there are significant differences between the compared algorithms, and the proposed empires invasion strategy enhances the performance of the proposed algorithm.

ANOVA of the empires invasion strategy.
To further evaluate the performance of the proposed HICA, we selected the following algorithms for comparison: ICA (Karimi et al. [19]), improved GA (IGA) (Zhang et al. [20]), EDA (Zhao et al. [21]), and modified artificial immune algorithm (MAIA) (Zeng and Wang [22]). For fair comparison, all algorithms were run for 30 s in the same running environment. The average fitness values for each instance were collected for detailed comparison (Table 3).
Comparison results of multiple algorithm
Comparison results of multiple algorithm
Figure 10 presents the ANOVA results of the average solutions of the five comparison algorithms, from which it can be concluded that the HICA has better performance in solving the studied problem. Furthermore, to demonstrate the convergence ability of the proposed algorithm, we conducted detailed comparisons between the HICA and other four algorithms, and the convergence curves for the four instances with different features are depicted in Fig. 9(a)-(d).

Convergence comparison between multiple algorithms.

ANOVA results for comparing multiple algorithms.
As the core department of the hospital, outpatient service is regarded as the facade of the hospital, which accounts for a large proportion of the expenditure and profit of the hospital. Due to the growing demand for outpatient appointments and a serious shortage of medical staff, outpatient scheduling has been highly valued in many countries. For many general hospitals, outpatients account for 3/4 of outpatients. Especially during the epidemic period of novel coronavirus, effective outpatient scheduling plays a more and more important role. Effective outpatient scheduling can promote the flow of hospital personnel, reduce potential risks and promote the effective use of resources.
This study addresses the outpatient scheduling problem with switching and preparation times. The problem is an extension of the FJSP. To solve the problem, the HICA is proposed. In the proposed algorithm, first, the mutation strategy with different mutation probabilities is utilized to generate feasible and efficient solutions. Then, the diversified assimilation strategy is developed. The enhanced global search heuristic, which includes the SA algorithm and EDA, is adopted in the assimilation strategy to improve the global search ability of the algorithm. Furthermore, four kinds of neighborhood search strategies are introduced to generate new promising solutions. Finally, the empires invasion strategy is proposed to increase the diversity of the population. In the experimental part, first, the influence of the important parameters of the algorithm on the objective value is obtained by sensitivity analysis. Then, the validity of the model and algorithm is verified by CPLEX. Furthermore, the effectiveness of the algorithm strategy is verified. Finally, the algorithm is compared with other algorithms to further verify the effectiveness of the developed algorithm.
In the course of study, the patient visit time, switching and preparation times, were set in advance. In real life, due to a variety of uncertain factors, these times may change, which will result in a time difference between the scheduled completion time and the real scheduled completion time. Therefore, the future work will focus on the following aspects: (1) using fuzzy numbers to express the time of each stage; (2) considering the insertion and handling of acute patients; and (3) improving the balance of the exploitation and exploration abilities of the proposed algorithm.
Footnotes
Acknowledgments
This research is partially supported by National Science Foundation of China under Grant 61803192, and 61773246, Shandong Province Higher Educational Science and Technology Program (J17K Z005), and major Program of Shandong Province Natural Science Foundation (ZR2018Z B0419).
