Mexico City is the capital of Mexico, with over 9 million inhabitants and a floating population of over 22 million composed of daily commuters and international visitors. Being the seat of the federal government and concentrating a large fraction of Mexican corporation headquarters, it is the largest city in the country.
Megacities such as Mexico City behave as a complex system [1, 2] : adaptive, evolving, and composed of several layers of interactions, from infrastructure and transport networks to physical interactions between individuals.
The physical contacts of people within the city are a reflection of the city's organization: its history of urbanization, the layout of its transport infrastructure, and the evolution and distribution of its residential, commercial, and industrial zones. The network of physical contacts is perhaps the most fundamental, as it is where human interactions, such as communication (verbal and non-verbal), exchange of goods and services, and physical conflict exist. Emergence of higher order structures and dynamics, such as collective opinion formation and the transmission of infectious diseases, happens on contact networks [3] .
The problem of reconstructing actual physical interactions between people is non-trivial, although the use of different technological solutions [4] has allowed the reconstruction of such networks in settings such as schools [5] , hospitals [6] , and professional events, such as conferences [7] . Cellphones and other mobile devices are a widely used source of spatial and mobility data. Beyond the commercial applications of such large datasets, these have also been used for social good applications, including modelling the spatial spread of the 2010 cholera outbreak in the Haiti [8] , permanent changes in population distributions following a 2013 cyclone in Bangladesh [9] , and the role of inter-city social ties in the aftermath of hurricane Maria [10] . During the current COVID-19 pandemic, mobile device data has been used to identify factors incidence shaping the spread of the disease in Spain [11] .
In this work, we present reconstructed contact networks based on physical proximity of mobile devices, which is representative of the physical contact network of the inhabitants of Mexico City. We analyse device location data for different days in the month of February 2020, identifying that every day, the contact network has a similar structure: a very sparse network with a largest connected component concentrating between 10 and 20% of all devices measured, and a heavy-tailed degree distribution.
Device location data for the month of February 2020 was provided by Veraset, a company that aggregates anonymized cell phone location data. Each record in a table is composed of a unique, anonymized user id, a timestamp, horizontal accuracy, and a latitude and longitude pair. The set of unique user ids is referred to as the panel. For this work, the dates of February 15, 16, 18, 19, 22, 23, 25, and 26 were used; these were selected in order to have 4 weekend networks and four weekday networks.
Efficiently analyzing large datasets of individual locations can be done by bucketing locations [12] into area partitions. We first sort the dataset by administrative region to select a subset of data, then partition that subset of data over a hexagonal grid.
We chose the H3 geospatial indexing system [https://github.com/uber/h3], aligned to the EPSG 4326 Coordinate Reference System (CRS). H3 tiles Earth with non-overlapping hexagons at 16 different linearly hierarchical resolutions. Given a latitude and longitude point, the API returns an index of the containing H3 cell at a particular resolution. This grid system provides uniform spacing between cells and, because all neighbors in a hexagonal grid are equidistant, facilitates analysis of movement across cells. For this work, we selected an H3 resolution with an average hexagon area of 0.9 m 2 .
For this study, we selected records that appear within a bounding box containing the shapefile of Mexico City published by the Mexican National Institute of Statistics and Geography (INEGI). After exploring the distribution of horizontal accuracy, we filtered out out pings with an horizontal accuracy larger than 100 m to reduce the number of false positive links between devices in the networks.
For visualization purposes, each unique device in the panel is analyzed individually to identify its "average night time location," defined as the location with the highest daily position frequency in the time period between 10:00 PM and 6:00 AM during the last two weeks previous to the date for which the network is reconstructed.
We reconstructed a network for each of the analysed days, where nodes represent devices (as a proxy for people), and links represent physical proximity contacts, in which the devices are simultaneously in the same hexagon of the grid previously described, during the day of analysis.
We construct the network using Algorithm 1.
Result: Contact network foreach day do break day into 144 time windows tw of 600 seconds; foreach tw do Make a bipartite network linking devices to all positions they occupy during tw; Project the network to the device layer; Return Gd tw a network in which devices are linked through their (aggregated) co-localization events; end Merge all Gd tw to obtain Gd day , the contact network for a given day; end Algorithm 1: Algorithm for network construction. Figure 1 shows a schematic representation of the network construction methodology.
We consider that by aggregating these networks at the daily level, we can capture the general connectivity patterns of the city, without risking exposing individual mobility patterns. With this in mind, we would like to state that no individual mobility pattern was explicitly or implicitly traced or needed for the construction of the network.
We reconstructed eight networks for different days of the month of February 2020. We present some basic network descriptors in Table 1 . We also calculated the connected components of each network and reported the number of nodes of the three largest ones, as well as isolated nodes (singletons) in Table 2 . We have found that while these network parameters fluctuate in different days, these do not exhibit significant changes. For instance, we compared each of these parameters between weekend (we) and weekday (wd) networks using a t-test, and none of them exhibited significant differences (p > 0.05). Figure 3 shows the degree distribution of the Mexico City network; for illustration purposes, we present the results for the February 18. A visual inspection shows that the network is heavy-tailed. This was further inspected with an algorithm to evaluate power-law distributions in empirical data [13] , which indicate that although heavy-tailed, this distribution does not perfectly fit a power-law (p = 0.04). Figure 2 : Network visualization. Nodes are placed on their nearest origin neighborhood (aggregated to be visible at this scale). Links represent co-localization events throughout the day; with thickness representing more frequent contacts between nodes placed on said inferred neighborhood. An arbitrary subset of nodes were selected for this visualization, for illustration purposes. Figure 3 : Degree distribution plot. This plot shows the degree distribution P (K)vsK in a log-log scale. The visual pattern is consistent with that of a heavy-tailed distribution, which is not unusual for a heterogeneous social system.
Contact networks for Mexico City exhibit a particular structure in terms of their connected components. Table 2 shows descriptors related to these structures: We will again focus on the network of February 18 for discussion purposes. Analyzing the component distribution of this network, we found that the largest connected component contained 134763 nodes; only 17.20% of the network's total number of nodes. The second largest component, in turn, is made of only 257 nodes. Meanwhile, 23907 components are composed of just two nodes. 
In this work, we show a simple way in which device position data can be leveraged to construct a contact network for a whole city. We present some basic network descriptors, showing a characteristic topology that, although fluctuating, remains relatively stable through the different dates analysed. We believe that, based on its construction, this network adequately captures the heterogeneous nature of physical contacts that occur in Mexico City.
As a first approach, we focused on reconstructing a network that captures the contacts observed throughout a single day. The strategy that we propose can be adapted to analyse narrower time windows. This could be of interest in order to identify changes in connectivity patterns that occur during a given day; for instance, contacts observed during business hours or late night could change. It has been shown that different levels of time aggregation may obscure or reveal different patterns within a network [14] .
Due to the computational cost involved in all steps of this analysis pipeline, it has been unfeasible to process a larger number of dates. However, we believe that it is important to identify whether the stability of the topological structure remains throughout a larger period of time (for instance, a year).
While the overall structure of the network is retained on different days, an open question that remains is whether well-documented changes in mobility patterns lead to what would be in essence, a rewiring of the network. For instance, weekday commuters could interact with a set of people at work, and have the same number of contacts with a different set of people on the weekend. A particular question that we plan to tackle is whether pandemic mobility restrictions have been successful in reducing the number of contacts within the city, or have only led to a somewhat degree-preserving rewiring of the network.
The same strategy used for the reconstruction of this network can be applied to other cities in Mexico and Latin America. Since mobile devices are widely used throughout urban areas, the data is available. It would be interesting to see if the structures observed for Mexico City are preserved in other cities throughout the continent.
Finally, we must acknowledge that the particular motivation of this work is in the context of the current COVID-19 pandemic. While we believe that there are many applications for this network analysis, at the present time we are particularly interested in its use for the development of epidemiological and other public policy decision making models. With this in mind, we are providing this network as an open dataset for any researcher or policymaker interested in its use.
The anonymized network for 2020-02-18 is provided as a graphml file, available at: doi.org/10.17605/OSF.IO/B6G92. This network has been processed to substitute the original anonymous ids with new numeric ids to guarantee that these nodes cannot be reidentified.
We would like to thank Jens Steuck for technical support, as well as the Bioinformatics Group of the University of Leipzig for providing computational infras-tructure during the development of this project.