## Introduction

Rapid urbanization has led to over half of the world’s population living in cities, making it crucial to understand urban characteristics such as infrastructure, facilities, population distribution, jobs, and services that play a key role in health, urban livability, and sustainability1,2. The recent availability of digital traces from Information and Communications Technologies has enabled the study of urban systems with unprecedented spatiotemporal resolution, giving rise to a highly interdisciplinary endeavor, loosely termed as the science of cities3,4,5. Past research indicates a connection between urban characteristics and city spatial organization, giving rise to a debate regarding the optimality of such structures as it relates to livability6,7. It has been argued that the increase of population, along with the congestion induced by the concentration of activity, drives cities from a monocentric to a polycentric configuration8,9. While polycentricity accounts for the number of distinct activity centers, urban sprawl is related to how spatially scattered they are. Cities can be compact, with all centers in a single district, or sprawled if the centers are far apart, although typically, they exist in a continuum between these two limits10.

Indicators of urban organization have been proposed based on population density, land use, employment, and infrastructure distributions11,12,13,14,15,16. While, traditionally, these metrics are estimated from surveys and satellite imagery17, emergent mobile technologies allow for a more direct, timely, and precise measurement of human mobility18,19,20,21,22,23. Mobility, as a product of the citizens needs, residence/job locations and transportation infrastructures, bears important insights on the dynamics taking place in cities10,24,25,26. Empirically, it has been observed that the concentration of jobs, amenities, services and other related socioeconomic activity is distributed across multiple spatial centers—so-called hotspots—the geography of which strongly influences mobility flows26,27. Given this connection, the location of these hotspots can be directly extracted from mobility28,29.

Here, we use anonymous and aggregated flows from users who opted-in to Location History to extract patterns of global intraurban trips to quantify the organization of urban mobility. We begin by extracting the hierarchical structure of hotspots in cities, and develop a metric, the flow-hierarchy, that is based on the interaction between hotspots. The metric allows us to classify cities based on their level of dynamical hierarchy and thus establish a connection to key urban indicators. Specifically, we show that cities with larger mobility hierarchy display more population-mixing, extensive use of public transportation, higher levels of walkability, lower pollutant emissions per capita and better health indicators. The flow-hierarchy contains more information on urban features than traditionally used metrics such as population density and urban sprawl. We conclude with a discussion of the implications of our findings, including possible policy directions as it relates to urban planning.

## Results

### Aggregation of Trip Flows

The anonymous mobility patterns are aggregated over Google users who opted-in to Location History [https://support.google.com/accounts/answer/3118687]. This dataset contains trip flow information from over 300 million people world-wide (including residents and visitors of cities) for the year 2016, aggregated weekly and with spatial granularity corresponding to S2 cells [https://github.com/google/s2geometry] of approximately 1.27 km2 (Details in Supplementary Note 1). These trip flows were obtained within the framework of the Mobility Map project, in which machine learning techniques were applied to anonymized logs data to segment a raw GPS trace into semantic trips. The system automatically found trips by taking into account a variety of signals, such as timing of location points, dwell times, and other factors30. All trips were anonymized and aggregated by jointly applying differential privacy via the Laplace mechanism in combination with k-anonymity. The automated Laplace mechanism adds random noise drawn from a zero mean Laplace distribution and yields ($$\epsilon$$, δ)-differential privacy guarantee of $$\epsilon$$ = 0.66 and δ = 2.1 × 10−29, which is very strong. The parameter $$\epsilon$$ controls the noise intensity in terms of its variance, while δ represents the deviation from pure $$\epsilon$$-privacy. The closer it is to zero, the stronger the privacy guarantees. For example, with these values of the parameters, an attacker knowing that the dataset was generated using $$\epsilon = 0.66$$ and desiring to know whether a user was included would at best improve the level of certainty over a random guess by approximately 16%. Further information on the aggregation procedure can be found at31 and [https://policies.google.com/technologies/anonymization]. No individual user data was ever manually inspected, only heavily aggregated flows of large populations were handled.

The trip flow data can be interpreted as weighted networks formed by S2 cells as nodes, and flows as link weights. Figure 1a shows the network in North America and the inset focuses on the New York City area (intra-cell flows are not included in the analysis). In what is to follow, we analyze 127 American cities (those with a population greater than 400,000), and 174 of the most populated global cities that are present in our dataset (see Supplementary Note 2, Supplementary Figs. 1 and 2 and Supplementary Tables 1 and 3 for details). The network sizes are roughly the same order of magnitude as those that can be constructed from commuting data available in the US census (although our data contains much more mobility information than merely commuting). For example, New York City, the most populated US metropolis with almost 20 million inhabitants, has a network of 6,213 cells and 110,798 connections (an average degree of 17.8). Medium-sized cities such as Atlanta with a population around 5 million has a mobility flow network with 4156 cells and 46,333 links. (See Supplementary Table 2 for a list of US cities with the number of cells and links).

### Hotspots and flow-hierarchy

Hotspots are identified by setting a threshold on the number of outgoing trips in every cell (incoming and outgoing trips are roughly symmetric (see Supplementary Figs. 3 and 4). The threshold for each hotspot level is assigned by iteratively applying a nonparametric method based on the derivative of the Lorenz curve26. The Lorenz curve is the sorted cumulative distribution of outflows and is obtained by plotting, in ascending order, the normalized cumulative number of nodes vs. the fraction of total outflow. The threshold is then obtained by taking the derivative of the Lorenz curve at (1, 1) and extrapolating it to the point at which it intersects the x-axis. Once hotspot nodes at a level $$\ell$$ have been extracted, they are excluded from the distribution, and the threshold is recalculated such that new hotspots at level $$\ell + 1$$ are assigned (see Supplementary Note 3 and Supplementary Fig. 5 for more details on the method). The procedure is illustrated up to level $$\ell = 5$$ for New York City in Fig. 1b, where Lorenz curves are depicted in progressively transparent shades of blue (and corresponding slopes from red to yellow) as one goes down in levels.

The extracted spatial distribution of hotspot levels display a range of patterns across cities; examples are shown in Fig. 1c–e for Paris, Bangkok and Los Angeles (~10 million inhabitants) and in Fig. 1f–h for Alexandria, Santiago de Chile, and Sydney (~5 million). For those cities with similar populations (rows in the Figure), the observed spatial distribution is substantially different: Paris and Alexandria have hotspot levels organized in an onion-like structure; Bangkok and Santiago have hotspots that are spread out away from the center; and, finally, those in Los Angeles and Sydney are scattered across the city. Apart from the spatial distribution, the number of levels as well as the number of hotspots per-level vary across cities (see Supplementary Fig. 5c, d). However, the corresponding distribution of total outflow is relatively stable across cities and is fairly heterogeneous, with the majority of flows contained in the first three or four levels (Supplementary Fig. 5e, f).

The top-heavy nature of the flows, combined with the observed differences in the spatial distribution of hotspots, indicates different degrees of hierarchical structure in terms of mobility. To quantify this hierarchy, we investigate the extent of interaction between hotspots of varying levels of activity. We construct a matrix T with elements Tij corresponding to trips between hotspots at levels i and j, normalized by the total number of intracity trips, in order to compare across cities with different populations. Since the archetypal hierarchical structure is a tree, the extent to which cities are tree-like or flat in terms of trip flows is captured by the flow-hierarchy Φ, defined as the tri-diagonal trace of T (see Fig. 2a)

$${\it{\Phi }} = \mathop {\sum}\limits_{i = 1}^{L - 1} {\left( {T_{ii} + T_{i(i + 1)} + T_{(i + 1)i}} \right)} + T_{LL}\hfill \\ = \mathop {\sum}\limits_{i,j = 1}^L {T_{ij}} \left( {\delta _{ij} + \delta _{i(j - 1)} + \delta _{(i - 1)j}} \right).\hfill$$
(1)

Here, L is the total number of hotspot levels (varying from city-to-city) and δij is the Kronecker delta. The metric is one if the flow interaction occurs only between same- or adjacent-level hotspots (tree-like structure), and close to zero if flows are flat, i.e., distributed uniformly across all L hotspot levels. Thus, higher values of Φ correspond to a stronger hierarchical organization. (See Supplementary Note 4 and Supplementary Figs. 68, for details of the calculation, including dependence on city size and boundary effects.)

In Fig. 2b, we show a subset of the cities ranked in terms of the flow-hierarchy along with three examples of the corresponding flow-matrices. Included in the set are the cities whose spatial distribution of hotspots are shown in Fig. 2 (marked in bold). A clear monotonic trend is apparent whereby decreasing values of Φ correspond to spatially scattered distribution of hotspots, indicating that the flow-hierarchy also contains spatial information of the mobility. The complete set of worldwide cities is shown in Fig. 2c (and Supplementary Table 4), ranked in decreasing order of Φ, and colored according to continent. The figure indicates a remarkable continental trend, whereby Asian and African cities are among the most hierarchical followed by European, American and, finally, those located in Oceania. The trend is even clearer when plotting the average flow-hierarchy per continent against the average ranking (shown as inset).

Given that the definition of Φ is general and nonparametric, it can be used for any flavor of mobility data22. As a comparative exercise, we also calculate Φ from commuting data for US cities, extracted from the census (Supplementary Note 5 and Supplementary Figs. 10 and 15). As commuting captures only a subset of total mobility, the top level hotspots do not necessarily coincide, although the correspondence is strong in the city center, it is weaker in the suburbs (See Supplementary Fig. 11 for the case of New York City). While commuting captures primarily residential and office locations, the hotspots extracted from the trip-flows also include major transportation hubs, leisure centers, and areas of major economic activity (Supplementary Fig. 12 and Supplementary Table 5). Due to this difference, the flow-hierarchy obtained from commuting data is systematically lower than that obtained from the trip-flows, although notably the trend is the same. In addition, Φ can be also defined at different spatial scales. Starting from the S2 cells, we have mapped into a square grid of different cell sizes (Supplementary Note 4). We find that the values of Φ for the American cities is coherent across scales, the value may slightly change but the ranking of cities according to Φ is stable (Supplementary Fig. 9).

### Null models

In order to determine whether our calculated values for the flow-hierarchy are a function primarily of the heterogeneous distribution of trips or contain additional information such as the spatial layout of the hotspots, we need a suitable reference value or null model. An obvious first choice would be to consider the case where the movements in cities are fully mixed, or in other words follow an uniform distribution. If flows are distributed uniformly between hotspot levels, then it is easily seen that Φu = (3L − 2)/L2. For the case of New York, L = 14 and therefore in a variant of the city with uniform flow distribution Φu = 0.20, which is significantly lower than the empirically measured value of Φ = 0.92. Given that the observed values in cities lie in a range 0.77 ≤ Φ ≤ 0.95 (Supplementary Table 4), a more robust reference point is needed that takes into account the heterogeneous distribution of flows across hotspot levels (Supplementary Fig. 5). Consequently, we next generate random variants of each city by rewiring the flows across levels while preserving the empirical flow distribution. A null trip matrix can then be produced as

$$T_{ij}^{\mathrm{h}} = \mathop {\sum}\limits_{k = 1}^L {T_{ik}} \times \frac{{\mathop {\sum}\limits_{m = 1}^L {T_{mj}} }}{{\mathop {\sum}\limits_{m,k = 1}^L {T_{mk}} }}.$$
(2)

Here, $$\mathop {\sum}\nolimits_k {T_{ik}}$$ is the total outflow of level i and $$\mathop {\sum}\nolimits_m {T_{mj}} /\mathop {\sum}\nolimits_{mk} {T_{mk}}$$ is the fraction of inflows for level j. The resulting flow-hierarchy Φh is a function of the heterogenous distribution of flows and neglects any spatial correlation between the hotspots. In Fig. 3a and b, we show the differences between the randomized and empirical flow matrices for New York City, with the former having a upper-triangular structure in contrast to the nested structure seen in the latter. The resulting value of the flow hierarchy, Φh = 0.65, is much lower than the empirical value Φ = 0.92. In Fig. 3c, we show a subset of American cities, comparing them to their randomized counterparts, finding that in all cases the empirical values of Φ are consistently higher, indicating an inherent hierarchical structure that relates to spatial correlations of the mobility flows, in addition to the heterogeneity in their distribution.

### Connection between urban indicators and flow-hierarchy

Next, we examine the connection of the flow-hierarchy with other urban indicators such as transportation, pollutant emissions, and health. We note that connections between such indicators and existing measures of urban structure, such as population density and urban sprawl have been previously established and used to inform urban policy2,6,16,32,33,34,35,36,37,38. The mobility patterns are ultimately shaped by the urban infrastructure, population distribution and the attendant socioeconomic needs of citizens, therefore it is natural to expect similar connections. Given that Φ captures the structural organization of mobility across the entire city, it is an ideal metric to study these potential relations. Indeed, cities that are more hierarchical tend to have higher population densities and are more compact (Supplementary Figs. 22, 23, and 25). To investigate the connections, we collected metadata for the full set of US cities, a choice motivated by the fact that the data is relatively homogeneous and reliable, given that it is collected by a single agency (See Supplementary Note 8 for details).

We start by considering the modal transportation share. For cities with an extensive public transportation system, there are likely many transportation hubs, that in principle could facilitate the emergence of hotspots, enhancing the hierarchy of mobility flows. Thus, a priori, one would expect to see a strong connection between the presence of public transportation (and its use) and stronger hierarchies in the mobility patterns. In Fig. 4a–c, we plot Φ against various commuting modes: by car, by public transportation and on foot, respectively. The Pearson $$R_{\mathrm{P}}^2$$, is at least 0.4, with all three p values below 0.001 (full list of p values for all urban indicators in Supplementary Table 6). Strongly hierarchical cities show higher levels of public transportation usage and more pedestrian trips, while transportation in the less hierarchical ones is dominated by the use of private cars. Similar trends exist for other transportation metrics such as vehicle-miles traveled (VMT) per capita and transit trips per capita (Supplementary Fig. 19). We note, however, that while the connection between Φ and public transportation usage holds on average, the explained variance is 0.45 and there are important exceptions. In particular, both Los Angeles and San Francisco have comparable hierarchical structure, yet differ significantly in their modal share, with the latter displaying a much higher share of public transportation and lower car usage. Indeed, both Los Angeles and San Francisco have comparable values of per-capita VMT (Supplementary Fig. 19a) despite the differences in car modal share, indicating that residents of San Francisco typically travel longer distances than those in Los Angeles. This implies that a centralized public transportation network by itself does not facilitate hierarchy in mobility flows, instead other factors such as spatial constraints, geographic impediments and corresponding land usage are important as well.

Given the established connection between car use and pollution37,38, one might expect to see a similar relation between Φ and pollution indicators. Yet, once again, the emission of pollutants is not only related to the use of transportation modes. The quality of transportation infrastructure, congestion and geographical features also play an important role. In Fig. 4d–f, we plot Φ against emission of NOX, CO, and particulate matter (PM10), finding that pollution emissions are anticorrelated with higher levels of hierarchy (See Supplementary Table 7 for connection with PM2.5 emissions). However, the shape of the LOESS fit and the general trend in Fig. 4a are very different from those in Fig. 4d-f (one is concave and the other is convex). Indeed, it appears that the total emissions are shaped more by the per-capita VMT than the car modal share, with similar shapes for the LOESS fit. This is confirmed by the fact that Los Angeles and San Francisco are quite comparable in their pollution emissions and VMT values, despite the large differences in modal share. Given that Φ also captures the spatial distribution of the hotspots—the distance between which influences the length of trips—if hotspots are organized as in Paris (Fig. 1c) with a single clear nucleus, as opposed to the more scattered configuration of Los Angeles (Fig. 1e), Φ is higher and the trips tend to be shorter.

We next explore the relation between Φ and health indicators on account of the strong observed relation between pollution and public wellness39,40. We consider first the prevalence of ischemic stroke, whose incidence is known to be directly affected by the pollutant concentration in the atmosphere32,36. While there appears little connection between the flow-hierarchy and prevalence (Supplementary Fig. 21), we find a clear connection with the mortality rate, with a monotonically decreasing trend with increased Φ (Fig. 4g). It is well-known that the survival rate for strokes is strongly dependent on timely medical attention; either provision of emergency services at home, or ease of access to hospitals41,42. Indeed, Fig. 4h shows that the average distance to hospitals from any given area in the city decreases with increasing Φ. This connection is likely due to a combination of factors. First, we note the correlation between Φ and the average population density as well as its spatial distribution (Supplementary Figs. 22 and 23). Denser cities display a more hierarchical organization of mobility, with a concentration of high-level hotspots in a single area. With the reasonable assumption that medical services are distributed according to population, denser cities have comparatively higher number of such facilities in a given area as compared to sparser cities, implying more proximity to such facilities on average. The presence of well developed public transportation, which is more common (on average) in more hierarchical cities, may also play a role as it contributes to decreased traffic congestion and facilitates ease of travel in more dense areas as compared to using cars alone. However, given the comparable mortality and proximity values seen for Los Angeles and San Francisco, which differ in public transportation share, but are similar in terms of per-capita VMT, proximity to medical facilities as a function of the population density and its spatial distribution seem to be the primary causal factors. Note that merely the average population density in itself is not sufficient to explain these trends (Supplementary Fig. 24g–i). The need for prompt medical attention is crucial also in traffic accidents, and we find the same connection between Φ and accident mortality in Fig. 4i even while accounting for the differences in modal share across cities (Supplementary Fig. 20). The proximity of high-level hotspots in cities with large values of Φ is also the likely causal mechanism behind the observed greater pedestrian activity, which can contribute to better health.

The results indicate that the flow-hierarchy contains markedly more information on urban indicators than population density (Supplementary Fig. 24) and is comparable to, or in some cases, better than measures of urban sprawl (see Supplementary Table 9, Supplementary Fig. 26). In addition, we find that the correlations are temporally stable (Supplementary Table 8), robust with respect to population thresholds (Supplementary Table 7) as well as to the removal of outlier cities (Supplementary Fig. 18). While it is difficult to extend the complete analysis for global cities—due to limited availability of homogenized data—we can do so for a restricted set of indicators, including transportation and certain types of pollutant emissions. Figure 5a shows the same trend between modes of transportation and Φ as seen for US cities. In addition, greenhouse-gas (GHG), NOX and CO2 emissions are anticorrelated with hierarchy (Fig. 5b, c and Supplementary Figs. 27 and 28) in the same fashion as other pollutants seen for US cities.

It is likely that other socioeconomic variables and behavioral factors influence urban indicators, quite apart from the flow-hierarchy. To evaluate such influence, we performed a detailed multivariate analysis considering additional relevant socio-economic variables for each of the studied transportation, environmental and health indicators (Fig. 6). The variables are not necessarily independent or orthogonal to Φ, as can be seen for cases when the blue bar is smaller than the green one. While the inclusion of other variables increases R2, we observe important gains (ranging from 20 to 280%) with the incorporation of Φ. For example, flow-hierarchy explains over 0.3 R2 in chronic obstructive pulmonary disease (COPD) prevalence. Even when smoking—a major factor in COPD—is included in the model, Φ accounts for an additional 40% of variance (most likely due to is connection to pollution emissions), indicating its ability to capture multiple factors in a single metric. Data sources are listed in Supplementary Note 9, and the full analysis (including a comprehensive set of health and transport indicators) is shown in Supplementary Tables 1030.

## Discussion

We have presented a thorough investigation of the mobility structure of cities based on how populations traverse high activity areas (hotspots). Our metric, the flow-hierarchy Φ, derived entirely from trip-flows, quantifies the hierarchical organization of urban mobility. While hierarchies across cities have been extensively studied since Christaller’s work in the 1930s43, in terms of one city the focus has been primarily on the differences and comparative advantages between core and peripheral structures, as well as whether cities are mono- or poly-centric. Our results instead show that cities lie across a rich spectrum of hierarchical organization that appears to strongly correlate with a series of urban indicators including population-mixing (See Supplementary Note 7 and Supplementary Figs. 16 and 17), transportation, pollution, and health. More hierarchical cities (in terms of flow being primarily between hotspots of similar activity levels) tend to have greater levels of mixed-populations, wider use of public transportation, higher levels of walkability, lower pollution emissions, and better indicators of certain measures of health. Where applicable, we have provided hypotheses and plausible explanations for the observed connections between mobility and our considered urban indicators, paving the way for a more thorough investigation into the complex interplay between the considered metrics.

While existing measures of urban structure such as population density and sprawl composite indices correlate with Φ (Supplementary Figs. 23 and 26) and with urban indicators (Supplementary Figs. 24 and 26), the flow-hierarchy conveys comparatively more information, as also demonstrated through a multivariate analysis that includes behavioral and socioeconomic factors. Furthermore, measures of urban sprawl require composite indices built up from much more detailed information on land use, population, density of jobs, and street geography among others (sometimes up to 20 different variables6). In addition to the high data requirements such metrics are also costly to obtain; censuses and surveys require a massive deployment of resources in terms of interviews, and are only standardized at a country level, hindering the correct quantification of sprawl indices at a global scale44. On the other hand, the flow-hierarchy, being constructed from mobility information alone, is comparatively much more accessible in terms of both cost and availability of data. Indeed, given the information content inherent in Φ—levels of hierarchy, spatial distribution of activity, quality of urban indicators—it can be deployed efficiently and at scale in those parts of the world where there is little-to-no metadata for urban indicators. The metric is completely general and nonparametric, enabling it to be extracted from any mobility data (including, as we demonstrated, commuting flows extracted from the census), although the most accurate results are obtained when the full spectrum of mobility is considered. Apart from Location History data and surveys, Φ can easily be calculated from mobile phone records22 or Location Based Social Networks23.

Given the ongoing debate on the optimal structure of cities6,32,37, the flow-hierarchy introduces a different conceptual perspective compared to existing measures, and can shed new light on the organization of cities. Indeed, while the metric is based on trip-flows, mobility, in addition to opportunity and demand, is strongly shaped by geography, land-use and quality of infrastructure. From a public-policy point of view, it is instructive to note that cities with greater degree of mobility hierarchy tend to have more desirable urban indicators. Given that this hierarchy is a measure of proximity and direct connectivity between socioeconomic hubs, a possible direction could be to shape opportunity and demand in a way that facilitates a greater degree of hub-to-hub movement than a hub-to-spoke architecture. The proximity of hubs can be generated through appropriate land use policies, that can be shaped by clever zoning laws in terms of business, residence or service areas. The presence of efficient public transportation and the comparatively lower use of cars is another important factor; although public transportation is not enough in terms of facilitating ease of access and lowering pollution, when countered by comparatively longer car trip-lengths as seen in the case of San Francisco. Perhaps a combination of policies, such as congestion-pricing, used to disincentivize private transportation to socioeconomic hubs, along with building public transportation in a targeted fashion to directly connect the hubs, may well prove useful.

## Methods

### Flow-hierarchy estimation from trip-distribution models

It is instructive to check whether the flow-hierarchy can be accurately extracted from aggregated trip distribution models such as the gravity, radiation and population-weighted opportunity45,46,47. In principle, these models are expected to generate realistic trip flows between locations (with varying degrees of accuracy), given input information such as the population in the locations or the trip out-flows of every cell.

We focus on US cities and use two trip-flows from the the US census and from our Location History data (Supplementary Note 6). In Supplementary Fig. 13, we show the comparison obtained from the models for each of the inputs. Using only census data as an input (Supplementary Fig. 13a) does a poor job of reproducing the empirical values, but this is to be expected, as the data contains primarily work–home commutes. However, using the trip-outflows from the Location History as input (Supplementary Fig. 13b), we see a much better correlation of Φ between the models and the data, with the radiation model being the most accurate. Nevertheless, no model exactly reproduces the empirical values; the stronger non-linearities present in the radiation model foster the flows between top hotspot levels leading to a mild overestimation of Φ, while the linear dependence on the masses in the other two models generates comparatively less flows between high-level hotspots thus leading to an underestimation. This can be seen in the matrices of flows between hotspots (Supplementary Fig. 14 for New York City), where the radiation model produces a hierarchical structure that most closely matches the real structure of New York (Fig. 2a). To confirm this hypothesis, we test a nonlinear version of the gravity model with (Supplementary Fig. 15), finding increasingly good agreement with empirical values as one moves progressively from a linear to quadratic dependence on the masses. In combination, the results indicate that the efficacy of using these models to estimate Φ varies with th eamount of information available on the different types of mobility. In all cases, however, it appears that the out-flow by itself is a sufficiently good estimator.