Research on Path Planning Algorithm for Crowd Evacuation

: In recent years, crowded stampede incidents have occurred frequently, resulting in more and more serious losses. The common cause of such incidents is that when large-scale populations gather in a limited area, the population is highly unstable. In emergency situations, only when the crowd reaches the safe exit as soon as possible within a limited evacuation time to complete evacuation can the loss and casualties be effectively reduced. Therefore, the safety evacuation management of people in public places in emergencies has become a hot topic in the ﬁeld of public security. Based on the analysis of the factors affecting the crowd path selection, this paper proposes an improved path-planning algorithm based on BEME (Balanced Evacuation for Multiple Exits). And pedestrian evacuation simulation is carried out in multi-exit symmetrical facilities. First, this paper optimizes the update method of the GSDL list in the BEME algorithm as the basis for evacuating pedestrians to choose an exit. Second, the collision between pedestrians is solved by deﬁning the movement rule and collision avoidance strategy. Finally, the algorithm is compared with BEME and traditional path-planning algorithms. The results show that the algorithm can further shorten the global evacuation distance of the symmetrical evacuation scene, effectively balance the number of pedestrians at each exit and reduce the evacuation time. In addition, this improved algorithm uses a collision avoidance strategy to solve the collision and congestion problems in path planning, which helps to maximize evacuation efﬁciency. Whether the setting of the scene or the setting of the exit, all studies are based on symmetric implementation. This is more in line with the crowd evacuation in the real scene, making the experimental results more meaningful.


Introduction
With the development of the economy and the expansion of the city scale, the daily activities of residents are becoming more and more frequent and concentrated. There are many security risks in pedestrian aggregation activities in closed areas. According to incomplete statistics, on average, thousands of people in the world are killed every year due to emergencies in gathered activities. In December 2014, when citizens met the New Year in the Bund of Shanghai, a major crowded stampede occurred, resulting in huge, irreparable losses. Therefore, the research on the state and behavior of pedestrians in an emergency has attracted the strong attention of many scholars [1,2]. Although such incidents are inevitable, the implementation of effective preventive preparations and evacuation strategies is conducive to significantly reducing the number of casualties in such incidents [3]. At present, most studies in this field focus on the formulation and optimization of large-scale crowd evacuation strategies after emergencies [4][5][6], and it shows that the lack of exit paths in evacuation areas is the main reason affecting the efficiency of emergency evacuation [7]. However, few studies have paid attention to effective pedestrian flow management and path-planning measures to avoid dangerous occurrences before emergencies occur. Most of the existing literature taken the shortest evacuation path as the optimization goal [8], but ignores global optimization characteristics of the evacuation area. In this case, the nearest exit becomes the most crowded, which undoubtedly increases evacuation time and reduces evacuation efficiency.
Generally speaking, no matter how complicated a pedestrian is in a sudden situation, the purpose of his movement is unique, that is, constantly adjusting the evacuation path to evacuate the scene at the minimum cost. However, the planning and adjustment of pedestrian evacuation strategy depend largely on the pedestrian's own factors, pedestrian coordination and the adequacy of cognition of the evacuation environment [9,10]. Therefore, analyzing the factors affecting the efficiency of pedestrian evacuation and building the relationship between them is the key to study evacuation behavior in an emergency. When an emergency occurs, pedestrians usually choose the shortest and safest path as the evacuation path [11]. Therefore, more attention should be paid to the study of pedestrian flow path management before emergencies, and the probability of potential safety hazards in closed areas should be minimized to ensure the safety of pedestrians. In addition, the location and number of obstacles and exits in the multi-exit closed scenario affect the imbalance of pedestrian exit utilization in the area [6], which profoundly affects the time of pedestrian evacuation and is an important factor affecting the evacuation efficiency. Therefore, the algorithm is optimized to ensure the balanced evacuation of pedestrians at each exit so as to avoid overcrowding at an exit.
This paper analyzes the current situation of theoretical research on crowd evacuation in recent years, explores the motion characteristics of pedestrians in the evacuation process and comprehensively considers the influence of various environmental factors to study the dynamic path-planning algorithm for crowd evacuation. By solving the problem of unbalanced exit utilization, it provides the best guidance decision for high-density crowd evacuation to scientifically and effectively deal with emergency events and further reduce the loss of life and property of the people. The solution presented in this paper can contribute to the existing literature in three major ways. First, in the process of an emergency evacuation, pedestrians always choose the shortest path as their evacuation strategy because they cannot obtain complete environmental information [12]. In this paper, the exit planned by the improved BEME algorithm is used to replace the instinct selection of pedestrians. Second, we calculate the expected utility to determine the next move of the pedestrian agent. Finally, the obstacle is added to the algorithm as an important influencing factor, and the collision avoidance strategy is formulated to solve the conflicts between pedestrians and between pedestrians and obstacles. The improved algorithm reduces the evacuation time of each exit by reasonably allocating the evacuation pedestrians at each exit and solves the collision problem by formulating effective collision avoidance strategies to achieve the evacuation optimization in the whole closed scene.
The paper is organized as follows. In Section 2, the related work section reviews the existing research on path planning in crowd evacuation facilities. Next, in Sections 3 and 4, the BEME algorithm is introduced and optimized. In Section 5, the experimental part evaluates the performance of the improved BEME algorithm by simulating the evacuation process of the real facility. The experimental results are discussed in Section 6. Finally, the paper is summarized in Section 7.

Simulation Study on Crowd Evacuation
At present, domestic and foreign experts and scholars mainly adopt two methods to model crowd evacuation simulation: macroscopic simulation model and microscopic simulation model [13,14]. Based on the assumption of "homogenization" of all pedestrians, the macroscopic model regards the crowd as a whole and qualitatively describes the behavioral characteristics of pedestrian flow by referring to the theories and methods of other subjects [15,16]. Its advantage is that the performance requirements of the computer are not high, but it cannot realistically reflect the trajectory of the crowd, which is quite different from the actual situation. From the perspective of individual pedestrians, the microscopic model fully considers the heterogeneity of individuals and studies the macroscopic phe-Symmetry 2021, 13, 1339 3 of 15 nomenon of pedestrian flow by defining the microscopic behavior rules of pedestrians so as to analyze the influence of individual behaviors on the overall pedestrian flow in a dynamic environment [17].
The current mainstream microscopic models include the SFM (Social Force Model), the CA (Cellular Automata) model and the ABM (Agent-based model). The social force model, first proposed by Helbing, is a self-driving model for single-particle motion [18]. Researchers then improved the model proposed by Helbing. Based on the original SFM, one such model uses the new social force instead of the old force to improve the collision avoidance between passengers and analyzes the influence of time interval and collision time on pedestrian collision avoidance [19]; another such model uses the modified SFM to study the crowd-evacuation facilities when terrorist attacks occur in public places [20]. The CA model is mainly used to analyze and simulate pedestrian movement in discrete geometric space. Ansgar Kirchner first applies the CA model to crowd dynamics research and constructs a pedestrian evacuation model based on the CA model [21]. Then, various improved models based on the CA model are widely studied and applied. One such model combines random fuzzy minimum spanning tree with cellular automata and gives a detailed evacuation optimization method for the safety and efficiency of pedestrian evacuation in indoor space [22]; a cellular automaton model with a multi-velocity field is established to study the evacuation of dense crowds with small velocity changes [23]. ABM regards each entity in the complex system as an agent. By formulating the behavior rules of the agent and the interaction rules between the agent and the agent, and between the agent and the environment, the interaction and autonomous decision-making of pedestrians in the evacuation process can be described in detail.
With the rapid development of computing power, agent-based crowd evacuation research has also achieved fruitful results. One such model applies the NEAT (enhanced topological neural evolution) method to the agent-based evacuation model, and the model is optimized. The information is shared through communication between agents so that pedestrians can avoid obstacles and move towards the exit position [24]. For the safe evacuation of large public buildings, one such model incorporates the predictable spatial change perception into the building environment by analyzing the building structure and pedestrian evacuation behavior to simulate the crowd evacuation in emergency situations [25]. Another such model applies the physical model and mathematical model to study the overall movement process of evacuation and the relationship between personnel safety and fire risk under fire accidents [26].

Research on Path Planning
When an emergency occurs, planning an effective evacuation path is the most important means to improve evacuation efficiency and shorten evacuation time. It can be seen from the existing actual evacuation videos that people may lose the ability to adapt to the surrounding environment in an emergency, and it is difficult to quickly understand the surrounding information in a short period of time. The movement is manifested as a common herd behavior [27]. These phenomena show that it is helpful to solve these problems by guiding pedestrians to choose the appropriate evacuation path according to the environmental information. In recent years, many scholars have carried out rich research on path planning at both micro and macro levels and have made a series of research results.
The team of Ning et al. uses the discrete grid to expand the social force model and simulates the behavior of changing the evacuation path in the pedestrian cognitive environment by analyzing the maximum weight of each potential moving direction of the pedestrian [28]. The research results show that when several paths have the same pedestrian density, the pedestrian prefers to choose the path with low crowd speed and low occupancy space, which can more truly reproduce the bidirectional movement behavior of the pedestrian. The team of Liu et al. combines the social force model with artificial bee colony to construct a new emergency evacuation simulation path-planning method. By introducing visual parameters, grouping strategy and export selection strategy, it simu- lates the process of pedestrians choosing evacuation paths by evaluating evacuation time and export congestion [29]. A multi-attribute decision-making method based on system simulation is proposed to dynamically plan the evacuation path for pedestrians [30]. The average pedestrian density, evacuation length, evacuation time and evacuation capacity are used to evaluate the evacuation performance of different path-planning strategies. The results show that the proposed method can provide valuable theoretical and practical methods for understanding the path-planning behavior of pedestrians in the evacuation process. Considering the degree of path congestion, a general model for evaluating pedestrian path selection is proposed by collecting real-time empirical data from pedestrian evacuation experiments in a controlled environment [31]. The current model is calibrated and verified by evacuation experiments, which can be used to explore more complex path selection modeling.

Agent-Based Model (ABM)
The Agent-based model regards each entity in the complex system as an agent. By formulating the behavior rules of the agent and the interaction rules between the agent and the agent, and between the agent and the environment, the model of the complex system is established from the microscopic perspective so as to explore the relationship between individual microscopic behavior and macroscopic phenomenon [32]. The framework of the ABM is illustrated in Figure 1. Typically, complex system models based on multi-agent simulation can be represented by triplets: <Agent, Environment, Parameter> pedestrian. The team of Liu et al. combines the social force model with artificial bee colony to construct a new emergency evacuation simulation path-planning method. By introducing visual parameters, grouping strategy and export selection strategy, it simulates the process of pedestrians choosing evacuation paths by evaluating evacuation time and export congestion [29]. A multi-attribute decision-making method based on system simulation is proposed to dynamically plan the evacuation path for pedestrians [30]. The average pedestrian density, evacuation length, evacuation time and evacuation capacity are used to evaluate the evacuation performance of different path-planning strategies. The results show that the proposed method can provide valuable theoretical and practical methods for understanding the path-planning behavior of pedestrians in the evacuation process.
Considering the degree of path congestion, a general model for evaluating pedestrian path selection is proposed by collecting real-time empirical data from pedestrian evacuation experiments in a controlled environment [31]. The current model is calibrated and verified by evacuation experiments, which can be used to explore more complex path selection modeling.

Agent-Based Model (ABM)
The Agent-based model regards each entity in the complex system as an agent. By formulating the behavior rules of the agent and the interaction rules between the agent and the agent, and between the agent and the environment, the model of the complex system is established from the microscopic perspective so as to explore the relationship between individual microscopic behavior and macroscopic phenomenon [32]. The framework of the ABM is illustrated in Figure 1. Typically, complex system models based on multi-agent simulation can be represented by triplets: <Agent, Environment, Parameter> The pedestrian flow simulation model based on agent overcomes the shortcomings of the complete homogeneity of pedestrians in the macroscopic model, the partial homogeneity of pedestrians in the social force model and the cellular automaton model. The model realizes the complete heterogeneity of pedestrians and makes the simulation closer to the real facility and the results more credible.

Balanced Evacuation Algorithm for Multiple Exits (BEME)
The BEME algorithm overcomes the problem of overcrowding at the exit by balancing the number of evacuated personnel and the number of exits in the closed area. The pedestrian flow simulation model based on agent overcomes the shortcomings of the complete homogeneity of pedestrians in the macroscopic model, the partial homogeneity of pedestrians in the social force model and the cellular automaton model. The model realizes the complete heterogeneity of pedestrians and makes the simulation closer to the real facility and the results more credible.

Balanced Evacuation Algorithm for Multiple Exits (BEME)
The BEME algorithm overcomes the problem of overcrowding at the exit by balancing the number of evacuated personnel and the number of exits in the closed area. Through the exit selection and path planning of pedestrian individuals, the global optimization of pedestrian evacuation is realized [33]. At the same time, the collision avoidance strategy is used to solve conflict problems in evacuation. This algorithm takes the number of pedestrians (NoP) and the number of exits (NoE) in the facility as inputs and plans an exit for each pedestrian individual based on the shortest distance. The algorithm runs in two main phases. In the first phase, the algorithm first generates the local shortest distance list (LSDL) for each exit, which is a list of the shortest distances between each pedestrian and the exit in the facility, and each LSDL is sorted in ascending order. Then, the algorithm creates the empty exit capacity list (CL) for each exit; the CL size is equal to NoP/NoE. The exit capacity list (CL) is another locally stored list; it maintains a pedestrian list from this exit in each exit. In the second phase, the global shortest distance list (GSDL) is created for the facility, which maintains the shortest distances record in each LSDL. The global shortest distance list (GSDL) is arranged in ascending order of distance to solve the conflict between pedestrians. Subsequently, the algorithm determines whether the CL of the exit reported as the first item in the GSDL is less than NoP/NoE. The GSDL is then updated with a new record from the exit's LSDL while maintaining the order of the list. The algorithm continues its examination of the first items in the GSDL and updates the CLs and LSDLs of each exit until the condition is no longer satisfied.

Path Planning Based on BEME Algorithm
In this study, the optimized BEME algorithm is first used to select the evacuation exit for pedestrians in the facility. In each simulation step, according to the location of pedestrians and the distribution of obstacles in the surrounding cells, the pedestrian P finds the cell with the maximum expected utility as the target cell to move. When a collision is detected, the model uses a collision avoidance strategy to make decisions on candidate cells. After entering the new cell, pedestrian P immediately makes the next decision until it leaves the evacuation space.

Improvement of BEME Algorithm
Based on the BEME algorithm, the proposed optimization algorithm improves the update method of the GSDL list. The improved algorithm is shown in Algorithm 1. When there are records with the same pedestrian and shortest distance in the GSDL, the same record is taken out of the GSDL and replaced by the next record in the ascending LSDLs to achieve the goal of updating the GSDL. In practice, when the pedestrian is located at the same distance from two or more exits, the record of the pedestrian is temporarily present in the LSDLs of each exit. When the exit of other pedestrians is allocated, the record of the pedestrian P is written into the GSDL according to the size of each exit's CL, and then the exit is selected. The model divides the evacuation facility into square cells with a side length of 0.6, which is the typical size of space occupied by a single pedestrian in a dense population [34]. Pedestrians move at most one cell per time step. According to the research on the traffic characteristics of evacuation in buildings at home and abroad, the velocity distribution of pedestrians conforms to the normal distribution. The average velocity of pedestrians in China is about 1.24 m/s, and the velocity value is between 1.01 m/s and 1.32 m/s [34][35][36], so the time step in the model is set to 0.5 s. In this time, pedestrians can understand the surrounding environment and react, and at the same time, they can coordinate with the microscopic rules determined by the model. The model sets the pedestrians in the facility to walk in the direction of the safe exit selected by the BEME algorithm. Within a time step, the pedestrians move to the adjacent cells with a certain probability. Considering the low probability of pedestrian back-off in the real area, this paper defines that there are only six candidate cells for each movement of the pedestrian agent in the facility, namely, the original cell, the left, the front, the right, the left front and the right front cell. In the dense crowd facility, the probability of pedestrian selection staying in the original cell is higher, while in the loose crowd facility, the probability of pedestrian selection moving is higher. The probability of pedestrians staying in the original cell is p 0 . According to the clockwise direction, the probability of pedestrians choosing adjacent candidate cells starts from the left adjacent cells of the original is: p 1 , p 2 , p 3 , p 4 , p 5 .
The model allows multiple people in the same cell, but the utility obtained by pedestrians decreases with the number of people in the cell. Without knowing the next decision of others, pedestrians can only find out the cells with the maximum expected utility according to the probability distribution of others' walking and movement. In this paper, the total utility of pedestrians in the evacuation process is divided into two parts: mobile utility µ move and comfort utility µ comf . The definition of the total utility function is shown in Equation (1): The definition of the mobile utility function is shown in Equation (2). It represents the utility of pedestrians during evacuation. The closer the pedestrian's next target cell is to the corresponding exit, the greater the mobility utility. S represents the distance of pedestrians moving towards the specified exit direction and θ represents the angle between the pedestrian moving direction and the specified exit direction. When θ = 90 • , the pedestrian's mobility utility is 0 because the horizontal distance from the exit does not change. When θ = 0 • , the mobility utility obtained by the pedestrian is defined as the moving distance of the pedestrian.
According to previous studies, pedestrian density has a certain constraint on pedestrian speed. The law of density and pedestrian speed can be expressed in Equation (3), where v l denotes the instant speed of pedestrians and v 0 denotes the free movement speed The comfort utility is defined as the function of the number of pedestrians in the cell, which represents the ratio of pedestrian instant speed to free movement speed. It is shown in Equation (4).
In the model, pedestrians select the target cell before each move. In the process of decision-making, pedestrians cannot know the choice of surrounding pedestrians in advance and only know the probability of choosing each cell, and the choice of surrounding pedestrians will affect the utility of the pedestrian. Therefore, the pedestrian can only calculate the expected utility of each decision according to the distribution probability of the surrounding pedestrian decision so as to find the cell with the largest expected utility. According to the setting of the model, in general, pedestrians have six candidate cells to choose from when making the next decision. And for each candidate cell, pedestrians in eight adjacent cells may participate in the game.
As shown in Figure 2, coordinate (x, y) denotes that the cell is located in the y column of the x line, and p0~p5 denotes the probability that the pedestrians in this direction falls into the (x, y) cell according to the movement rules defined by the model. Other pedestrian agents in the same cell affect the utility of pedestrian P falling into (x, y) cell due to different moving directions. The expected comfort utility for pedestrian P when selecting (x, y) cells is shown in Equation (5). Among them, p(0), p(1) and p(2) represent the probabilities of 0, 1 and 2 pedestrians in the candidate cell, respectively. When the number of pedestrians in the cell is greater than or equal to four, it can be calculated according to Equation (5). At this time, the comfort utility is close to 0, which can be ignored. According to the probability of pedestrian P falling into (x, y) cells, the participants in the game can be divided into six groups. Assuming that n l x,y and n r x,y respectively represent the number of pedestrians moving from right to left and from left to right in (x, y) cells, the corresponding number of pedestrians in each group is: x,y N 2 = n l x−1,y + n r x+1,y N 3 = n l x−1,y+1 + n r x+1,y−1 N 4 = n l x,y+1 + n r x,y−1 − 1 N 5 = n l x+1,y+1 + n r x−1,y−1 N 6 = n l x+1,y + n r x−1,y According to the probability distribution, the probability of other pedestrians not falling into the (x, y) cell is as follows: The probability that only one of the other pedestrians chooses to fall into (x, y) cell is: When two other pedestrians choose to fall into (x, y) cells, the two pedestrians may come from the same group or from different groups. The probability of two of them from the same group is: The probability of two of them from different groups is:

Collision Avoidance Strategy
The model allows each cell to accommodate multiple pedestrian agents, which solves the collision problem caused by the simultaneous movement of pedestrians. However, it is difficult to avoid the collision problem caused by route crossing when pedestrians move. The model defines collision processing strategy: the pedestrian agent falls into the candidate cell adjacent to the target cell with probability p avoi when predicting the possibility of collision. The definition of probability p avoi is shown in Equation (11). Taking a pedestrian walking right in the (x, y) cell as an example, the collision can only occur if he chooses to fall into the (x − 1, y + 1) or (x + 1, y + 1) cell and if there is an opposite pedestrian in the (x, y + 1) cell.
In each simulation time step, pedestrians first calculate the expected utility of all candidate cells according to their own location, the distribution of pedestrians and obstacles in the surrounding cells and other information to find out the cells with the largest expected utility as the target cells. When the pedestrians predict the possibility of collision, they fall to the candidate cells adjacent to the target cell with a certain probability. After the Symmetry 2021, 13, 1339 9 of 15 pedestrians fall into the new cell, they make the next decision immediately until they leave the evacuation space.
The process of pedestrian path decision is as follows: 1.
Obtain location and obstacle information.

2.
Move to the exit according to the generated path.
If the condition occurs, turn to 5; if not, turn to 7.
Move to a cell adjacent to the target cell. 7.
Move to exit.

Advantages of Optimizing the BEME Algorithm
The following example is used to verify the superiority of the optimization algorithm over the BEME algorithm. The examples assume a two-dimensional grid of x × y cells representing a room with 10 pedestrians (NoE = 10) and 2 exits (NoE = 2). The exits are arranged on the adjacent sides of the area, and pedestrians are randomly distributed in the area. The location and size of the obstacles are also shown in Figure 3. The algorithm first calculates the shortest distance between each pedestrian location and a safe exit. In the first phase of the pedestrian evacuation, the BEME algorithm generates a global list of GSDL that maintains the shortest distance according to LSDLs and CLs. When one CL is full and the exit has a congestion risk, the algorithm deletes the LSDL of the CL corresponding to the exit and deletes all its records from the GSDL.  For instance, Pedestrian 1′s distance to Exit 1 and 2 is both 8, and Pedestrian 6′s distance to Exit 1 and 2 is both 10. If both Pedestrian 1 and Pedestrian 6 are written in exit 1′s CL according to the BEME algorithm, Pedestrian 1 and Pedestrian 6 will be evacuated from Exit 1. Then it judges the condition that exit 1′s CL is less than NoP/NoE is false, so exit 1′s CL is no longer updated, and other pedestrian records will be written into exit 2, that is, evacuate from exit 2. The distance of the shortest path and evacuation exit before and after algorithm improvement are shown in Tables 1 and 2, respectively. It can be seen that the improved algorithm balanced the evacuation of each exit and shortened the shortest distance of evacuation.  For instance, Pedestrian 1 s distance to Exit 1 and 2 is both 8, and Pedestrian 6 s distance to Exit 1 and 2 is both 10. If both Pedestrian 1 and Pedestrian 6 are written in exit 1 s CL according to the BEME algorithm, Pedestrian 1 and Pedestrian 6 will be evacuated from Exit 1. Then it judges the condition that exit 1 s CL is less than NoP/NoE is false, so exit 1 s CL is no longer updated, and other pedestrian records will be written into exit 2, that is, evacuate from exit 2. The distance of the shortest path and evacuation exit before and after algorithm improvement are shown in Tables 1 and 2, respectively. It can be seen that the improved algorithm balanced the evacuation of each exit and shortened the shortest distance of evacuation.

Comparison with Traditional Algorithms
The real scene used in the simulation is a stadium. Whether scene or exit settings, they are always symmetrical, which is more in line with the real scene evacuation settings.
As shown in Figure 4, it can be roughly seen as an ellipse, including eight exits evenly distributed around the stadium. The number and location of pedestrians are random; the width of the exit door was set at 1 m, which is commonly used in evacuation scenarios [37]. In the evacuation model, exits are assumed to be identical, and for simplicity, only one pedestrian egresses per second. The simulation considered 10 different scales for the number of pedestrians, ranging from 8 to 4096. In addition, the location of the four exits is also changed, which are placed on the adjacent sides, relative sides and on all sides of the stadium. Table 3 lists the parameters utilized in the simulation and their assigned values.
Symmetry 2021, 13, 1339 11 of 15 [37]. In the evacuation model, exits are assumed to be identical, and for simplicity, only one pedestrian egresses per second. The simulation considered 10 different scales for the number of pedestrians, ranging from 8 to 4096. In addition, the location of the four exits is also changed, which are placed on the adjacent sides, relative sides and on all sides of the stadium. Table 3 lists the parameters utilized in the simulation and their assigned values.  In the simulation, the following performance metrics were computed for each scenario: the maximum crowd at any exit (MCE) and total evacuation time (TET). First, the improved BEME is compared with BEME, Depth-First Search (DFS) and Simulated Annealing (SA) to evaluate the performance of the proposed optimization algorithm by con-  In the simulation, the following performance metrics were computed for each scenario: the maximum crowd at any exit (MCE) and total evacuation time (TET). First, the improved BEME is compared with BEME, Depth-First Search (DFS) and Simulated Annealing (SA) to evaluate the performance of the proposed optimization algorithm by considering the evacuation facility with different pedestrian numbers and exit locations. The two techniques, DFS and SA, were used to evaluate the improved BEME algorithm. The former attempts to find the nearest exit for evacuation, while the latter searches for an optimal evacuation strategy. The maximum crowds at exits (MCE) is computed as the maximum number of pedestrians evacuating at each exit. The number of pedestrians at each exit in the area is calculated, and the MCE is obtained by comparing the number of pedestrians at each exit. Figure 5 shows the change of MCE of each algorithm when the number of pedestrians increases exponentially in different export locations. When the number of pedestrians in the facility increases from 8 to 256, the performance of the improved BEME algorithm is similar to the DFS algorithm and SA algorithm. Compared with the BEME algorithm, it has no obvious improvement, and the simulation value generated by the SA algorithm is more similar to the BEME algorithm. As the number of pedestrians increases to thousands of people, the improved BEME algorithm is obviously superior to the traditional algorithm. The MCE at each exit obtained by this improved algorithm is low, which greatly reduces the congestion at the exit. Compared with the MCE values of different exit locations, it is found that the uniform layout of exit locations in the facility is more conducive to the performance improvement of the DFS algorithm and SA algorithm. For the improved BEME algorithm, the maximum number of pedestrians at the exit has little change, which reflects that the improved BEME algorithm has good stability. In these instances, the performance of the SA algorithm is better than the DFS algorithm because it tends to distribute pedestrians evenly to each exit. In general, compared with the traditional algorithm, the MCE value obtained by the improved BEME algorithm is smaller, and the algorithm shows excellent performance. Total evacuation time (TET) calculates the duration of evacuation from the first p destrian to the last pedestrian. Then the effectiveness of the proposed optimization alg rithm is verified by comparing it with the three other algorithms. The TET results of t optimized model and the original model are evaluated as shown in Figure 6. When t number of pedestrians in the facility increases from 8 to 256, the performance of the op mization algorithm is similar to that of the two original models. When the number of p destrians continues to increase to thousands, the performance of the optimization alg rithm gradually emerges. This is because the CA model and SFM only consider the leng of the evacuation path without considering the impact of congestion and exit evacuati capacity on evacuation efficiency. At the same time, the layout of the exit position do not have a significant impact on the TET results of the optimization algorithm, but the tw traditional algorithms achieve smaller and smaller TET results with the uniform layout the exit position. Compared with the traditional algorithms, the optimization algorith proposed in this paper shows more excellent performance under different exit location  Figure 6. When the number of pedestrians in the facility increases from 8 to 256, the performance of the optimization algorithm is similar to that of the two original models. When the number of pedestrians continues to increase to thousands, the performance of the optimization algorithm gradually emerges. This is because the CA model and SFM only consider the length of the evacuation path without considering the impact of congestion and exit evacuation capacity on evacuation efficiency. At the same time, the layout of the exit position does not have a significant impact on the TET results of the optimization algorithm, but the two traditional algorithms achieve smaller and smaller TET results with the uniform layout of the exit position. Compared with the traditional algorithms, the optimization algorithm proposed in this paper shows more excellent performance under different exit locations. number of pedestrians in the facility increases from 8 to 256, the performance of the opti-mization algorithm is similar to that of the two original models. When the number of pedestrians continues to increase to thousands, the performance of the optimization algorithm gradually emerges. This is because the CA model and SFM only consider the length of the evacuation path without considering the impact of congestion and exit evacuation capacity on evacuation efficiency. At the same time, the layout of the exit position does not have a significant impact on the TET results of the optimization algorithm, but the two traditional algorithms achieve smaller and smaller TET results with the uniform layout of the exit position. Compared with the traditional algorithms, the optimization algorithm proposed in this paper shows more excellent performance under different exit locations.  The improved model proposed in this paper is based on the exit selection of the BEME algorithm and focuses on the optimization of the path-planning strategy. As long as there are available exits for pedestrians, the evacuation path can be gradually selected according to the movement rules of the optimization model, and the collision avoidance rule can also be used to avoid conflicts until evacuation from the safe exit. The model can solve the problem of simultaneous pedestrian collision by defining multiple pedestrians in the same cell, but at the same time, it must bring some hidden dangers. The proportion of pedestrian numbers in cells is sampled every 30 s. Figure 7 shows the change of pedestrian number in each cell in the facility with the change of evacuation time. It can be seen from the figure that the improved algorithm proposed in this paper makes the distribution of pedestrians in the evacuation area more uniform, and there is no large area of crowded pedestrians in the facility. The results show the robustness of the proposed optimization algorithm. The improved model proposed in this paper is based on the exit selection of the BEME algorithm and focuses on the optimization of the path-planning strategy. As long as there are available exits for pedestrians, the evacuation path can be gradually selected according to the movement rules of the optimization model, and the collision avoidance rule can also be used to avoid conflicts until evacuation from the safe exit. The model can solve the problem of simultaneous pedestrian collision by defining multiple pedestrians in the same cell, but at the same time, it must bring some hidden dangers. The proportion of pedestrian numbers in cells is sampled every 30 s. Figure 7 shows the change of pedestrian number in each cell in the facility with the change of evacuation time. It can be seen from the figure that the improved algorithm proposed in this paper makes the distribution of pedestrians in the evacuation area more uniform, and there is no large area of crowded pedestrians in the facility. The results show the robustness of the proposed optimization algorithm.

Results and Discussion
In this paper, the BEME algorithm is optimized to improve the performance of exit selection and path planning. Then, on the basis of the optimized BEME algorithm, the collision between pedestrians is solved by defining the moving rules and collision avoidance strategies. Taking a stadium as an example, the effects of pedestrian number and exit location on evacuation efficiency are simulated. At the same time, MCE and TET are used to evaluate the performance of the balanced evacuation model. In addition, the proportion of row people in cells is sampled to observe whether there is large area congestion in the facility. The results show that the distribution of pedestrians in the improved BEME algorithm is relatively uniform, which proves the robustness of the proposed optimization model.

Results and Discussion
In this paper, the BEME algorithm is optimized to improve the performance of exit selection and path planning. Then, on the basis of the optimized BEME algorithm, the collision between pedestrians is solved by defining the moving rules and collision avoidance strategies. Taking a stadium as an example, the effects of pedestrian number and exit location on evacuation efficiency are simulated. At the same time, MCE and TET are used to evaluate the performance of the balanced evacuation model. In addition, the proportion of row people in cells is sampled to observe whether there is large area congestion in the facility. The results show that the distribution of pedestrians in the improved BEME algorithm is relatively uniform, which proves the robustness of the proposed optimization model.
The evacuation of the improved path-planning algorithm proposed in this study in the actual scene depends on an evacuation management platform based on a path-planning push. Pedestrian location information is obtained by positioning software and its upload to the server. On the server side, the pedestrian location information is used to display the crowd distribution in the virtual scene to complete the path planning. Then, the planned path is pushed to pedestrians.
By analyzing the results of MCE, it can be concluded that the MCE performance of the improved BEME algorithm did not falter across the three placement variations. The MCE performance of the improved BEME was balanced when varying the exit placement. This proves that although the space utilization rate of exit layout is low, an improved BEME algorithm can still be used. However, the DFS algorithm and SA algorithm do not achieve the best performance when the exit layout is uniform and the space utilization is high. The analysis of TET results shows that when the number of pedestrians is less than 256, the TET performance of the improved BEME algorithm is slightly worse than the original model. This is because the real-time computational complexity of the agent-based model used in this paper is high. When the number of evacuation pedestrians is small, it will show a longer simulation time than the traditional model. However, in general, the performance of the improved BEME algorithm is better than that of the original traditional algorithms in the case of reduced exit overcrowding.

Conclusions
This paper optimizes the exit selection and path generation process of the evacuation algorithm and optimizes the evacuation process through the average distribution of pedestrians between all exits to achieve the goal of reducing evacuation time so as to solve the problem of crowd congestion when evacuation is carried out in a closed facility with multiple exits. Then, taking the stadium scene as an example, we used the agent-based model to simulate the evacuation of the pedestrians in a real situation. At the same time, considering the influence of different numbers of pedestrians and different layout exit positions, the evaluation is carried out by comparing it with the traditional algorithm. The results show that the improved BEME algorithm is better than the traditional algorithm, which confirms the value of the agent-based balanced evacuation model proposed in this paper. The simulation environment of the improved algorithm proposed in this paper is a multi-exit symmetrical scene with obstacles. No matter how the export position parameters change, the export position setting is always symmetrical. Whether the scene or exit settings, symmetrical settings are more in line with the real scene evacuation settings. All the research is based on symmetric implementation, which makes the experimental results more meaningful. At the same time, this study adds obstacles to the original BEME algorithm. Obstacles are one of the important factors affecting the evacuation path planning, which will not only affect the evacuation path of pedestrians in the whole evacuation area but are also be more in line with the simulation of crowd evacuation in the real scene. For future work, the proposed optimization algorithm should be simulated in more realistic scenes. While considering the influence of more factors on the evacuation model, more evacuation studies in asymmetric areas are also needed. At the same time, the evacuation process should be optimized by improving the evacuation platform to further improve the evacuation efficiency.