Evacuation Path of Patients with Infectious Disease based on Three Algorithms

. With the global spread and deterioration of the coronavirus and monkeypox viruses, how to prevent the spread of infectious viruses in large public enclosed spaces has become a focus of public attention. This paper examined the distinctions between the evacuation of patients with infectious diseases and the evacuation of people in general disaster situations, using the outpatient center of a large hospital in China as the background. The three aspects of a new systematic method that is outlined in-depth step by step for solving this special patient evacuation problem are building the architectural space grid model, determining the objective function, and obtaining and comparing the optimization method. The shortest path is determined as the objective function, and three algorithms, namely the improved genetic algorithm, the traditional ant colony algorithm, and the Dijkstra algorithm, are used to optimize the path. While considering the number of people a ﬀ ected in the evacuation process, and together with the software running time as performance indexes, the results obtained from the three algorithms are evaluated, which shows that the patient evacuation path by Dijkstra’s algorithm is better. This study is of great relevance to hospitals, which gather more groups with low resistance and a higher possibility of virus infection, and it is also applicable to other large public places.


Introduction
When an emergency occurs, such as an infectious disease outbreak like COVID-19 or monkeypox, the challenges of large-scale public place evacuation deepen [1]. As a patient with an infectious virus appears in a large, closed public space with complex structures and a large number of people, such as hospitals and subway stations, the patient should be arranged to an isolation area in a timely manner to avoid greater impact on others, which involves the problem of evacuation. Meanwhile, the evacuation problem discussed in this paper is partially different from the traditional emergency evacuation.
Traditional emergency evacuation refers to the process of pedestrian escaping from unsafe areas, where emergency happens, to safe areas due to real risk factors [2]. Among all types of traditional emergency evacuation, fire evacuation and earthquake evacuation are the two most frequently discussed types.
Evacuation time, number of exits and human factors are important factors to be considered in the establishment of evacuation model. For fire evacuation in traditional emergency evacuation, Yang, P. Z. et al. [3] proposed a discrete design method to reduce time and cost in the simulation of fire emergency evacuation in subway stations and considered the influence of different factors on fire emergency evacuation in subway stations. Yuyu, D et al. [4] took rail transit light rail station as the background to build their BIM building information model, which was used to simulate the emergency evacuation of pedestrians in fire accidents, so as to improve evacuation efficiency. Benseghir, H et al [5] established a crowd dynamics model of industrial buildings under fire spread. The model combines the social force model with the fire dynamics to study the evacuation dynamics of a large single-story building under a single-exit fire. Kaveh, A et al [6] proposed a hybrid evacuation model based on graph theory and a meta-heuristic algorithm, with the shortest path as the objective function. The optimal route of emergency evacuation in case of fire is studied, with more human factors.
As for earthquake evacuation, the study pays more attention to the influence of human factors, including psychological factors and physical conditions [7][8][9][10][11]. Zhou, J. X. et al. established a modified social force model, which can accurately simulate the process of crowd evacuation after an earthquake, based on the quantitative study of earthquake panic coefficient and initial expected velocity calibration. He, J. proposed a completely random evacuation model, which was used to simulate and analyze the evacuation process of multistorey buildings during earthquakes. Dulebenets, M. A. et al. proposed a mixed integer programming model to assign individuals (including vulnerable groups) to emergency shelters via evacuation routes in the time available. Cimellaro, G. P. et al. proposed adding human behaviors into the agent-based model, taking into account the anxiety effect of the crowd when the earthquake occurs and its influence on evacuation delay.
In contrast to traditional emergency evacuation, patients with highly contagious viruses should keep a safe distance from other pedestrians and evacuate alone throughout the entire evacuation process. If we do not pay attention to the evacuation of these patients in the face of such a highly infectious virus, the epidemic will spread further. Controlling of public safety and social stability will also become more complicated [12]. Therefore, research on the evacuation of these kinds of patients, who are infectious virus carriers, has a certain particularity in a certain scene combining building space with the evacuation subject.
Due to the increasing complexity of model optimization, intelligent algorithms are widely used in path optimization [13][14][15][16][17][18]. Taking the emergency evacuation of a scenario earthquake as an example, Haoran, M. et al. set the shortest path as the objective function, proposed an emergency evacuation optimization model based on equivalent length, and used a genetic algorithm to find the optimal evacuation path. An emergency evacuation path selection algorithm based on the quantum ant colony algorithm has been proposed, which avoided the advance convergence and accelerated the convergence to the global optimal solution. Aiming at the emergency evacuation path optimization problem of large public buildings, an improved multi-ant colony algorithm based on a genetic algorithm crossover mutation operator was proposed to find the optimal emergency evacuation path of large public buildings. The Dijkstra shortest path algorithm, which is always used to solve the optimal evacuation path, has been designed to solve the optimal evacuation path by taking the minimum total evacuation time along the route as the objective function.
The above literature shows that the research of traditional emergency evacuation mainly takes the shortest path of evacuation, the shortest time of evacuation, and the number of people evacuated within a safe time as the objective function, establishes an evacuation path optimization model, and uses the optimization algorithm to solve the optimal pedestrian evacuation path under the target.
The primary areas of research in pedestrian evacuation at the moment are path optimization algorithms and the choice of objective functions. According to the different characteristics of evacuation objects, the evacuation path optimization methods are different. Compared with the above-mentioned traditional emergency evacuation, the evacuation of patients with infectious viruses has the following characteristics. On the one hand, the evacuation is targeted at a specific person rather than a group. On the other hand, the objective of evacuation optimization includes the number of people affected by the evacuation path. Finally, evacuated subjects should keep a safe distance from others at all times.
The remaining part of the paper proceeds as follows: Section 2 displays the grid model of architectural space and the evacuation model, including spatial grid definition of evacuation building, evacuation objective function and path optimization method and methods comparison. In Section 3, we examine three features of the evacuation path optimization approach for patients with infectious viruses-using the outpatient department of a sizable hospital in southwest China as a case study. Section 4 makes a comparative analysis of the different results. Finally, the conclusion gives a brief summary and suggestions for further researchare identified.

Research Framework
The traditional girds are often used to represent spatial information and are only used for distance measurement [19]. What makes our new grid model different from the traditional is that the former size is a safe distance rather than a unit distance. Meanwhile, the new grid model not only includes traffic information but can also be used to calculate the total number of people when choosing different paths.
This study designs the objective function according to the architectural space grid model. Since the hospital's outpatient department is taken as the background, this paper selects the shortest path and the minimum number of people affected in the process as the objective functions. At present, the shortest path optimization algorithms include ant colony algorithms [20][21][22][23], genetic algorithms [24][25][26], and the Dijkstra algorithm [27][28][29]. In order to reduce the deviation of optimization results caused by the difference between algorithms, the three algorithms are respectively used to find the optimal solution with the shortest path.
The performance evaluation of the evacuation path optimization method for patients with infectious viruses should be based on three aspects. First, it is necessary to ensure that patients with infectious viruses can be quickly evacuated to the isolation area for isolation, and the evacuation distance should be as short as possible. Second, the optimization path time should also be shortened as much as possible. Third, make sure that the least number of people will be affected by other lines in the process of evacuation so as to reduce the probability of transmission. In order to evaluate the effect of the three models on the evacuation of patients with infectious disease, we chose three evaluation indicators, which includes the length of the evacuation path, the number of affected people, and software planning time.

Grid Model of Architectural Space
The building layout is divided into squares of uniform scale in space. According to the actual situation of the building space, the grid (see figure 1) is constructed, in which the black grid is the obstacle (impassable area) of the building space, and the white grid is the passable  According to the COVID Prevention and Control Guidelines for Offices and Public Places, 2020, issued by the Health Commission, the safe distance between people should be 1.5m to 2m. In response to such infectious diseases, the square side length is set to 2m × 2m.
(2) Grid Information Coordinate information about people or objects is a type of frequently used grid information ( [30][31][32]), which is used to calculate the spatial path of evacuees. In order to estimate the impact on people around during the transfer process, in this paper, the constructed grid information not only includes spatial coordinate information but also includes the flow of people at a certain time.
The grids are numbered from left to right and from top to bottom. H k (k=1,...,n) represents the Kth grid, which H 1 is set as the starting point and H n as the ending point; (x k ,y k ) represents the grid center point coordinate information; s k represents the attribute parameter of human flow. When the side length of each grid is 1, the coordinates of the corner points of the ith grid are shown in figure 2.
The transformation relation between grid H k and its central coordinates(x k ,y k ).
where m and n are the number of rows and columns of the grid, respectively. There are two functions, mod and ceil, mentioned in the two formulas above. Mod represents the remainder of k divided by n. Ceil means an integer part reserved in the direction of positive infinity. The center distance between square H i and H j is expressed in Eq. (3).

Evacuation Model
Taking the shortest path and the minimum number of people affected as the objective functions, the algorithms were used to optimize the path respectively. The objective functions are: where u H i H j is 0-1 variables, that 1 means the distance d H i H j from H i to H j is selected, 0 means no selection. The dependent variable F 1 represents the path distance, F 2 represents minimum number of people affected during evacuation. The adjacency condition of H i and H j in the above objective function is: (1) Path optimization by Genetic algorithm Genetic algorithm (GA) is a method to find the optimal solution by simulating the natural evolution process. Basic genetic algorithms include the following operations: species estimation, selection, crossover, and mutation [33]. When each path contains a different number of grids, however, genetic crossover cannot generate offspring, i.e., crossover heterogeneity. In order to avoid this situation, the first step we need to take is to determine the key grids. The whole flow chart of the genetic algorithm is shown in figure 3. And there are three principles when selecting the key grids. First, the grids in the area with barriers cannot be selected. Second, when encountering an intersection, the grid must be set as a key grid. Third, since the start and end grids have been already determined, the key grids should be set along the end as far as possible to avoid adding unnecessary iterations. Then the connection between key grids is taken as the feasible evacuation path, and the optimal path is further obtained through optimization [34]. The steps are shown in figure 3.
Step 1. Identify the key grids. Observing all positions of squares in the architectural space grid diagram, key grids are selected by the principles mentioned above.
Step 2. Encode the key grids set. Starting from 1, renumber the selected grids, one by one. The initial population consists of the renumbered key grids. Generate the initial population LH R (k = 1, ..., l), which represents the feasible path R.
Step 3. Calculated the fitness. The fitness values C − F r , where C is a constant and F r is the length of rth path, r=1,2, ..., n.  Step 4. Select. The next generation of individuals is determined by using the roulette algorithm to generate a random value and compare its relationship with the cumulative relative fitness.
Step 5. Copy, crossover and variation. Use the crossover method, which is different from the traditional genetic algorithm (see figure 4) to cross the next generation of individuals. Then use the exchange variation method to mutate the next generation of individuals.
Step 6. If the answer whether it converges to the optimal solution is yes, then output the solution; otherwise, go back to Step 3 until the end of the iterations.
(2) Path optimization by Ant colony algorithm Ant colony algorithm (ACO) is based on the concentration of information left by the previous generation of ants to determine the next grid choice, so ants could make a decision that the next grid was chosen one by one.
Ant colony algorithm is a simulation optimization algorithm to simulate ant foraging behavior [35,36]. The basic principles are as follows: first, ant releases pheromones along the 6 E3S Web of Conferences 409, 06009 (2023) ICMSEM 2023 https://doi.org/10.1051/e3sconf/202340906009 path; second, when encountering an untraveled intersection, it randomly selects a direction to go and releases pheromones related to the length of the path; third, the pheromone concentration is inversely proportional to the path length, then the next ant encounters the intersection here and chooses the path with a higher pheromone concentration; fourth, the concentration of pheromones on the optimal path increases; fifth, the colony eventually finds the optimal feeding path.
Step 1. Parameters setting. A is the starting point, and T is the end point. α and β are the relative importance of pheromone and heuristic information. Q is the deposition constant, ρ is the rate of evaporation and τ i j is the pheromone between grid H i and grid H j . d H i H j is the distance between grid H i and grid H j , and F R is the total length of the constructed path.
Step 2. Generation of initial path. Set the start and end of the path, and set the pheromone equivalent for all viable grids. The next step is selected in the form of roulette, and the probabilities are calculated as follows: Where C r is the set of ant r passing through the grid, and p (r) (HiHj) is the probability that the rth ant chooses H i to H j . If the ant reaches the end point, record the path; otherwise, search again.
Step 3. Path optimization. The change in pheromone and the update pheromone can be represented as Eq. (9) and Eq. (10).
By updating pheromones continuously, the colony selects a grid set with a large amount of pheromones to form a path.
Step 4. After the iteration, decide the optimal path. (3) Path optimization by Dijkstra algorithm Dijkstra algorithm is often used to find the shortest path between nodes in a graph based on dynamic programming [37,38]. Known as dynamic programming, it is often used to solve the shortest path from the beginning to the end of a single node network graph. Therefore, grids in the grid graph are regarded as nodes in the single node network graph in this paper, and the distance between each square in the grid graph and its adjacent grid center point is the distance between nodes in the network graph. Then the grid graph is transformed into a network graph.
After numbering the squares in the grid, it is transformed into a node network diagram, where the weight on the node represents the distance d H a H b of adjacent squares on the grid, The essence of Dijkstra algorithm is dynamic planning in operations research. The shortest path is naturally generated while node selecting.

Case Description
This paper adopts the first-floor building plan of a large outpatient clinic in southwest China (see figure 6) for analysis. Transforming the architectural plan into a grid diagram for establishing the grid model mentioned in 2.2. In figure 7, the green point is the main exit for patients without infectious viruses and their families in order to reduce the probability of virus transmission. The red point is set for the exit for patients with infectious viruses, in consideration of avoiding large human flows during the evacuation process. This paper collected the data on the flow of people from 8 a.m. to 9 a.m. in this large outpatient clinic.

Result Analysis
(1) Genetic algorithm path optimization results According to the genetic optimization model proposed in 2.2.1, nineteen key grids were extracted and were numbered 1, 2, ..., 19. Since the side length of each square is set to 2m, the distance between each key square can be derived according to the calculation of the inter-grid distance in 2.2.2. The node network diagram of key squares is obtained by taking the key squares as nodes and the distances between squares as weights, as shown in figure 9.      As can be seen from the optimal path in the figure above, however, it will be disturbed by obstacles when passing the second and sixth nodes. Therefore, further optimization is needed and the result is shown in figure 11.
(2) Ant colony algorithm path optimization results In order to better compare the difference between the results of the algorithms, we will set the same maximum number of iterations and evacuation flow. The results obtained by using ant colony algorithm are shown in figure 12 and figure 13.
As can be seen from table 1, when the number of iterations is 200 and the population is 200, the length of the evacuation path is shortest. At the same time, the number of people who may be affected is also the most satisfactory result of all.    (3) Dijkstra algorithm path optimization results The single-node network diagram is similar to figure 8 in Section 3.2.1. And the difference is that in Dijkstra algorithm, each grid is a node. Dijkstra algorithm will naturally generate the optimal path (see figure 14) in the shortest time with continuous node selection.

Comparisons of models' results
The optimal path selection criterion we set in this paper is the distance of the path and the number of people affected. The results obtained by the three algorithm models are listed in table 2 in terms of path distance, evacuation flow, and software run time. And the three models are compared in terms of their characteristics and optimality.
Among the three models, the distance obtained by the genetic algorithm is optimal, but the flow of people on the evacuation path is also the largest, which is likely to cause congestion at the exit. Relatively speaking, the model with the minimum human flow in the evacuation process is the ant colony algorithm model, which also gets the result that the distance of the evacuation path is the largest. At the same time, there are problems in this model, such as the appropriate number of iterations and the difficulty of population determination, which will be further explained in the model characteristics. The results of distance and human flow obtained by Dijkstra algorithm are both at a medium level.
The common point between genetic algorithm and ant colony algorithm is that both use roulette to select the next grid. And the difference is that, compared with ant colony algorithm, genetic algorithm cannot make decisions for each grid as ant colony algorithm does. For different architectural spatial models, GA needs to set up key grids in advance, which is more complicated than using the ACO algorithm directly. Since ant colony algorithm makes choices based on probabilities, however, it is possible to make choices far from the end point while selecting. For example, the result by ant colony algorithm with 200 iterations and the population number of 300 did not directly go to the end when approaching it, but chose the longer evacuation path. The results of ant colony algorithm will be different with different iterations or different population numbers. In addition, increasing the number of iterations or population does not necessarily mean that the obtained path distance and the number of people evacuated will decrease at the same time. It can be seen that ant colony algorithm cannot find a fixed satisfactory solution. It needs to constantly update the parameters and continuously test them. As for the genetic algorithm, when the number of iterations is 100, the results obtained by adjusting the number of different populations are the same. Increasing the number of iterations further still gives the same result, indicating that the genetic algorithm has a certain stability and a satisfactory solution can be found easily under such conditions. Among the three algorithms, Dijkstra algorithm shows the shortest running time and can quickly find the path with the shortest distance of evacuation path. But the algorithm itself has some limitations. When selecting the next grid, only the grid in the four adjacent directions can be selected, and no other grids can be selected. Overall, from the perspective of dynamic programming, Dijkstra algorithm can find the optimal solution well when the number of grids is not too large.

Application Suggestions
Based on the analysis of the three models above, it has been found that the three algorithms have their own advantages, which then need to be considered in combination with the actual situation. When a patient with an infectious virus is found, the evacuation path distance and the number of people who are affected during the evacuation are the most important aspects.
According to table 2, the software running time of Dijkstra algorithm is 234.6 times and 243.43 times faster than that of the other two algorithms. Compared with the other two indexes, the distance of evacuation path and the evacuation flow, the results of Dijkstra algorithm are in the middle and not much different from others. Therefore, Dijkstra algorithm can obtain a relatively satisfactory conclusion in such a case when facing with a sudden occurrence. But on the other hand, the limitation of Dijkstra algorithm is that there is a possibility of getting stuck in infiniteness. For example, the destination is in the northeast direction of the start. With the current algorithm in this case, the right and top grids will be selected preferentially. Even if the left or bottom grid is selected without the right or top grid, the right or top grid will be re-selected in the next step according to the algorithm, returning to the position of the previous step, which means the solution cannot be found with the Dijkstra algorithm.
Further research will focus on how to optimize ant colony algorithm to better determine the number of iterations and population, and how to improve the optimization effect in genetic algorithm to avoid obstacles in the architectural grid diagram.

Conclusion
Based on the possible emergencies in reality, this paper takes a large public place with strong aggregation, the outpatient department of a hospital, as an example to establish an architectural spatial grid model, and takes the most enclosed grid in the whole floor as the starting point of evacuation. Three algorithms are adjusted with special techniques to fit for deriving the optimal path results, respectively. The comparative analysis result shows, Dijkstra algorithm has better performance for patient evacuation in a closed space. For emergencies, hospitals can respond through simulation drills, but this is costly and hinders the normal operation of hospitals. Therefore, it is of great practical significance to use the data collection of human flow to simulate and make plans for evacuation in advance in case of emergencies.
In addition, further discussion on human emotions is needed. An assumption is made for human emotion in this paper that the crowd in hospitals can remain relatively calm during a disaster. But the crowd can be divided into several states, like calm people, managed people, and confused people. Thus, further optimization of the path can be discussed based on human factors.

Declaration Statements
Data was obtained from West China Hospital of Sichuan University. In this study, all adopted methods were permitted by Sichuan University. All the used methods were conducted according to relevant guidelines and regulations, and scientific rigor was always maintained.

Consent for Publication
We hereby authorize the publication of the entire text, including any pertinent textual information, in the journal and in the article.