## 4 Results and Discussions
In particular, Figure 13a shows the weighted graph (the weights are the people on the path between two nodes) of the theme park without an alarm, while Figure 13b shows the graph in case of an alarm. In more detail, as shown by Figure 13b, when an alarm is detected by the Algorithm 2 at an i-th node (node 3 in this case), the Algorithm 3: (1) changes the name of the i-th node in the graph to point out the node in which the alarm is active (see \"N3 ALARM\" in Figure 13b); (2) removes the edge between the i-th node and the other node without an alarm; (3) if the i-th nodes are those that are near one exit (i.e., nodes 1 and 3), the name of the exit changes as well (see \"E2 CLOSED\" in Figure 13b). Note that, in order to improve the clarity of the figure below, the position of node 6 was defined so as to show the node 6-node 3 connection in a better way, and that, in case of an alarm, the weights were removed from the related graphs. Figures 14 and 15 show the safest (i.e., that do not include nodes with active alarms) and fastest (i.e., that consider the people on the edges as a resistance to the crowd flow) paths. These paths can be used by the people near each node of the system (from node 1, N1, to node 6, N6) to face the environmental/ structural emergency detected by node 3 (N3). Importantly, the Algorithm 3 also provides a path for people that are near N3 where the alarm was detected. In addition, a table that summarizes the overall conditions is reported in Figure 15c. This table shows: (i) the \"Start Node\", which is the node from which the paths start; (ii) the \"End Node\", which is the final destination of the people reaching a safe place (i.e., an assembly point); (iii) the safest and fastest path, consisting of the edges between the i-th node (Ni) and the n-th node (Ni+3); (iv) the node(s) where the alarm(s) was/were detected. Finally, Figures 16-18 report a second example of the application of the Algorithm 3, which was derived according to that shown in Figure 8b. In this case, nodes 1, 3, and 5 detected an alarm. Figure 14: Example of the safest and fastest paths provided by the Algorithm 3 in case of an environmental/structural alarm at node 3 (N3), which can be used by people at (**a**) node 1 (N1), (**b**) node 2 (N2), (**c**) node 3 (N3), and (**d**) node 4 (N4) to reach the exit 1 (E1 = N7). Figure 15: Example of the safest and fastest paths provided by the Algorithm 3 in case of an environmental/structural alarm at node 3 (N3), for people at (**a**) nodes 5 (N5) and (**b**) 6 (N6), and (**c**) is a table that shows the overall condition. Consequently, the exits 1 and 2 (herein called E1 and E2) were closed, and the target of the Algorithm 3 became the Assembly Points 1 and 2 (that are also indicated as nodes 9 and 10, or N9 and N10, in the figure below). Figure 16: Example of the results of the Algorithm 3 in case of an environmental/structural alarm at nodes 1, 3, and 5 (N1, N3, and N5), where (**a**) is the graph before the alarm triggering and (**b**) is the graph after the alarm triggering. Figure 17: Example of the safest and fastest paths provided by the Algorithm 3 in case of an environmental/structural alarm at nodes 1, 3, and 5 (N1, N3, and N5), which can be used by the people at (**a**) node 1 (N1), (**b**) node 2 (N2), (**c**) node 3 (N3), and (**d**) node 4 (N4) to reach the Assembly Points 1 and 2 (AP1 and AP2, which are also nodes 9, N9, and 10, N10). Note that Table 6 and Equation 2 report the results of a scalability analysis carried out considering a system consisting in 6, 60, 240, 480, 960 and 1200 nodes, two exits and two assembly points. Alarms were simulated considering that, in each case, 20% of the nodes (randomly selected and indicated in the following with \"A\") triggered an emergency alarm. The results refer to one of the worst conditions, i.e., the definition of the safest and shortest path to reach the exit 2 from node 1 (cf.