Increasing evidence supports the fact that cities are complex systems, with a broad spectrum of structural and dynamical features which lead to unexpected and emerging phenomena. Understanding urban dynamics at individual level -- but also as the outcome of collective human behaviour -- will open the doors to uncountable applications ranging from enhancing the sustainability and the resilience of the city to improving health and well-being of its inhabitants.
Here, we use a unique data set of longitudinal human flows provided by Foursquare, a leader platform for location intelligence, to characterize the functional organization of a city. First, we build multidimensional network models of human flows corresponding to different types of activities across time. We quantify the efficiency of flow exchange between areas of a city in terms of integration and segregation, respectively. Results reveal unexpected complex spatio-temporal patterns that allow us to gain new insight on the function of 10 megacities worldwide. We discover that large cities tend to be more segregated and less integrated, and that human flows at different hours of the day or between different types of activities enable the identification of different "cities within the city" which indeed show clear dissimilarities in terms of both functional integration and segregation. Our analysis provides new insights on how human behaviour influences, and is influenced by, the urban environment and, as an interesting byproduct, to characterize functional (dis)similarities of different metropolitan areas, countries, and cultures.