Modeling crowd dynamics through coarse-grained data analysis

Understanding and predicting the collective behaviour of crowds is essential to improve the efficiency of pedestrian flows in urban areas and minimize the risks of accidents at mass events. We advocate for the development of crowd traffic management systems, whereby observations of crowds can be coupled to fast and reliable models to produce rapid predictions of the crowd movement and eventually help crowd managers choose between tailored optimization strategies. Here, we propose a Bi-directional Macroscopic (BM) model as the core of such a system. Its key input is the fundamental diagram for bi-directional flows, i.e. the relation between the pedestrian fluxes and densities. We design and run a laboratory experiments involving a total of 119 participants walking in opposite directions in a circular corridor and show that the model is able to accurately capture the experimental data in a typical crowd forecasting situation. Finally, we propose a simple segregation strategy for enhancing the traffic efficiency, and use the BM model to determine the conditions under which this strategy would be beneficial. The BM model, therefore, could serve as a building block to develop on the fly prediction of crowd movements and help deploying real-time crowd optimization strategies.


1.
Introduction. Since 2008, more than half of the world population is living in cities [40], which asks for the development of large-scale multimodal transportation systems. At the core of such systems, crowds of pedestrians are to be found in transportation facilities. The massive presence of this population in airports, train stations, metro stations, etc. is a challenge in terms of safety and transportation efficiency [48,56,49]. This paper deals with the experimental analysis and modeling of crowd movements so as, at longer term, to develop operational tools to manage pedestrians in places as various as airports, train or metro stations or streets.
Managing the comfort and safety for pedestrians is difficult first because they are not operated or regulated as simply as vehicles can be through sets of rules and traffic signals [44]. Hence, it is difficult to prevent the formation of dense traffic areas, where compacted crowds are exposed to risks of stampedes [53,16]. For this reason, it is important to design pedestrian traffic management systems similar to those existing for car traffic, and more particularly simulation tools to predict the short-term evolution of the traffic from conditions measure in-situ and in real time.
Today, on the one hand, pedestrian crowd simulators are developed for the purpose of validating the layout and the structure of buildings aimed at hosting a large public. This validation is performed beforehand, at the stage of design [52]. Most are not adapted to an on-line usage. Nevertheless, on the other hand, recent progress in pedestrian tracking technologies, both for detailed trajectories [7,30,46] or global traffic conditions [2,59,51], make possible to initialize a pedestrian traffic simulators with current conditions and to perform short-term traffic predictions. This would open the possibility to anticipate risks of congestion and to react accordingly. Such simulators are lacking today, thus, it is important to focus our attention on simulators which are able to continuously process a flow of input traffic data and which are efficient enough to perform short term predictions on-line. Our work aims at filling this particular gap, by developing online simulation tools to assist the management of pedestrian traffic.
We aim at performing short term predictions in places presenting risks of large attendance and risk of congestion. A specific type of environment retains our attention: corridors. By corridors, we mean elongated areas such as metro corridors, sidewalks or shopping arcade where pedestrians form bidirectional traffic flows. This type of place is particularly interesting to study because corridors generally link large places with high attendance (e.g., a corridor between two platforms). Because the traffic intensity is higher in corridors, they are the place where congestion can more easily initiate. In addition, because corridors are often organized in networks, they offer an opportunity to apply rerouting strategies to locally limit the risk of congestion: pedestrian would be suggested or forced to avoid corridors presenting a risk of future congestion, similarly to car drivers with modern GPS-based assistance systems.
How to perform accurate and fast predictive simulation for bidirectional pedestrian traffic in corridors? Two categories of models are described in the literature: microscopic and macroscopic approaches. The former approach is an ascending one: the motion of individual pedestrians is independently simulated based on multi-agent technique and crowd traffic conditions emerge from combination of interactions between agents. They are fundamentally based on the local models of interactions, which were developed in various disciplines such as physics [19], computer graphics [47] or behavioral and cognitive sciences [43,41,5], and which dictate how agents influence each other's motion. The latter type of approach are macroscopic ones. They model a crowd as a whole, a matter moving like a compressible fluid. Relying on the conservation law, a macroscopic simulation computes the crowd motion by estimating the temporal variations of local density [50]. Algorithmic complexity is one fundamental difference between these two types of simulators. Microscopic simulators consider interactions between all possible pairs of agent and are quadratic by nature. In contrast, macroscopic algorithms are linearly complex with the size of the crowd. This difference makes macroscopic approaches a model of choice. While microscopic models are unadapted to produce real time simulations as soon as the pedestrian number becomes large, macroscopic models can provide fast, simple and yet surprisingly accurate results even at large densities.
In this paper, we propose a macroscopic model to predict bi-directional traffic in corridors. To enhance computational efficiency, we consider only the longitudinal direction of the walkway, ignoring the lateral dimension. We show hereafter that despite this simplification a macroscopic model is able to quantitatively reproduce key features of crowd dynamics. In such category of model, the relevant information encoding crowd dynamics is the fundamental diagram, which defines pedestrian flux as a function of pedestrian densities. More precisely, the proposed method relies on a "Bi-directional Fundamental Diagram" (BFD), which captures situations of a crowd made of people moving in the same and opposite directions. Fundamental diagrams are widely used for one-way traffic (since the pioneering work of Lighthill and Whitham [38]) but two-way pedestrian traffic has been scarcely investigated under the angle of the BFD [1,31,33,3,54,8,15]. Yet, two-way traffic is the most common situation in everyday life and counter-flows played a decisive role in several crowd disasters [17,18].
To characterize the BFD, several experiments have been conducted from which we establish the first result of the present paper: an estimation of the BFD from experimental data. Although Bi-directional flows have already been studied in the literature, it is the first time, up to our knowledge, that it is measured experimentally. The data are acquired in real time tracking experiment using automatic motion capture techniques [42]. Our second result is the validation of the Bi-directional Macroscopic (BM) model which uses the calibrated BFD as its core. We introduce as quantifier the cluster velocity allowing to compare quantitatively experiments and simulations. We demonstrate that the BM model captures essential features of crowd dynamics. We then test our model in a typical forecasting scenario where the crowd is recorded at two distant points. We show that the model accurately predicts the state of the corridor between the recording points and develops traveling waves similar to those observed in the experiments. Our third result is the determination of the optimum of a corridor segregation strategy consisting in separating -or notantagonist pedestrian fluxes according to the corridor occupancy. The BM model suggests that the segregation is efficient when the two antagonist fluxes are roughly balanced, but is counter-productive in strongly unbalanced cases.

Methods.
2.1. Experimental setup. In this section, we describe our experiment on pedestrian traffic. Our objective was to build a Bi-directional Fundamental Diagram (BFD), i.e., to observe the relation between the moving speed of participants under different conditions of density and balance of counter-flows. To this end, we asked participants to walk in a circular corridor delimited by walls (as displayed in Figure  1a). Some participants were instructed to walk in the clockwise direction, some others to walk in the anticlockwise direction. They were assigned a walking direction before each trial. For each trial, participants were initially still in the corridor and their positions randomly distributed. Each replication lasted 60 seconds after starting signal was given.
Participants were not allowed to communicate, and were asked to behave as if they were walking alone in a street to reach a destination. 119 volunteers participated the experiments (we performed two experimental sessions, one with 59 participants and one with 60 participants). They were adults recruited through advertising and with no known pathology which would affect their locomotion. The experiment conformed to the declaration of Helsinki. Participants were naive with respect to the purpose of our experiments.
Experiments took place in 2009 in Rennes, France. The circular corridor internal and external radius was respectively 2 and 4.5 meters. We studied 3 different proportions of fluxes, i.e., the balance of participants walking in a direction versus participants walking in the opposite direction. We studied: 100% − 0% balance, 75%−25% balance and 50%−50% balance.
We collected kinematics data. To this end, participants wore white T-shirts and 4 reflexive markers (see Fig. 1b), one on the forehead, one on the left shoulder, and two on the right shoulder. This made the distinction of the left and right shoulders easier. The motion of the markers has been tracked by 8 infra red cameras placed all around the experimental setting. Marker trajectories have been reconstructed using Vicon IQ software (VICON MX-40, Oxford Metrics, UK). The center of mass of the 4 markers projected onto the horizontal plane is computed and recorded as the position of the subjects [42,34].
2.2. Data processing. The collected data give access to the two-dimensional Cartesian coordinates (x i , y i )(t n ) (relative to the center of the arena and a fixed reference frame) of each pedestrian, as well as their associated polar coordinates (θ i , r i )(t n ) (with x i = r i cos θ i , y i = r i sin θ i ), sampled at a frequency of 10 Hz (i.e. t n = n∆t with ∆t = 0.1 s). Since we are interested in a one dimensional analysis, we focus on the angular coordinate of the pedestrians. We assign a fixed value for the radial coordinates R med = 3.25m corresponding to the median value. To estimate the density distribution of pedestrians on the arena, we use a classical The area-weighting assignment procedure: The particle i (red dot) is located in the cell C n (i) = [θ k , θ k+1 ] and is assigned to the two nodes θ k and θ k+1 in proportion to the area enclosing the opposite node. For instance, on the picture, the assignment to the node θ k is in proportion to the ratio of the shaded area to the area of C n (i).
area-weighting procedure (a.k.a. Particle-In-Cell method [9,12]). This procedure consists in assigning each pedestrian to the two neighboring nodes in proportion to the length enclosing the opposite node (see Fig. 1c). The densityρ n k is obtained by combining the contributions of all pedestrians i belonging to the two cells sharing the node k, according to the formula where the sum extends over pedestrians i belonging to one of the two cells sharing node k. The quantity S is the area of the cross section By linear interpolation, this procedure gives rise to a continuous piecewise linear reconstructed densityρ n (θ) at time t n . We can verify that the total number of pedestrian N is preserved in this interpolation procedure, i.e. k Sρ n k = N . To estimate the flux, we compute a finite-difference approximation of the azimuthal component of the velocity v n i of each pedestrian i at time t n : The densitiesρ n +,k ,ρ n −,k and fluxesf n +,k ,f n −,k of the clockwise and anti-clockwise pedestrians respectively are estimated at time t n on the polar grid θ k = k∆θ by means of the area-weighting assignment procedure described in Fig. 1c. The procedure for estimating the densitiesρ n +,k ,ρ n −,k uses Eq. 1 where the sum is restricted to pedestrians moving in the considered direction. For the estimation of the fluxes, we use the following formula where again the sum extends over pedestrians i belonging to one of the two cells sharing node k (and moving in the considered direction).

Model.
To investigate the flow of the pedestrians and make prediction, we consider a bidirectional extension of the traffic model [38,3]. Let ρ ± (x, t) be the densities at position x (along the median circle) and time t. The Bi-directional Macroscopic (BM) is written: where f (ρ + , ρ − ) is the "Bi-directional Fundamental Diagram" (BFD) (see Fig. 2a). Both Eq. 5 and Eq. 6 have the form of a continuity equation for the associated pedestrian density. It expresses that the only cause of a time variation of any of these densities in a corridor stretch [x, x + dx] is due to the flux of pedestrians entering this stretch at x and leaving it at x + dx (or vice versa according to the direction of motion). Because x corresponds to the angular coordinate θ, ρ ± are assumed periodic with period 2πR med . Since the model is a system of conservation laws, we use a finite volume method to estimate numerically its solutions [36,37]. More specifically, we use a central scheme method [3,32]. By analogy with the one-directional traffic model, we introduce characteristic speeds of the models (see Fig. 2b): Strictly speaking, the quantities λ ± are the velocities at which level curves of the densities ρ ± are convected. It corresponds to the velocity of waves that arise from a perturbation of a uniform solution given by ρ ± . Since the model is actually bidirectional, the expression of λ ± in Eq. 8 is actually an approximation (see appendix A). 3.1. Estimated bi-directional fundamental diagram. From these data, we estimate the relation between the local densities ρ + and ρ − and fluxes of the clockwise and anti-clockwise pedestrians (respectively denoted by f + and f − ). Using the reconstructed densities and fluxes, to each couple (k, n), we can associate two triples (ρ n +,k ,ρ n −,k ,f n +,k ) and (ρ n −,k ,ρ n +,k ,f n −,k ). Thus, this provides us a sampling of f + and f − . To estimate the relation between densities and fluxes, we partition the (ρ + , ρ − ) space into squared sampling cells of size ∆ρ = 0.1 m −2 . For each of these cells, we compute the average of the samplesf n ±,k conditioned by the fact that (ρ n ±,k ,ρ n ∓,k ) lies in the chosen cell. As a result, we obtain an estimated f (ρ + , ρ − ) relationship. We then seek for a parametric estimation of the fundamental diagram f (ρ + , ρ − ). The procedure consists in finding the best fit of the samples (ρ n +,k ,ρ n −,k ,f n k ) to a prescribed analytic formula. After several trials, it appears that the best fit consists in taking the velocity u + = f + /ρ + equal to an affine function of (ρ + , ρ − ) leading to the formula (9). Different parametric estimations of the fundamental diagram are then performed according to the experimental conditions. This is needed because the subjects themselves or their physical or psychological conditions differ from one experimental trial to another one. We gather replications corresponding to the same flux balance and realize three different estimations for the 50%−50% balanced fluxes case, the 75%−25% flux balance case and the mono-directional (100%−0% flux balance) case. The result of the parametric estimation is given in Table 1 and the flux for the balanced case is represented in Fig. 2a.
In Fig. 3a, we plot the BFD for the experimental data corresponding to balanced fluxes (50%−50% balance). The grey area corresponds to the absence of data, since the observed maximum pedestrian density achieved in our experiments is about 2 m −2 . It appears that the BFD is increasing in ρ + and decreasing in ρ − and reaches its maximum at the total density of 1.7 m −2 . The estimation of the decay of the BFD as a function of ρ − is one of the key results of this work. As ρ − increases, the  Table 1. Parametric estimation of the bi-directional fundamental diagram. The coefficients a, b and c refer to Eq. 9. To measure the accuracy of each regression, we estimate the coefficient of determination R 2 in the last column (the closer R 2 is to 1, the better the estimation is). density of obstacles impeding the motion of the pedestrians intensifies, resulting in an increased 'friction' [28]. We parametrize the flux f using a quadratic function of the form: with densities expressed in (pedestrians) m −2 and flux expressed in (ms) −1 . This parametric BFD is the key input in the Bi-directional Macroscopic model (5)(6). Despite its simplicity, the formula is able to capture several key features of the pedestrian dynamics as we will see below. Coefficients a, b and c are easily interpreted and thus their estimation gives insights into the pedestrian dynamics. For instance, coefficient a corresponds to the free average velocity of the pedestrians. Coefficients b and c correspond to 'friction' with respectively co-and counter-moving pedestrians. Using linear regression, we obtain the estimated values given in table 1. As an example, the estimated flux for the experiments with 50% − 50% balance is plotted in Fig. 3b. Notice that the flux is always non-negative for the density ranges observed in the experiments.
3.2. Data-model comparison: Cluster dynamics. In order to test the model, we envision a crowd forecasting system where sensors are placed at two distant  locations A and B > A of a corridor. The sensors record the densities and mean velocities of the incoming pedestrians. The model is then used to predict the occupancy of the corridor [A, B] knowing these boundary conditions. To match this situation with the ring-shaped corridor used in the experiments, we introduce a branch cut along the half line θ = 0 in polar coordinates and assume that A corresponds to θ = 0 and B to θ = 2π. Pedestrians crossing the branch cut in the clockwise (resp. anti-clockwise) direction are therefore entering the corridor at B and moving towards the left (resp. at A and moving to the right) as depicted in Fig. 4a. We use the densities estimated from the experiments as boundary and initial conditions for the BM model. Fig. 4b,c (left) show the densities ρ ± (x, t) for one of the experimental replications corresponding to 50% − 50% flux balance with 60 pedestrians, as functions of x (horizontal axis) and t (vertical axis, running downwards) in color code, from blue (low density) to red (high density). Fig. 4b,c (right) show the results of the BM model run in the crowd forecasting situation as described above. Both data and simulations exhibit the formation of clusters (which appear in intense red colors on Fig. 4b,c), separated by almost vacuum regions (in intense blue color on the figure). Clusters move along with the pedestrians but not at the same speed. Similar comparisons for the 75%−25% flux balance are presented in figure 5.

Comparison of the model's predictions with experimental data.
To compare quantitatively the model with experimental data, we estimate the average and cluster velocities (resp. u and λ) defined in Eqs. 7 and 8. We detail in appendix B the numerical estimations of these curves. On Fig. 6, the difference u − λ between the average and cluster velocities is roughly linearly increasing. Using the expression of the flux (Eq. 1) together with the characteristics speeds (Eqs. 7 and 8), the theoretical prediction gives u + −λ + ≈ 0.33 ρ + ms −1 for small ρ − . According to this prediction, this offset should increase linearly with ρ + and reach the value 0.4 ms −1 for ρ + ≈ 1.2 m −2 . This theoretical estimate provides the right order of magnitude of the experimentally observed value of u + −λ + .

Segregation strategy efficiency.
We now exploit the BM model to estimate the efficiency of a flow segregation strategy in which the two pedestrian types Since λ < u, information is propagating upstream as predicted by the BM model. circulate preferably on one side of the corridor, with half the width of the corridor devoted to each type. In practice, this strategy can be achieved by suitable signaling. On the one hand segregation reduces the influence of counter-moving pedestrians, but on the other hand the available corridor width is smaller and the density of co-moving pedestrians increases.
To measure the efficiency of the strategy, we test the model in the two situations. Let (dN/dt) S and (dN/dt) N S be the number of pedestrians per unit time that the corridor is able to accommodate in the segregated and non-segregated cases respectively, and G the gain in using the segregated strategy, i.e. the ratio of these two quantities minus one (see appendix C). The gain as a function of the densities of the two pedestrian types is plotted in Fig. 7. It appears that the segregation strategy improves significantly the efficiency of the system when the densities of the two types are both large and of the same order. However, the strategy is inefficient when one type outnumbers the other one. In this case, it is more efficient to use the un-segregated strategy. This analysis demonstrates the benefits of a strategy optimization scheme in which the decision of implementing segregation or not could be taken in real-time. Indeed, segregation offers benefits only in some regions of the (ρ + , ρ − ) plane. Since setting up a segregation strategy implies additional costs, the gain in traffic efficiency has to overtake the expense. The diagram presented in Fig. 7 helps finding which regimes of densities provide an overall benefit in separating the two inflows of pedestrians.
4. Discussion. In this work, we have set the objective to build simulation tools to assist the management of pedestrian traffic. Our attention was focused on the case of bidirectional flows because, on the one hand, it captures many common situations to be found in corridors or sidewalks, and on the other hand, it received relatively poor attention in the literature. One of our work hypothesis is that two main factors influence conditions in bidirectional traffic: density, and proportion of each directional flow.
In the first part of this work, we empirically analyze bidirectional traffic. Our main result is captured by Figure 3: we show an evidence of the influence of the density of each directional flow on the flux. To perform this empirical observation, we chose laboratory conditions. Choosing laboratory conditions allowed us controlling the goals and motivations of walkers, and limiting the effect of the other many factors which influence pedestrian behaviors, such as physiological (e.g., aging) or social ones (e.g., walking together in groups). We clearly isolate the role of the density factors we considered on the resulting traffic conditions. This however limited the amount of observation data due to the required effort to gather them (subjects recruitment, data reconstruction and processing efforts, etc.). Nevertheless, the presented method applies to any new data. As, for instance, the fundamental diagram may depend on the nature of the subjects that are using the walkway [22] (children, adults, aging people, etc.), it would be interesting to update the BFD from dataset with controlled population.
In the second part of this work, we introduce a first order model to estimate the bidirectional fundamental diagram. In spite of the relative simplicity of this model, we demonstrate the ability to adhere to observation data, as illustrated by our results reported in Table 1. We observe that the estimated average velocity a consistently takes similar values throughout the 3 sets of experiments. Friction with the co-moving pedestrians b is surprisingly larger in the experiments with a 50%−50% balance. It exceeds the friction with counter-moving pedestrians (i.e. b > c). One explanation of this result is the emergence of lanes. In the experiments with 50%−50% balance, lane formation is very strong whereas it is scarcely observed in the experiments with 75%−25% or 100%−0% balance. On the one hand, lane formation reduces the interactions with counter-moving pedestrians and thus decreases the friction coefficient c. But on the other hand, it enhances clustering with co-moving pedestrians and thus increases the friction coefficients b. Without lane formation, pedestrians need to maneuver to avoid counter-moving pedestrians resulting in a reduction of the fluxes. Thus, counter-moving pedestrians are more disruptive to the flow in this case which is why c > b in the experiments with 75%−25% balance.
As a result, the friction coefficients b and c are associated with complex pattern formation in the longitudinal direction such as clustering as well as in the lateral direction such as lane formation. They provide a simple yet effective characterization of various flow regimes. The Bi-directional Macroscopic (BM) model critically depends on the three parameters a, b and c. By varying them, we can span various types of pedestrian behavior. As such, the BM model is capable of describing complex pedestrian behavior while having the efficiency of a one-dimensional model. Of course, one can make the flux expression f more complex to include all possible scenarios in a single expression. But this is at the cost of introducing new parameters which need to be estimated and this decreases the efficiency of the model in real-time crowd control situation. Therefore we prefer to use a greedy modeling approach with a simple (but not simplistic) model. The accuracy of the model can however be discussed with respect to the employed data-set. We have limited the role of secondary factors, we may expect to have a lower adherence using real, non-controlled, kinematics data (e.g., outdoor video tracking). This possible loss of accuracy need to be evaluated, nevertheless, we can expect that our results still hold in many cases, such as metro corridor traffic at rush, where most of the traffic is composed of pedestrian moving individually.
In the last part of this work, we have chosen to evaluate our model based on an analysis of cluster dynamics. The emergence of clusters as a consequence of density fluctuations is a classical example of spatio-temporal patterns in traffic flow phenomena [20,27], also known as Kinematic Waves [38,35]. Comparing the largescale dynamical features of the clusters in the simulation and the data provides a practical way to assess the validity of the BM model. For a given type of pedestrians (clockwise or anti-clockwise), clusters are defined as regions of space where the density of this type of pedestrian exceeds a certain threshold value (see appendix B). Fig. 6 gives the estimated average pedestrian velocity u (in red) and cluster velocity λ (in green) as functions of the density of pedestrians for the experiments (circles) and the simulations (solid lines) in the balanced flux case (50%−50%). We notice an excellent agreement between experiments and simulations despite some discrepancies at low density (i.e. ρ + < .4m −2 ). Those discrepancies could be explained by the fluctuations in the experiments at low density which perturb the estimation of u and λ. Fig. 4 has already provided a qualitative comparison between traveling waves in the experiments and in the model, Fig. 6 provides a quantitative estimate of the resemblance. We notice that pedestrian velocity u is always faster than the cluster velocity λ. This indicates that the information is propagating upstream. Moreover, when the density increases, we observe a faster decay of the cluster velocity λ compared to the average velocity u (i.e. u−λ is increasing with ρ). This implies that perturbations propagate faster at large density as it is predicted by the BM model (see Fig. 6).

5.
Conclusion and future work. We have presented a study on bidirectional flows of pedestrian. We have first presented an experimental measurement of the bidirectional fundamental diagram, with changing conditions of flow proportions. We have then introduced a bidirectional traffic model, directly based on this diagram (a.k.a. "first order models") for efficiency reasons. Finally, we demonstrate a relevant application of our model in the frame of automated traffic management systems, allowing users to estimate the benefit to flow segregation strategy to improve traffic.
The power of our approach is to capture complex phenomenon with a simple framework involving only three parameters. Moreover, one can easily extend the model to encompass more advanced features. As a first research direction, we would like to use real-time estimation of crowd parameters as it has been developed in several studies [39,60,58,26,21,57,13] to update the BFD diagram. The data assimilation strategy outlined above will be able to adapt the BM model quickly to changes in the nature and composition of the crowd.
Another possible extension would be to use models involving a differential relation between the flux and the local densities [4,45] (a.k.a. "second order models"). Those models could generate metastable equilibria and phase transitions, which play an important role in traffic [29,27]. Still, our first exploration of the data does not indicate that metastability plays an important role in pedestrian traffic.
To extend our work in two-dimensions (i.e. take into account the radial component), one has to consider the direction of the flow of pedestrians. Several macroscopic models have been proposed [24,23,6] with the introduction of a minimization principle to select the best route. Since most of bidirectional pedestrian flow have been studied at the microscopic level with Cellular Automata models [10,25,55,14], it will be compelling to compare the two approaches.
Finally, it would be interesting to test the framework in a more complex environment such as a network of corridors. Several strategies could be tested to decongest traffic such as indicating which corridor to use depending on its occupancy. Hence, the efficiency of a network could be measured allowing to improve its design for safer evacuation.
Appendix A. Analytic estimation of the cluster velocity λ. In a one-way traffic, there is only one type of density ρ and the flux is simply given by f (ρ). The characteristic velocities are then defined as (see Fig. 6b): In a bi-directional traffic, there are two values for the cluster velocities, denoted by λ ± (ρ + , ρ − ). Indeed, the flux function f (ρ) must be replaced by the BFD f (ρ + , ρ − ) and the quantity f (ρ) must be replaced by the matrix Cluster velocities λ ± (ρ + , ρ − ) are the eigenvalues of this matrix. They have been computed in [3] and are equal to The eigenvalues λ ± are real (i.e. the BM model is hyperbolic [37]) if and only if ∆ > 0. This is the case in the situation (met in our experiments) where In general, it is not possible to associate one of these eigenvalues to either one or the other pedestrian species ρ + and ρ − . For instance, if we denote ρ 1+ and ρ 1− the perturbations of ρ + and ρ − , there are not convected by λ + and λ − . Instead, λ + and λ − are convecting the following linear combinations: This means that the densities ρ ± are not purely convected. However, in the regime characterized by ε 1 (Eq. 10), we find that In this approximation, the densities ρ ± are purely convected with velocities λ ± , which means that we can associate λ + and λ − to the velocities of clusters of the clockwise and anti-clockwise moving pedestrians respectively. In this approximation, to the first order in ε, we find: which gives a situation similar to car traffic.
Appendix B. Identification and quantification of clusters. Cluster analysis provides a lens to analyze emergence of macroscopic structures in pedestrians dynamics. From a macroscopic viewpoint, a cluster at a given time t is a connected set of points x where the density ρ(x, t) is larger than a given threshold h (see Fig. 8a).
Obviously, there are different clusters for the clockwise (ρ = ρ + ) and anticlockwise (ρ = ρ − ) pedestrians. As clusters move in time, they are bounded by level curves To determine a cluster, we first need to construct the cluster boundaries, i.e. the curves X(t) defined by (12), from the pointwise estimation of ρ ± .
To construct such curves X(t), we consider ρ n (x) the continuous piecewise linear function of x which interpolates the estimated density ρ n k at a given time t n (here, we indifferently use the notation ρ for ρ + and ρ − ; the ± indices will be used below to designate the start and end points of the clusters). For a given threshold h, we determine two sets of points X ± j , j = 1, . . . , J such that ρ n (X ± j ) = h and ±(dρ n /dx)(X ± j ) > 0. The number of points in each set is the same, J, due to the periodicity of ρ n . It is finite unless ρ n (x) has constant value h on a whole interval, a non generic situation that we discard.
The j-th cluster is defined as the interval [X + j , X − j ], because, due to the conditions on the derivatives, we have ρ n (x) ≥ h for all x belonging to this interval (see Fig. 8). We now consider two consecutive time intervals t n and t n+1 . We connect X − j (t n ) to X − j (t n+1 ) and X + j (t n ) to X + j (t n+1 ), if the two consecutive points are closer than a threshold value set to λ 0 ∆t, with λ 0 = 3.3 ms −1 . The temporal sequences of connected points X ± j (t n ) define, after time-interpolation between the discrete time values, some level curves X ± j (t). When the matching procedure defined above finds no solution, the corresponding level curve is ended.
This procedure can be repeated for different levels h, and yields different families of level curves X(t) (see Fig. 9a). When the time interval of existence of a level curve (or lifetime) is too short, that level curve is considered as irrelevant and is removed. Minimal existence time of 1, 2 and 3 seconds have been retained (see Fig. 9b for the example of a cutoff at 3 seconds). In order to remove further oscillations of the level curves (which are associated to the spatial discretization of ∆x = 0.6 m), we filter them by convolution in time with a truncated Gaussian function with a support larger than ∆x, adapting the normalization of the Gaussian to accommodate for the beginning and the end of the level curve (see Fig. 9c).
From the level curves X(t), we can then deduce the cluster velocity λ, that is the velocity at which the level curves are transported (see Fig. 8b). One should rather speak of 'cluster edge velocity' since clusters have two boundaries, each of them having its own speed, but as they are of the same order, we will use the term 'cluster velocity' for short. To estimate the cluster velocity λ on each level curve of density level h, we compute its average slope. The slopes of the different connected components of a given level curve are computed independently and later on averaged. A weighted average with weights equal to the lifetime of the corresponding connected component is applied. This procedure leads to an estimate of λ as a function of the specific density level h. Thus, if we restore the indication ρ for the density level h, we obtain λ as a function of ρ.
Appendix C. Estimation efficiency of segregation strategy. To estimate the efficiency of the segregation strategy, we compare the total flux of pedestrians when the two species of pedestrians ρ + and ρ − are mixed or segregated in a corridor. Without a segregation strategy, we suppose that the densities ρ + and ρ − are uniformly spread on the corridor. We assume here that the estimation of the flux f is independent as the corridor width. That will be more likely to be true for large corridor since the boundary effects would be less important. Thus, the number of pedestrians passing through a cross section per unit time is given by: where L is the size of the corridor. The flux f + is estimated from an interpolation of the three flux functions obtained in Table 1. More precisely, we use a quadratic regression to estimate each coefficient a * , b * and c * at the ratio ρ+ ρ++ρ− using the data of Tab. 1. Then, we use those coefficients to estimate f + (ρ + , ρ − ) (see Eq. 9).
If the species ρ + and ρ − are segregated on each side of the corridor, the size of the corridor is divided by 2 and the density of co-moving pedestrian is multiplied by 2. Thus, we obtain: dN dt S = f (2ρ + , 0) + f (2ρ − , 0) L.
Then, the relative gain of the segregation strategy G is estimated through the following formula:    Figure 9. Level curves of the density. Level curves X(t) for various levels h for the replication displayed in Fig. 4 and clockwise pedestrian density ρ + . Horizontal axis is space and vertical axis is time, running downwards. The color code corresponds to the level height h, from blue (lower levels) to red (higher levels). Acknowledgment. This work has been supported by the French 'Agence Nationale pour la Recherche (ANR)' in the frame of the contracts 'Pedigree' (ANR-08-SYSC-015-01) and 'CBDif-Fr' (ANR-08-BLAN-0333-01). PD acknowledges support by the Engineering and Physical Sciences Research Council (EPSRC) under grant no. EP/M006883/1, by the Royal Society and the Wolfson Foundation through a Royal Society Wolfson Research Merit Award no. WM130048 and by the National Science Foundation (NSF) under grant no. RNMS11-07444 (KI-Net). PD is on leave from CNRS, Institut de Mathématiques de Toulouse, France. SM was supported in part by NSF grants #1107444 (KI-Net) and #1515592.