Entangling Mobility and Interactions in Social Media

Daily interactions naturally define social circles. Individuals tend to be friends with the people they spend time with and they choose to spend time with their friends, inextricably entangling physical location and social relationships. As a result, it is possible to predict not only someone’s location from their friends’ locations but also friendship from spatial and temporal co-occurrence. While several models have been developed to separately describe mobility and the evolution of social networks, there is a lack of studies coupling social interactions and mobility. In this work, we introduce a model that bridges this gap by explicitly considering the feedback of mobility on the formation of social ties. Data coming from three online social networks (Twitter, Gowalla and Brightkite) is used for validation. Our model reproduces various topological and physical properties of the networks not captured by models uncoupling mobility and social interactions such as: i) the total size of the connected components, ii) the distance distribution between connected users, iii) the dependence of the reciprocity on the distance, iv) the variation of the social overlap and the clustering with the distance. Besides numerical simulations, a mean-field approach is also used to study analytically the main statistical features of the networks generated by a simplified version of our model. The robustness of the results to changes in the model parameters is explored, finding that a balance between friend visits and long-range random connections is essential to reproduce the geographical features of the empirical networks.


I. INTRODUCTION
The advent of the big data revolution has opened the door to the analysis of massive datasets on all aspects of society. New technologies have made possible the access to unprecedented amount of information on human behavior generated unobtrusively whenever people interact with or through modern technologies such as cell phones, online services, mobile applications, etc. This fact is facilitating the pursuit of a computational approach to the study of problems traditionally associated with social sciences [1]. Over the course of the last few years, it has allowed for the development of greater insights, for instance, into human mobility [2][3][4], structure of online social networks [5,6], cognitive limitations [7,8], information diffusion and social contagion [9][10][11][12][13], the importance of social groups [13][14][15] or even how political movements raise and develop [16][17][18].
The relation between physical location and social interactions can be also explored with the new available data. In general, people tend to interact and maintain relations with geographically close peers. A tendency that gets reflected in a decay of the social interaction probability with the physical distance. This effect has been observed, for example, in phone call records [19][20][21] and in online friendships [22]. Furthermore, it has been shown that online [23] social links can be inferred from user cooccurrences in space and time and, likewise, that the location of a person can be predicted from the geographic positions of his or her online friends [25]. Some further as- * Electronic address: pms@ifisc.uib-csic.es pects of the relation between geography and online social contacts have been studied such as the probability that a link at a given distance closes a triangle [19,22,26], the connections between users in different countries [27], the social interactions and mobility in emergency situations [28] or the overlap between users' ego networks and how it decays with the distance [29]. Multi-parametric inference methods have been applied to empirical data with the aim of predicting link presence and users' locations [30][31][32]. These works show that the accuracy of link prediction is considerably improved by taking into account the geographical information, and that the accuracy of location prediction is enhanced when the online social links are provided.
The availability of geo-localized information has also allowed for a detailed exploration of human mobility [2,3,21,[33][34][35][36]. The length of displacements between locations was found to follow a broad distribution, well fitted by a power-law decaying function [2,3]. The asymmetry of the travels was studied by considering ellipsoidal boundaries to the average individual displacements and analyzing the scaling of the radius of gyration. Memory effects in the individual displacements was also analyzed, finding that individuals' home and workplace have a considerable impact on their mobility patterns [4]. These results motivated the introduction of several mobility models with the aim of explaining the features observed in the data [4,[36][37][38][39]. Despite the supporting evidence [21], most of these models lack a connection between mobility and social interactions [40].
In this work, we lay a bridge between these two worlds by introducing a model coupling social tie formation and spatial mobility. Preceding models considering network structure and geography are uncoupled [24,41]. Our model simulates the movement of individuals and creates links between them when they are physically close mimicking the effect of face-to-face interactions. We study the model both numerically and analytically and confront its results with empirical data obtained from three online social networks. We show that the model generates more realistic networks than uncoupled models.

II. THE DATASETS
We have collected data from online social networks containing both social links and information about the users' physical positions. The first dataset was obtained from Twitter by means of its API [42]. We identify over 714, 000 single users, who tweeted using a GPS enabled mobile device during the month of August 2011 [43]. If those users reported various locations in different tweets, the most recent one is taken for the purpose of the study. The other two datasets contain information referring to the users' location check-ins and the social networks of Gowalla and Brightkite [31]. Both were location-based online social networks, in which users can check-in at their current locations and receive information about services in the area as well as about their friends' positions. Gowalla and Brightkite are no longer active but their data is available online [44]. The main statistical features of our three datasets are displayed in Table I. Social interactions across country borders have particular properties and are affected by political, linguistic or cultural factors. We overcome this difficulty by restricting our analysis to the networks within each country. Intra-country mobility and social contacts account for the large majority of a user activity [45,46]. For simplicity, we focus on the three major countries with more than one thousand users in each of our datasets: the United States (US), the United Kingdom (UK) and Germany (DE). We have analyzed and modeled other countries and found similar results to the ones presented in this manuscript.

III. THE TRAVEL AND FRIEND (TF) MODEL
The model structure is illustrated in Figure 1. The initial condition is a set of individuals located in the last known positions of the online network users as extracted from the data. At each step of the model, a randomly chosen agent performs actions in two stages: 1. Travel (a) Visit a randomly selected friend at his current location with probability p v .
(b) Otherwise, travel to a new location. The distance of travel is obtained from a distribution of jump lengths, while the direction is chosen proportionally to the population density at the target distance.

Friendship
(a) With probability p, create directed links to agents within a neighborhood of size δ × δ.
(b) With probability p c , create a directed connection to a randomly chosen agent anywhere in the system.
The acronym of the TF model comes from the initials of these two stages. The model is iterated until the number of created connections is equal to the number of links measured in the empirical networks. Despite its simplicity, the model incorporates several major features of human behavior. The Travel stage accounts for both recurring visits to the same location and exploration of new places and the Friendship component generates both Various statistical network properties are plotted for the data obtained from Twitter (red squares), Gowalla (blue diamonds), Brightkite (green triangles) and the null models (dashed lines), for the US (for the UK and Germany, see Supplementary Figures 1 and 2). The spatial model (magenta), based on geography, matches well the data in P l (d), but yields near-zero values for R(d), J f (d) and C(d). The linking model (cyan), based on triadic closure, produces enough clustering, but it does not reproduce the distance dependencies of P l (d), R(d), J f (d) and C(d).
face-to-face contacts and online acquaintances independent of the geography. 1 The effect of each of the underlying assumptions is systematically explored through analysis of model variants in Appendix B.
The model has four input parameters: p v , p, p c and δ, besides the distribution of jump lengths. Following the empirical findings of Ref. [4], we take a power-law distribution for the jump lengths with an exponent −1.55 for the main simulations shown in this work. Still, other functional shapes for the jump distribution are also discussed in Section V C. The direction of the jump is chosen proportionally to the population density at the target distance using the gridded population estimates of the world for 2005 with the cell size 2.5 [47]. The values of the probability p = 0.1 and the box size δ = 0.001 • are fixed to match the relation between the probability of friendship and the number of daily spatiotemporal coincidences measured in [23]. 2 Furthermore, we tested different values of δ and p and did not observe strong deviations in the model results. This leaves us only with p v and p c as free model parameters, we will systematically explore in the coming sections the impact of these parameters on the model results, since, as it will be shown, they are essential for generating network comparable with the empirical ones.

IV. GEO-SOCIAL PROPERTIES OF THE NETWORKS
We start by establishing a set of metrics in order to characterize networks structure and its relation to geography. First, we measure the probability of two users to have a link at a certain distance P l (d). It is defined as the ratio between the number of existing links at distance d and the total number of users pairs separated by d, and thus it is constrained to the interval [0, 1]. P l (d) decays slowly with the distance for empirical networks, essentially as a power-law with exponent −0.7, which is followed by a plateau for very large distances (see Figure 2A). This functional shape remains identical for all the countries and all the datasets considered. It matches, besides, the behavior reported in the literature for online social systems [22,26].
A second metric that we consider is the degree distribution of the social networks (see Figure 2B for the empirical networks). For Twitter, which has a directed social network, we consider the degrees of its symmetrized version. The distribution P (k) displays heavy tail in all the datasets, even though there are slight differences between them.
Connections in Twitter are directed: one user follows the messages emitted by another. Reciprocated connections indicate mutual interest between the two users and a closer type of social relation [8,14]. To assess how geography and reciprocity correlate, we measure the probability R (d) of reciprocation conditional on a link at a distance d ( Figure 2C). We find that the reciprocity decreases with the distance in all the countries analyzed. This trend is consistent with the idea that stronger relations occur close to where users spend most of their time, with some longer connections composed of friends who moved, former residences, online acquaintances, etc. Furthermore, long not-reciprocated connections may include users following public figures or celebrities.
With the aim of quantifying social closeness between users, we define the social overlap J f of two connected users i and j as where K i represents the set of friends of user i. J f is inspired by the Jaccard index but is modified to ensure that it takes a value of 1 if i and j share all their friends, and 0 if they have no common friends. In Figure 2D, the average of the social overlap J f (d) over all pairs of connected users is plotted as a function of the distance between them. The social overlap decreases with the distance. The functional shape of the curves is similar for all the datasets, even though the overlap level is different for each of them. For Twitter, we use the symmetrized version of the network to study social overlap and clustering.
Another well known phenomenon in social networks is triadic closure. As one individual has a close relation with other two persons, there are high chances that these two individuals end up creating a social relation between themselves. In network analysis, a magnitude that quantifies this effect is the average clustering coefficient C. It is defined as the ratio between the number of closed triads and the total number of triads in the network. A triad is a sequence of 3 nodes i, j, k such that the central node j is connected to both extreme nodes i and k. A closed triad is a triad that has also an edge between i and k, forming a triangle. Note that a triangle consists of 3 triads centered on different nodes. The effect of the distance on the clustering coefficient can be incorporated by measuring the distances from each central node j to two neighbors i and k forming a triad, d = d ij + d jk , and calculating the network clustering restricted to triads with distance d. This new function C(d) is the probability of closing a triangle given the distance d in a triad where Λ(d) and ∆(d) are the numbers of triads and closed triads for the distance d, respectively. The value of the global clustering coefficient C can be recovered by averaging C(d) over d. In the datasets, we observe a drop in C(d) followed by a plateau, which is best visible for the US networks ( Figure 2E). Given a triangle, several configurations are possible if there is diversity in the edge lengths. The triangle can be equilateral if all the edges have the same length, isosceles if two have the same length and the other is smaller, etc. We estimate the dominant shapes of the triangles in the network by measuring the disparity D defined as: where d 1 , d 2 and d 3 are the geographical distances between the locations of the users forming the triangle. The disparity takes values between 0 and 1 as the shape of the triangle passes from equilateral to isosceles, where one edge is much smaller than the other two. D shows a distribution with two maxima in the online social networks ( Figure 2F), for low and high values. The two most common geometries of the triangles are: i) all 3 users are at a similar distance, ii) 2 users are close to each other, while the third one is distant. Since most edges correspond to small distances, this means that most triangles are constituted by three users that are all close to each other geographically. However, the stretched isosceles configuration is also relatively common. Summarizing, we have defined the following metrics in order to characterize the networks structure and its relation to geographical distance: • P (k): Degree distribution ( Figure 2B).
• R(d): The probability of reciprocation conditional on a link at a distance ( Figure 2C).
• J f (d): Average overlap as a function of the distance ( Figure 2D).
• C(d): Clustering coefficient as a function of the triad distance ( Figure 2E).
We will use these metrics in the coming sections to estimate the ability of model to produce social networks comparable with those obtained from the empirical datasets.
V. RESULTS

A. Model calibration
Next, we will find a compromise between the different metrics and search for the parameter values for which a given model best fits simultaneously the various statistical properties. To do so, we define an overall error Err to quantify the difference between the networks generated with the model and the empirical ones. The parameters of the model are then explored to find the values that minimize Err. We measure the error Err [X] for each property X and take the average over all the properties where N c is the total number of nodes in connected components of the network and C avg is the undirected local clustering coefficient averaged over the N c connected nodes. The local clustering coefficient of a node i is defined as the ratio between number of closed triads centered on node i and the total number of triads centered on that node. The properties X integrating Err can be scalars, functions or distributions and encompass different orders of magnitude. We define the error of a property X as where y X i is the i-th observed value of the property X, f X i is the corresponding i-th value of the property obtained by the model. In the case of a distribution, i runs over the n measured bins, while for a scalar (such as the number of nodes or the clustering coefficient) the sum has only one term. We perform a Latin square sampling of the parameter space of p v and p c as shown in Figure 3 in order to find the minimum value of Err. The parameter space is covered uniformly in a linear scale for p v and in a logarithmic one for p c . For all the countries, the minimum value of the error is obtained for p v in the interval (0.05, 0.3) and p c in the range (5 · 10 −3 , 5 · 10 −2 ). The values of Err found at the minimum are 0.30 for the US, 0.18 for the UK and 0.39 for Germany. For simplicity, we focus on the Twitter networks only, although similar results are obtained for the other datasets.

B. Simulations for the optimal parameters
An example with the displacements between the consecutive locations and the ego networks for a sample of individuals, as generated by the TF model, are displayed in Figure 4. The parameters of the model are set to the ones that correspond to the minimum of the error Err. As shown, the agents tend to stay close to their original positions. Occasional long jumps occur due to friend visits that live far apart. In this range of parameters and simulation times, the main mechanism for generating long distance connections is random linking (controlled by p c ). Agents typically return back to their original positions because this is where most of their contacts live. The frequency of the long distance jumps and connections varies for the three countries due to the different spatial distribution of the user populations. In the ego networks, the presence of multiple triangles with long distance edges can be observed.  The geo-social properties of the networks generated by the TF model are shown in Figure 5 for the US and in Supplementary Figures 3 and 4 for the UK and Germany, respectively. Additionally, we show how each of the introduced properties contributes to the total error of the model in Table II. The model is able to reproduce the trends in the probability P l (d), the reciprocity R (d), the social overlap J f (d) and the disparity distribution P (D) with good accuracy. The difficulties encountered with the degree distribution P (k) and the clustering as a function of the distance C (d) are not unexpected since the model does not incorporate mechanisms to explicitly enhance the heterogeneity in the agents' contacts nor favor any specific dependence of the clustering on the distance. 3

C. Insights of the TF model
In this section we explore two null models uncoupling mobility and social interactions to help us interpret the mechanisms acting in the TF model. The first null model, the spatial model (S model), is based solely on the geography and consists of randomly connecting pair of users with a probability depending on the distance, but does not take network structure into account. The second null model, the linking model (L model), in contrast, is based only on random linking and triadic closure, and it is equivalent to the TF model without the mobility. We consider the two uncoupled null models and compare their results with those of the TF model. In this way, we demonstrate the importance of the coupling through a realistic mobility mechanism to reproduce the empirical networks.
The spatial model (S model) consists of randomly connecting pair of users with a probability that decays as power-law of the distance between them (suggested in [41]). The exponent of the power-law is fixed at −0.7 3 We have tested variants of the TF model in which connections are created using the preferential attachment rule. The overall fitting error for these variants of the model is not lower than for the basic TF model, as we show in Appendix I.
following Figure 2A. The results of the S model are shown in the panels of Figure 2. While it is set to match P l (d), other properties such as P (k), R (d), J f (d), C (d) or P (D) are not well reproduced. The S model fails to account for the high level of clustering and reciprocity in the empirical networks and for their dependence on the distance. The error Err of this null model is between 0.66-0.76 for the three countries, around twice the error of the TF model (see Figure 6). The linking model (L model) is a simplified version of the TF model, without random mobility and the box size δ → 0. Agents move to visit their contacts with probability p v , whereas with probability 1 − p v they do not perform any action. In this version of the model, users can connect only by random connections or when two of them coincide, visiting a common friend, which leads to triadic closure. These two processes do not depend on the distances between the users. A thorough description can be obtained with a mean-field approach (see Section V E). The results of the L model are shown in Figure 2. Due to the triangle closing mechanism, this null model creates networks with a considerable level of clustering. However, it does not reproduce the distance dependencies of P l (d), R(d), J f (d) and C(d). The error Err of the L model is also around twice higher than the error of the TF model (see Figure 6).
The geography and the structure are coupled in the TF model through the random mobility. Changes in the underlying mobility mechanism affect the quality of the results. The lowest Err values are obtained with the power-law distribution in the jump lengths, while normal or uniformly distributed jumps yield worse results (e.g., for the US the TF model has Err lower by 0.5 and 1.5 than the TF-normal and the TF-uniform models, respectively, as shown in Figure 6).
Simplified models that neglect either geography or network structure perform considerably worse than the TF model in reproducing the properties of real networks. Likewise, non-realistic assumptions on human mobility mechanism yield worse results than the default TF model. To conclude, the coupling of geography and structure through a realistic mobility mechanism produces networks with significantly more realistic geographic and structural properties.

D. Sensitivity of the TF model to the parameters and its modifications
The results presented so far have been obtained at the optimal values of p v and p c . The question remains, however, of how robust these results are to changes in the values of the parameters. In Figure 7, we report the effect of varying p v while p c is maintained constant in its optimal value. The linking probability P l (d) loses its power-law shape for very low values of p v , marking the limit in which random mobility is the main mechanism for the agents' traveling in detriment of friend visits. In this case, most of the links are created due to encounters occurring in nearby locations or are random connections, and so the distribution of triangles disparity P (D) loses its bimodal shape. Furthermore, the friend visits provide opportunities to reciprocate the connections. This is why for extremely low values of p v , the reciprocity R (d) is close to zero. Towards the other limit, i.e., p v → 1 the social overlap J f (d) and the triangle-closing probability C (d) steadily increase. In this limit, the linking probability P l (d), the reciprocity R (d) and the distribution of triangles disparity P (D) recuperate their shapes of the optimum. Figure 8 explores the impact of varying p c while p v is fixed to its optimal value. The effect of p c on J f (d) and C(d) is the opposite to that of p v : these metrics decrease at all distances with increasing p c . The reason for this is that visits to friends are the main forces behind the creation of new triads and the subsequent closure of triangles. Note that the more connections are created randomly (higher p c ), the less links will be a result of friend visits. We will expose and describe in detail the interplay between these two mechanisms in the meanfield calculations.
A possible variation of the TF model consists of eliminating friend visits or random connections (i.e., setting p v or p c to 0). This prevents the model from producing networks with characteristics comparable to the real ones in all the cases, leading to increase in Err of around 0.5. Interestingly, the model results are quite robust to variations in the update rules, the random connection mechanism, the connecting rules in each agent neighborhood and the variants in the way users visit friends. These variations lead to changes in Err smaller than 0.1. A detailed discussion of the results with different model variants is included in Appendix B.

E. Mean-field approach
In this section, we consider the L model, introduced in Section V C, to gain some analytical insights on the mechanisms ruling the final network structure. Although this model is a simplified version of the TF model, the results of the simulations yield a relatively low value of Err (Figures 6, and Supplementary Figures 9 and 10 of Appendix B). We write the equations for the time evolution of the properties of the network and solve them numerically. Among all the properties, we focus on the average clustering coefficient C, the overall reciprocity R and the degree distribution P (k).
The clustering coefficient is defined as a ratio of all the closed triads to all triads existing in the network, i.e., C = ∆/Λ. The number of triads Λ can be calculated knowing the degree distribution. The number of closed triads ∆ in the L model grows with time mostly due to the friend visits mechanism. A triangle is formed every time two friends of the same hosting agent meet in the host's place and decide to connect. Note that an undirected triangle corresponds to 3 undirected closed triads. Assuming that the contribution of random links is negligible, the evolution of the number of closed triads is described by where k = k in + k out /2, meaning that we do not distinguish between in-degree and out-degree; N (k > 0) represents the number of nodes with the degree higher than 0, i.e., the number of potential hosts, M is an estimate of the lower bound for the number of triangles closed by one closing link M = 1 + C 2 2 1+R k − 2 . Finally, S is the expected number of encounters per host, which can be calculated as where N (k) is the number of nodes with a given degree k in the network. Finally, note that the above definition of degree and the one obtained from symmetrizing directed networks (used in previous sections) are related by a proportionality factor k = k sym (1 + R)/2. The reciprocity of connections R can be expressed as R = L p /(L p + 2L s ), where L p is the number of reciprocated links, L s is the number of non-reciprocated links and the total number of links L = L s + L p . The numbers of links evolve as where p rec = p p v (1 − p v ) (1 − R) corresponds to the probability that an agent visiting a neighbor gets her connection reciprocated (their connection is initially single FIG. 7: Impact of pv on the TF model. We change the value of pv while keeping pc fixed to the optimal value. Note that this corresponds to an exploration of the parameter space along the vertical line crossing the minimum of Err as plotted in Figure 3 for the US. Corresponding results for the UK and Germany can be found in Supplementary Figures 5 and 6. FIG. 8: Impact of pc on the TF model. We change the value of pc while keeping pv fixed to its optimal value. Note that this corresponds to an exploration of the parameter space along the horizontal line crossing the minimum of Err as plotted in Figure 3 for the US. Corresponding results for the UK and Germany can be found in Supplementary Figures 7 and 8. directional). As can be seen, ∆, L p and L s are mutually dependent.
To calculate the degree distribution P (k), we estimate the probability p con of a node to increase its degree by one unit in the current time step due to multiple encounters with friends of her friends FIG. 9: Mean-field approximation. Predictions of the analysis versus results of the simulation of the L model for the clustering coefficient C, the reciprocity R and the degree distribution P (k). In this case, we are taking the users from the UK and Germany because their lower numbers facilitate the numerical integration of the Equations 6,8,9,11 and 12. where p c = p p v / k (1 − (1 + R) /2C). In the L model, however, every node can increase its degree by multiple links in each time step. For simplicity, we neglect higher order terms induced by the possibility of creating multiple links. Moreover, we note that Equation (10) is a good estimate if there is not a strong correlation between node degrees. The number of nodes of certain degree k is given by where p inc = p c + p rec /2 + p v p con is an estimate of the probability that the node degree increases, N s (0) is the number of nodes with 0 out-degree and non-zero indegree. Such nodes are important because their connection can be easily reciprocated as a result of a friend visit. However, these nodes are not counted directly into N (1), and so a correction is needed to account for them explicitly, as in Equation (11). The number of such nodes can be calculated as The numerical solution of this set of equations describ-ing the evolution of the L model is shown in Figure 9. The equations accurately predict the dynamics of the clustering coefficient C, the reciprocity R and the degree distribution P (k) for certain values of the parameters (i.e., for medium and high values of p c , as in the lower plots of Figure 9). The approximation yields slightly worse results when the number of random connections is small in comparison with the number of connections created due to friend visits (i.e., for low values of p c , as in the upper plots of Figure 9B). In the latter case, neither the degree distribution is well approximated, probably due to the degree-degree correlations introduced through the friend visit mechanism.
The mean-field analysis of the L model shows that the friend visiting mechanism is a direct cause of triangle closure and link reciprocity. Equation 6, which estimates the growth of the number of triangles in the network, accounts only for the friend visiting mechanism; yet it approximates closely the value of the clustering coefficient, also when p c , which controls the mechanism of random connections, is high. Similarly, Equation 8, which estimates the growth of the number of reciprocated connections, accounts for the friend visiting mechanism and approximates well the value of reciprocity.

VI. DISCUSSION
We introduce a model that couples human mobility and link creation in social networks. The aim is to characterize the relation between network topology and geography observed in empirical online networks. The model has two free parameters p c and p v but, despite its simplicity, it is able to reproduce a good number of geo-social features observed in real data at a country level. Comparing the TF model with simplified null models, we find that the coupling of geography and structure through a realistic mobility mechanism produces significantly more realistic social networks than the uncoupled models.
Social links in our model are formed mostly with relational (due to triadic closure), and proximity (through spatio-temporal coincidences) mechanisms [48]. Visiting friends helps to reinforce the existing relations and favors the closure of triads with particular properties regarding the distance balance of their edges. Random link creation accounts for online acquaintances or for historical face-to-face encounters as individuals move their residence from one city to another. Finally, individual random mobility allows the agents to explore new locations. 4 Our results show that by establishing an appropriate balance between friend visits and random link creation, the model can reproduce the main features of online social networks, e.g., we show that 10% − 30% of the mobility has to be directed towards existing friends. We demonstrate that these are the fundamental mechanisms at play in the model.
The TF model is generic and functional for different datasets. Human mobility driven by social ties has impact on the modeling of disease spreading, and may improve its predictions. This model can also be used in simulations of processes that involve social networks and geography, e.g., simulations of opinion formation, language evolution, or responses of a population to extreme events. Moreover, it can also be helpful to design network benchmarks with realistic geo-social properties to test, for instance, the scalability of technical solutions in social online networks related to geography of its physical infrastructure.

A. Ethics Statement
The data analyzed are publicly available as they come from public online social sites or data repositories (Twitter, Gowalla and Brightkite). Since our analysis relies on statistical features and not on single cases, any pri- 4 We expect that in our model the number of unique locations visited over time grow linearly in time, due to the fact that with constant probability (1 − pv) an agent jumps to a new location, as opposed to slower growth reported in [4]. We leave the exploration of temporal aspects of our model for the future research.
vate information about users had been removed and the analysis was performed on anonymized datasets.

VII. ACKNOWLEDGMENTS
We would like to warmly thank Luis F. Lafuerza for helpful discussions on the analytical treatment of the model.      7: Impact of pc on the TF model. We change the value of pc while keeping pv fixed to its optimal value. Note that this corresponds to an exploration of the parameter space along the horizontal line crossing the minimum of Err as plotted in Figure 3 for the UK.  8: Impact of pc on the TF model. We change the value of pc while keeping pv fixed to its optimal value. Note that this corresponds to an exploration of the parameter space along the horizontal line crossing the minimum of Err as plotted in Figure 3 for Germany. In this Appendix, we consider several variants of the TF model and the L model and evaluate their results. We describe a total of 36 variants marked with different colors in the tables in Supplementary Figures 9  and 10. For each variant we explore the space of the parameters p v and p c . We run the models for p v from the set {0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7} and p c from {0, 0.0003, 0.001, 0.003, 0.01, 0.03}, yielding in total 48 parameter combinations. For each of the model variants, we find the parameters that minimize the fitting error Err. We plot its value in Supplementary Figures 9  and 10. In the following paragraphs, we describe in detail each of the variants and its results.
First, we modify the jump size distribution to understand its impact on the geo-social properties. We consider the following cases: the default power-law jumps with exponent 1.55, a minimal jump length of 1 km and a cutoff at 100 km, as in [4] (the TF model), uniformly distributed random jumps up to 100 km (TF-uniform), normally distributed jumps with standard deviation of 1 km (TF-normal), and no jumps to new locations at all (the L model). We plot the minimal fitting error of these cases in Supplementary Figures 9 and 10 using different colors of the curves. The default power-law jumps show the best results with the lowest error for most of the variants. The normal distribution and the L model tend to perform considerably worse. The highly unrealistic uniform jumps understandingly provide the worst results and the highest error values for almost all variants.
To assess the role of friend visits and random connections we turn on and off these two components by setting to zero the corresponding parameters p v and p c . We plot the results in Supplementary Figures 9 and 10 with dashed and dotted lines. We observe significantly higher error values whenever one of these two components is turned off, for most of the model's variants, what demonstrates their importance for the TF model.
To prevent users from spreading into inhabited regions, we include in the TF model an angular preference for the jumps. Namely, the direction of each jump is chosen randomly with a probability proportional to the number of inhabitants present at the destination. Note that this does not affect in any way the length of the jumps, which is drawn independently beforehand. To estimate the population of the target area, we use the gridded population of the world [47]. To test how this angular preference impacts the results, we consider a variation of the models without it and compare the results. The two variants are included in the lowest row of the table in Supplementary  Figures 9 and 10. They show almost no difference in the error values for the Germany, although a systematic difference exists for the UK; the error of the variant with direction preference is consistently lower in the case of that country. The presence of the sea around the UK introduces a distorting factor for the TF model. Without the directional preference the agents freely spread over the sea independently on the geographical shape of the country, leading to unrealistic results.
Agents' traveling and link creation can be realized in the simulation in various update orders. By default, at each time step, each agent first moves, next connects to other random agents, and then connects locally; the following agent performs the same actions in the same order, etc. We call this method sequential ("seq"). In an alternative update rule, which we call simultaneous ("sim"), first all the agents move, then all of them create random connections, and finally all of them create connections locally. The two update rules are included in the second row, counting from the bottom, of the table in Supplementary Figures 9 and 10. The update rules have little impact on the final networks resulting from the simulation.
In the TF and L models, the agents create with probability p c random connections. These links can be created in different ways; we consider three variants. First, each agent chooses another agent uniformly at random, what constitutes the default mechanism ("rnd"). Second, each agent randomly picks another node with probability proportional to the current degree of the node, which corresponds to the preferential attachment mechanism ("pa"). Third, the agent draws another node with probability decaying as a power-law of the distance between the two agents ("dist"), with its exponent equal to 1.4 and the minimal distance of 0.1 km. The type of random connecting mechanism used is listed in the third row, counting from the bottom, of the table in Supplementary Figures 9 and 10. In some cases, e.g., for Germany, the distant-dependent probability of creating a random link provides better results than the other variants.
We consider similar variants for the connections formed inside spatial boxes, which are created with the probability p. The agents can connect uniformly at random ("rnd"), with a preference for high-degree nodes ("pa"), or a preference toward the nodes with high intrinsic fitness ("fitn"). The fitness of the nodes is drawn from a power-law distribution with an exponent of 1.5, which roughly corresponds to the distribution of the growth rates reported in [49]. These variants are implemented in the following way. First, we note that the number of connections created by the agent is a result of a binomial process with probability p and the number of trials is equal to the number of agents that currently stay in the given spatial box. The expected number of links created in such binomial process is known, therefore, an equivalent number of connections can be created with one of the two mentioned preferential processes. The type of connecting mechanism applied in the spatial boxes is listed in the top row of the table in Supplementary Figures 9  and 10. There is no consistent difference in the error values between these variants. Thus, the connecting mechanism applied in the spatial boxes has little impact on the results.
We conclude that the main components of the TF models are crucial to reproduce the structure and geography 10 -1 10 0  of the social networks. These components include the mobility model, friend visits and random connections. The power-law mobility model tends to produce the best results. The angular preference of travels is important for countries whose geography is strongly restrained, e.g., by sea. Other modifications to the model have low or no consistent impact on the results, with the exception of the distance dependent random connections, which in certain cases consistently influence the results.