1 Introduction

In recent years, many researches about effective emergency evacuation have been proposed. Rooms and buildings are the main scenarios of evacuation due to the inherent vulnerability to natural hazards and disasters such as stampede, fire, and terrorist attack [1]. Barnes et al. [2] proposed a solution for fire emergency evacuation based on graphs which can incorporate 3D cases naturally without using specialized nodes for exits or isolated floors. The model monitors the dynamics of fire and the progress of evacuation to ensure that evacuees stay safely ahead of the hazard by using two weighed graphs over the WSN structure which are called “navigation graph” and “hazard graph”. The model proposed in method [3] extends the concept safety introduced by method [2] for the situation when the navigation graph is dynamic. The two possible scenarios are described for using the dynamic model with a Wireless Sensor Network for fire emergency evacuation. In method [4], authors model the problem of fire emergency evacuation as an extension of a dynamic network flow by allowing for nodes and edges to expire over time. This model captures evacuation situations where the spreading hazard renders parts of the network unavailable. However, these methods do not consider the number of evacuees.

Chen et al. [5] proposed an individual-based framework for emergency guiding. The spatial–temporal mobility of all people is modeled to determine a dedicated path that provides the shortest evacuation time for each person. They also prove that their proposed path planning algorithm is optimal and analyze its time and space complexity. Chen et al. [6] proposed a load-balancing framework for distributed emergency guiding based on wireless sensor networks. A load-balancing guiding scheme is designed and an analytical model is derived to reduce the total evacuation time of people indoors. The guiding scheme can provide the fastest path for people to reach an exit according to the evacuation time estimated using the analytical model. Based on thorough research, this is the first distributed solution in which corridor capacity and length, exit capacity, and the concurrent movement and distribution of people are considered in estimating the evacuation time and planning escape paths. Escolar et al. [7] proposed an adaptive algorithm for dynamically computing safe evacuation routes, while the load of people is balanced between the accesses of each floor of the building, thus avoiding the accumulation of people in hotspots. The combination of this algorithm with sensors to detect the events of interest and a navigation system to guide the evacuees turns this solution into a specially suited approach for evacuation in high-rise buildings.

Wagner et al. [8] present a prototype of a computer simulation and decision support system that uses agent-based modeling to simulate crowd evacuation in the presence of a fire disaster and provides for testing of multiple disaster scenarios at virtually no cost. A new multi-agent based congestion evacuation model incorporating panic behavior is proposed in [9] for simulating pedestrian evacuation in public places such as a stadium. The dynamic traffic assignment (DTA) models have been utilized as useful tools for making evacuation plans [9,10,11,12,13,14], the theories of which can be roughly summarized as analytical models and simulation models. However, most of the analytical models cannot reflect traffic realities well and the model solutions are difficult to calculate when a large-size or even middle-size road network is considered. Lu, et al. [15] proposed a pedestrian evacuation simulation framework considering earthquake-induced falling debris, and the associated prediction model to calculate the falling debris distribution is also established. Moreover, experiments are conducted to quantify the influence of falling debris on pedestrian movement. In [16], authors proposed an online method that overcomes this tradeoff based on multimedia data (e.g. videos data from surveillance cameras) and deep learning. The method consists of two parts. The first estimates the evacuee position as input for training the assessment model to then perform risk assessment in real scenarios. The second considers a social force model based on the evacuation simulation for the output of training model. In [17], authors proposed a crowd simulation and analysis framework for the formulation and evaluation of effective evacuation strategies in large buildings, using real-scale building structures and agent-based approach. They further propose an algorithm to devise an evacuation strategy. In [18], they present a simulation framework for modeling large crowd evacuation by taking into account occupants’ behaviors and interactions during an emergency. In particular, human’s personal (i.e., age, gender, disability) and interpersonal (i.e., group behavior and interactions) attributes are parameterized in a hazard impacted environment.

Modern people spend most of their time indoors. In metropolitan areas, offices, large shopping malls, department stores, schools, and cram schools tend to be built in high-rise buildings. Earthquakes and various types of fires have the most casualties in buildings, so this study focuses on the personnel emergency evacuation in buildings, especially high-rise buildings. Personnel emergency evacuation models can be divided into two types. One type does not consider the varying individual behaviors of the people to be evacuated. The behavior of all personnel is considered to be homogeneous and has the same characteristics. This is the macroscopic model that is generally based on the dynamic network flow model to obtain the optimal evacuation path plan. The other type is the model that uses computers to simulate the behavior of individuals to be evacuated, including individual differences in walking speed, behavioral responses to dangerous situations, behavioral abilities, and interaction among evacuees. This study aims in the planning of indoor emergency evacuation by using a more macroscopic model that considers more factors, including the distribution of people in each region, capacity of each area, possible safe exit locations, possible hazard locations, rooms, open spaces, doors, junctions, capacity of walkways or stairs to accommodate people, time required to move people, and the proposed heavy smoke diffusion. Moreover, the relationship between crowd density and moving speed of the crowd is also considered in constraints. According to these factors, the objective of the proposed model is to evacuate all people in the shortest time through the concept of load balance coming from the relationship between crowd density and moving speed of the crowd. The algorithm of simulated annealing is finally applied to solve the planning problem corresponding to the proposed model.

The rest of this study is organized as follows. Section 2 reviews background and related work. Section 3 presents the proposed macroscopic model and its solving approach. Section 4 shows experimental environment and results. Section 5 concludes our work.

2 Background

This section reviews some background knowledge of wireless sensing networks including the introduction to wireless sensing networks, routing of wireless sensing networks, and wireless network specifications.

2.1 Introduction to Wireless Sensing Networks

A wireless sensing networks can be defined as a network consisting of four fundamental components: control center (e.g., user or observer), sink nodes (e.g., gateway), wireless networks (e.g., the Internet), and a large number of sensing nodes (e.g., sensors). that can communicate with each other. As shown in Fig. 1, each sensing node has four major units: a power supply unit, a sensing unit, a processing unit, and a wireless transmission unit. The power supply unit is mainly used to provide the energy required for the sensor node hardware to operate. Generally, one can consider a standard lithium battery or a solar battery that can draw energy from the environment. The sensing unit has different micro-sensors to collect temperature, humidity, brightness, acceleration, pressure, sound, etc., and then transmit these collected analog data to the signal conversion element and converted into a digital signal. The processing unit is responsible for executing code, coordinating, sending back data, and controlling different units. This unit also contains a small storage unit for the storage of the collected information. The wireless transmission unit is responsible for the communication and sensing data exchange among the sensing nodes. This unit also transmit the sensing data collected to a sink node by wireless network and finally these sensing data or information are transmitted back to the control center or user [19,20,21,22,23].

Fig. 1
figure 1

Diagram of a wireless sensing networks

In addition, due to the rapid development of the Internet of Things in recent years, related concepts and technologies of WSN have also been integrated and applied to the Internet of Things, making the application fields of WSN more extensive and more complicated.

2.2 Routing of Wireless Sensing Networks

The routing of wireless sensor networks in different environments can be broadly classified into shortest-path distance method, shortest-path hop method, and reliable routing method.

  1. 1.

    Shortest-path distance method: Shortest-path distance method uses the Dijkstra algorithm to find the shortest path length from each source node in the wireless sensing network to its destination node [24].

  2. 2.

    Shortest-path hop method: Shortest-path hop method finds a path that each source node in the wireless sensing network can reach the destination node through the minimum number of nodes [25, 26].

  3. 3.

    Reliable routing method: Reliable routing method finds the most reliable path for each source node individually to the destination node [27, 28].

2.3 Wireless Network Specifications

There are a variety of wireless network specifications such as Wi-Fi, Bluetooth, Zigbee, 6LoWPAN, Z-Wave, and LPWAN (Low-Power Wide-Area Network). The specification and performance comparisons among Wi-Fi, Bluetooth, Zigbee, 6LoWPAN, Z-Wave, and LPWAN are shown in Table 1.

Table 1 Comparison of wireless sensing technology

3 The Proposed Emergency Evacuation System with Macroscopic Model and Its Solution

The purpose of this paper's fire evacuation route planning is to evacuate all people in the shortest time by solving the proposed nonlinear mathematical model. In order to avoid the increase of evacuation time leading to more casualties, avoidance of congestion in escape is one of the effective methods. In other words, the consideration of crowd density and heavy smoke diffusion is very important. By combining common considerations, the proposed mathematical model considers crowd density, heavy smoke diffusion, the capacity of each area, the capacity of the walkways or staircases, the time required to move people in each area and walkway, the location where the fires occurred, the number of people in the area, the location of the exits, the area of the fire, escape direction, and the effect of crowd density on the crowd moving speed.

Section 3.1 lists related environmental hypothesis. The detail of the proposed mathematical model is presented in Sect. 3.2. Section 3.3 applies the algorithm of simulated annealing to solve the evacuation planning problem corresponding to the proposed mathematical model.

3.1 Related Environmental Hypothesis

The environment of the simulation is based on high-rise buildings. To facilitate observation and calculation, we convert a 3D space into a 2D plane, as illustrated in Fig. 2. The white circles in the figure are the regions, the black circles are the exits, and the lines connecting the two regions are the walkways. When there are multiple exits, calculating the time to reach each exit would take a long time; therefore, we set up a virtual node to connect each exit, and it is assumed that no time or space is required to reach the virtual node from an exit. In Fig. 3, the triangle is a virtual node.

Fig. 2
figure 2

Convert 3D space into a 2D plane

Fig. 3
figure 3

The triangle is a virtual node

Most casualties of fire are caused by the excessive inhalation of toxic smoke or carbon monoxide. Therefore, we assume that people would not walk in the locations with heavy smoke and therefore must change to a path without heavy smoke. According to the Fire Science Education Center of the Taipei Fire Department in Taiwan [29], smoke rises at a speed of 3.5–5 m/s, and the speed of horizontal diffusion is 0.5–1 m/s. For convenience in our simulation, the speed of rising smoke is set to 5 m/s, and the horizontal diffusion is set to 1 m/s.

Additionally, as shown inside the red line of Table 2, the relationship between crowd density and moving speed of the crowd from the 2011 Taiwan Highway Capacity Handbook [30] is also considered to be an environmental constraint of the proposed model. Assume that the relationship between crowd density and moving speed is linear as follow.

$$V = aD + b$$
(1)
Table 2 Relationship between crowd density (average density) and moving speed (average speed)

where D and V are crowd density (people/m2) and crowd speed (m/min). Bringing (0.32, 72) and (2.1, 38) in the table into the formula (1), we have

$$V = - 19.1D + 78.1$$
(2)

In order to verify whether the estimated formula is accurate, we take (0.32,72), (0.48,69), (0.78,63), (1.18,58), (2.1,38) in Table 2 into formula (2). As shown in Fig. 4, the blue line is the data in Table 2 and the red line is the results we estimated, you can see that the error is very small. So, the formula we estimate can be used to calculate the relationship between crowd density and speed.

Fig. 4
figure 4

Comparison of original speed in Table 2 with the estimated speed

We set the speed to 0 to get the maximum density of about 4.089. For simplicity, we set the maximum density to 4. We set the fastest rate of crowd escape to 60 (m/min), which is equivalent to one meter per second, and the unit length is 2 m, so we need to spend 2 s per unit fastest rate, as shown in Fig. 5. Its mathematical expression is

$$f = 2\delta_{(0,0.23)} + 3\delta_{(0.23,0.43)} + 4\delta_{(0.43,0.62)} + 5\delta_{(0.62,0.82)} + 6\delta_{(0.82,1)}$$
(3)
Fig. 5
figure 5

Crowd density versus time

where

$$\delta_{(a,b)} = \left\{ {\begin{array}{*{20}c} {1, \, a < x \le b} \\ {0, \, otherwise} \\ \end{array} } \right.$$
(4)

3.2 The Proposed Mathematical Model

In order to evacuate all people in the shortest time, we transform many emergency evacuation factors and their scenario into a mathematical model. Assumptions, given parameters and unknown decision variables of the proposed model are first listed. Next, we introduce the model’s constraints according to the real conditions in emergency evacuation. Based on the above assumptions, given parameters and unknown decision variables, the proposed model including objective and constraints is presented in Model 1.

Assumptions

The capacity of each area and each walkway is already known

The length of walkway is already known

People in one of the areas will be moving in the same direction

The area where people are located and the number of people in the area are both already known

The rate of smoke spread is already known

Parameters

 

\(N\)

The collection of nodes in network

\((i,j)\)

The link between node i and node j in network,\(\forall i \in N,j \in N\)

\(L\)

The collection of links \(\left\{ {(i,j)} \right\}\), for example walkway stairs

\(l_{ij}\)

The length of the link \((i,j)\),\(\forall i \in N,j \in N\)

\(c_{i}\)

Number of people in some node i

\(u_{ij}\)

Maximum number of people in the link \((i,j)\)

\(S\)

The collection of nodes where someone exists when an emergency occurs

\(s_{i}\)

Number of people for some \(i \in S\)

\(\varphi_{i}\)

The time required for the smoke to reach the node i and \(\varphi_{0}\) denotes fire point

\(f((i,j),p)\)

The time required when p people pass through the link \((i,j)\)

\(E\)

Collection of virtual exit nodes

\(T\)

The longest time spent for the environment

Unknown decision variables

 

\(x_{ij}^{d} , \, d \in S, \, i \in N, \, j \in N\)

\(x_{ij}^{d} = 1\), if \(x_{ij}^{d}\) is an evacuation path; \(x_{ij}^{d} = 0\), otherwise

\(\overline{\delta }_{i}^{t} , \, i \in N, \, t \in T\)

The number of evacuated people at node i at time t

\({}^{d}\delta_{i}^{t} , \, d \in S{, }i \in N, \, t \in T\)

The number of people whose source node is d reach node i at time t

\({}^{d}r_{i}^{t} , \, d \in S{, }i \in N, \, t \in T\)

In d’s escape path, whether or not node i has been passed at time t; If \({}^{d}r_{i}^{t}\) is 1, it means that the crowd of source node d will reach node i at time t, otherwise it is 0

Constraints

 

\(\sum\limits_{{\left\{ {j:(i,j \in L)} \right\}}} {x_{ij}^{d} } - \sum\limits_{{\left\{ {j:(j,i \in L)} \right\}}} {x_{ji}^{d} } = \left\{ {\begin{array}{*{20}c} {1, \, if \, i = d} \\ { - 1, \, if \, i = E} \\ {0, \, otherwise} \\ \end{array} } \right.\)

The source node d finds a way to reach the exit node

\(\sum\limits_{t \in T} {{}^{d}r_{j}^{t} \times t} = x_{ij}^{d} \left[ {\sum\limits_{t \in T} {{}^{d}r_{i}^{t} \times } \left( {t + f\left( {(i,j),\overline{\delta }_{i}^{t} } \right)} \right)} \right]\)

The number of people who reach node j from node i in the escape path of source node d

\(\sum\limits_{t \in T} {{}^{d}r_{i}^{t} } < 1, \, d \in S{, }i \in N\)

In the evacuation path of source node d, there can be at most one for all times \(t \in T\) of node i

\({}^{d}\delta_{i}^{t} = {}^{d}r_{i}^{t} \times \overline{\delta }_{d}^{0} , \, d \in S{, }i \in N, \, t \in T\)

Calculate the number of people at time t at node i in the evacuation path of source node d

\(\overline{\delta }_{i}^{t} = \sum\limits_{d \in S} {{}^{d}\delta_{i}^{t} } , \, i \in N, \, t \in T\)

Calculate the number of people at node i at time t

\(\sum\limits_{(i,j) \in L} {\sum\limits_{d \in S} {{}^{d}r_{i}^{t} \times x_{ij}^{d} } } \le 1, \, t \in T{, }i \in N\)

People who come from different source nodes and arrive at node i at the same time t must move in the same direction, as shown in Fig. 6, people s1 and people s2 come from different source nodes and arrive at node i at the same time, they must move together in the same direction to node j

\(\overline{\delta }_{i}^{t} \le \sum\limits_{d \in S} {x_{ij}^{d} \times {}^{d}r_{i}^{t} \times u_{ij} } , \, t \in T{, }i \in N,(i,j) \in L\)

People in the link between node i and node j at different time t can not exceed the capacity of the link

\(\overline{\delta }_{i}^{t} \le c_{i} , \, t \in T{, }i \in N\)

People in the node i at different time t can not exceed the capacity of the node

\({}^{d}r_{i}^{t} \times t \le \Phi , \, d \in S{, }i \in N, \, t \in T\)

This formula calculates the possible time, including the longest time. Let it be less than or equal to \(\Phi\), then our objective function is to minimize \(\Phi\)

Fig. 6
figure 6

People s1 and people s2 come from different source nodes and arrive at node i at the same time, they must move together in the same direction to node j

Model 1.

min \(\Phi\)

subject to

  1. (i)

    \(\sum\limits_{{\left\{ {j:(i,j \in L)} \right\}}} {x_{ij}^{d} } - \sum\limits_{{\left\{ {j:(j,i \in L)} \right\}}} {x_{ji}^{d} } = \left\{ {\begin{array}{*{20}c} {1, \, if\;i = d} \\ { - 1, \, if\;i = E} \\ {0, \, otherwise} \\ \end{array} } \right.,{\text{ where}}\;d \in S, \, i \in N\)

  2. (ii)

    \(\sum\limits_{t \in T} {{}^{d}r_{j}^{t} \times t} = x_{ij}^{d} \left[ {\sum\limits_{t \in T} {{}^{d}r_{i}^{t} \times } \left( {t + f\left( {(i,j),\overline{\delta }_{i}^{t} } \right)} \right)} \right], \, d \in S{, }i \in N, \, (i,j) \in L\)

  3. (iii)

    \(\sum\limits_{t \in T} {{}^{d}r_{i}^{t} } < 1, \, d \in S{, }i \in N\)

  4. (iv)

    \({}^{d}\delta_{i}^{t} = {}^{d}r_{i}^{t} \times \overline{\delta }_{d}^{0} , \, d \in S{, }i \in N, \, t \in T\)

  5. (v)

    \(\overline{\delta }_{i}^{t} = \sum\limits_{d \in S} {{}^{d}\delta_{i}^{t} } , \, i \in N, \, t \in T\)

  6. (vi)

    \(\sum\limits_{(i,j) \in L} {\sum\limits_{d \in S} {{}^{d}r_{i}^{t} \times x_{ij}^{d} } } \le 1, \, t \in T{, }i \in N\)

  7. (vii)

    \(\overline{\delta }_{i}^{t} \le \sum\limits_{d \in S} {x_{ij}^{d} \times {}^{d}r_{i}^{t} \times u_{ij} } , \, t \in T{, }i \in N,(i,j) \in L\)

  8. (viii)

    \(\overline{\delta }_{i}^{t} \le c_{i} , \, t \in T{, }i \in N\)

  9. (ix)

    \({}^{d}r_{i}^{t} \times t \le \Phi , \, d \in S{, }i \in N, \, t \in T\)

3.3 Simulated Annealing (SA) Solver

Simulated annealing (SA) is a probabilistic technique for approximating the global optimum of a given function. The algorithm of SA is easy to be implemented by its simple concept and calculation. These features match the quick completion request of emergency evacuation. Specifically, it is a metaheuristic to approximate global optimization in a large search space. It is often used when the search space is discrete. Accordingly, we adopt SA to solve the proposed model. In general, the SA algorithms work as follows. At each time step, the algorithm randomly selects a solution close to the current one, measures its quality, and then decides to move to it or to stay with the current solution based on either one of two probabilities between which it chooses on the basis of the fact that the new solution is better or worse than the current one. During the search, the temperature is progressively decreased from an initial positive value to zero and affects the two probabilities: at each step, the probability of moving to a better new solution is either kept to 1 or is changed towards a positive value; instead, the probability of moving to a worse new solution is progressively changed towards zero [31, 32]. In this sub-section, we adopt SA to find the approximative optimum of the proposed model globally. As the flowchart shown in Fig. 7, the detail procedure of SA in solving the proposed model is introduced in the following steps.

Fig. 7
figure 7

Flowchart of solving the proposed model using simulated annealing (SA)

Step 1. Setting the initial value for parameters including initial temperature, final temperature, cooling rate, and number of iteration D for a fixed temperature.

Step 2. Using the Dijkstra algorithm to find the shortest path from the node (source node) where the person is located to the exit node. After determining the initial solution, check whether the node or link capacity is exceeded and whether it passes through the thick smoke area. If it does not, adjust the path to make it fit the feasible solution.

Step 3. As the flowchart shown in Fig. 8, produce the neighbours by the following procedure:

  1. (1)

    Randomly find the path of a source node.

  2. (2)

    Find a node randomly in the path.

  3. (3)

    Delete all paths behind the node.

  4. (4)

    Randomly find a way after the node.

  5. (5)

    Determine whether to go back to the node that was originally passed, if yes, return to the previous node and return to (4).

  6. (6)

    Determine whether to go to the exit node, if not, go back to (4).

  7. (7)

    Determine if the node capacity is exceeded, if yes, go back to (1).

  8. (8)

    Determine if the link capacity is exceeded, if yes, go back to (1).

  9. (9)

    Determine if you are experiencing heavy smoke, if yes, go back to (1).

  10. (10)

    If (5), (6), (7), (8), (9) are all satisfied, then it is a neighbour.

Fig. 8
figure 8

Flowchart of producing neighbours

Step 4. The probability of making the transition from the current model state to a candidate new model state is specified by an acceptance probability function P(E,E',T), that depends on the energies E and E', and on a global time-varying parameter T called the temperature.

$$P\left( {E,E^{\prime},T} \right) = \left\{ {\begin{array}{*{20}c} {1,} & {if \, \Delta E \le 0} \\ {e^{{\left( {\frac{ - \Delta E}{T}} \right)}} ,} & {if \, \Delta E > 0} \\ \end{array} } \right.$$
(5)

where \(\Delta E = E^{\prime} - E\). In case \(\Delta E \le 0\), the probability function \(P\left( {E,E^{\prime},T} \right)\) is equal to 1 indicating that the current model state of solution s is replaced by the candidate new model state of a neighbour solution s’. In case \(\Delta E > 0\), the current model state of solution s is replaced by the candidate new model state of the neighbour solution s’ when probability function \(P\left( {E,E^{\prime},T} \right) = e^{{\left( {\frac{ - \Delta E}{T}} \right)}}\) is greater than a threshold \(H \in (0,1)\). When this step is finished, the number of iterations plus one and go to step 5.

Step 5. When step 4 is finished, the number of iterations plus one and the temperature T is decreased by a cooling rate \(\alpha\) to a new temperature \(T^{\prime} = \alpha T\).

Step 6. Check if temperature reaches the final temperature to stop SA.

4 Experimental Environment and Results

This section first shows the experimental environments including four topologies and the parameters used in each topology. Next, we apply SA to find the approximative optimum of the proposed model globally and experimental results of the four topologies are discussed.

4.1 Experimental Environment

In order to understand the application of the proposed method to buildings with different indoor structures, we simulated four topologies (a)–(d) in Fig. 9 to observe possible results, where (b) is one more floor than (a) and (c) is one more floor than (d) and each floor is wider. The circle in the figure is a node, the line between the circle and the circle is a link, the triangle is a virtual node, and the nodes of the same color are the same floor, wherein the green is the first layer, the blue is the second layer, and the red is the third layer. The number of people, capacity, length, etc. of each topology are listed in Table 3. In addition, we have more considerations than other papers as shown in Table 4.

Fig. 9
figure 9

Four topologies

Table 3 Parameters used in each topology
Table 4 Comparison of this paper with other references

4.2 Experimental Results

In the experiments of the proposed method, we apply SA to find the approximative optimum of the proposed model globally. In using SA, the initial temperature T was 1000 degrees, the termination temperature was 10 degrees, the cooling rate was 0.95, and the number of iterations was 1000. The proposed and reference [12] methods are compared in the same topological environment for three results: the cumulative number of evacuated people, crowd in the area, and relationship between time and the number of people above the floor with the fire. Figures 10, 11, 12, and 13 indicate the number of people per second who escaped the buildings in the case of an average crowd distribution. The proposed method exhibits the lowest evacuation time because of the proposed mathematical model with the consideration of shortest evacuation time. Compared with the reference method [12], evacuation using the proposed method is approximately 43% faster for topology A, 17% faster for topology B, 29% faster for topology C, and 33% faster for topology D. This is because this paper aims at the shortest evacuation time, and has a better evacuation time than the comparison paper which aims at the safest evacuation path.

Fig. 10
figure 10

The cumulative number of evacuated people in Topology A

Fig. 11
figure 11

The cumulative number of evacuated people in Topology B

Fig. 12
figure 12

The cumulative number of evacuated people in Topology C

Fig. 13
figure 13

The cumulative number of evacuated people in Topology D

The degree of congestion is the number of people in the area divided by the maximum capacity of the area. At each time point, the most crowded area in the time zone is taken. In the case of the average crowd distribution, Figs. 14, 15, 16, and 17 show the degree of congestion. We consider the effect of crowd density on the crowd moving speed, which is equivalent to the degree of crowding in the area (divide the number of people in the area by the maximum number of people in the area). Based on this consideration, the crowd flow can be more evenly distributed to achieve uniform load on the path. Since we consider the effect of crowd density on the crowd moving speed, the degree of congestion in the proposed method is better than reference [12].

Fig. 14
figure 14

Degree of congestion in Topology A

Fig. 15
figure 15

Degree of congestion in Topology B

Fig. 16
figure 16

Degree of congestion in Topology C

Fig. 17
figure 17

Degree of congestion in Topology D

In the case of the average crowd distribution, Figs. 18, 19, 20, and 21 show the number of people above the fire floor at each time point. From Topology A, we can see that in the case of small-size topology, number of people above the fire floor at each time point is the same. When the topology becomes larger, such as Topology B, number of people above the fire floor at each time point is different, but the time to escape is the same. In Topology C and Topology D, people above the fire floor escape faster. Since the magnification of inter-floor relationship in reference [12] is fixed, the larger the topology, the more obvious the effect can be found.

Fig. 18
figure 18

The number of people above the fire floor at each time in Topology A

Fig. 19
figure 19

The number of people above the fire floor at each time in Topology B

Fig. 20
figure 20

The number of people above the fire floor at each time in Topology C

Fig. 21
figure 21

The number of people above the fire floor at each time in Topology D

5 Conclusion

This work applies technology of Wireless Sensor Network to propose a mathematical model for the fire emergency evacuation and designs the heuristic approach to solve the planning problem of the model. The proposed model considers more factors including crowd density, smoke diffusion, the capacity of each area, the capacity of the walkways or staircases, the time required to move people in each area and walkway, the location where the fires occurred, the number of people in the area, the location of the exits, the area of the fire, escape direction, and the effect of crowd density on crowd moving speed. Thanks to more considerations and the corresponding scenario, we get better results in experiments.