Tag Archives: visualization

The city as network

Traditionally, cities have been viewed as the sum of their locations – the buildings, monuments, squares and parks that spring to mind when we think of ‘New York’, ‘London’ or ‘Paris’.

In The new science of cities (Amazon US| Amazon UK), Michael Batty argues that a more productive approach is to think of cities in terms of flows, connections and relationships – in other words, as a network. Places like Times Square or the Champs Elysée are not big, famous or busy because of their inherent qualities, but rather because they sit at the intersections of movements of people, wealth, information, or power.

Aerial view of the City of London

An aerial view of the City of London by photographer Jason Hawkes

Flows are not just the connectors between these important locations. Rather, the locations become important because – at least in part – they’re at the intersections.

Urban flows

When we think of urban flows, the hourly and daily movements of traffic or commuters spring to mind, but flows can also be more abstract (information, wealth, power) or longer term (shifting demographics, infrastructure or land uses).


Nathan Yau’s visualisation of RunKeeper data showing running routes around London. View the full set on FlowingData.

Ernst Georg Ravenstein's currents of migration

Ernst Georg Ravenstein’s currents of migration

These ideas are not new, and metaphors of flow have always abounded in the way we talk and write about the city. For example in the Sherlock Holmes stories Dr Watson, at a loose end after returning from the Afghanistan War, finds himself drawn towards Piccaddilly Circus, that ‘great cesspool into which all the idlers and loungers of the Empire are irresistibly drained’.

There may be more truth in this image than Conan Doyle realised. A famous nineteenth-century map by geographer Ernst Georg Ravenstein showed the ‘currents of migration’ around the British Isles, with people being sucked towards the major cities.

Cities and network analysis

Viewing cities as networks allows us to use the toolbox of network analysis on them, employing concepts such as ‘cores’ and ‘peripheries’, ‘centrality’, and ‘modules’. Batty says that an understanding of how different types of network intersect will be the key that really unlocks our understanding of cities.

Cities, like many other types of network, also seem to be modular, hierarchical, and scale-free – in other words, they show similar patterns at different scales. It’s often said that London is a series of villages, with their own centres and peripheries. but the pattern also repeats when you zoom out and look at the relationships between cities. One can see this in the way that London’s influence really extends across Europe, and in the way that linked series of cities, or ‘megalopolises‘, are growing in places such as the eastern seaboard of the US, Japan’s ‘Taiheiyō Belt‘, or the Pearl River Delta in China.

The new science of cities can be a bit turgid in places, and focusses more on methodology than insight, but it’s a useful primer on a fascinating and fruitful way of thinking about the places where more than half of the world’s population now live.

Mapping the contraception debate on Twitter

This network analysis of Twitter users talking about contraception reveals a heavily US-dominated conversation, with participants clearly divided into Democrat / liberal and Republican / conservative groups, and little interchange between them.

Around 7,500 tweets mentioning ‘contraception’ or ‘birth control’ were collected during a 24-hour period in November last year. The follow relationships were then worked out between all the accounts that had tweeted.

The 'contraception' debate on Twitter

This approach underlines the ability of network analysis to discover online communities and is reminiscent of Lada Adamic’s network map of links between Republican and Democrat blogs in the run-up to the 2004 election. It suggests US politics has grown no less polarised since then, at least around this issue.

Lada Adamic Republican Democrat blogs

Lada Adamic’s famous visual of Democrat and Republican blogs during the 2004 US election

The image below shows the intersection between the Democrat and Republican communities in more detail.

Contraception Twitter network detail

You can download a PDF of the network showing individual account names here (21 MB).

Visualizing scientific collaboration using PubMed

Last year I did some really exciting work to visualize networks of scientific collaboration in medicine and healthcare. The image shows the network of collaboration across research papers on the topic ‘hepatitis C virus’. Each of the 8,500 spots is a single author, and the lines between spots represent co-authorship across scientific papers.

Co-authorship network map of physicians publishing on hepatitis C

To build this network, I scraped Pubmed, a free and exhaustive database of over 20 million scientific papers on the biosciences, for papers on a given topic. I downloaded all the papers returned by Pubmed in XML format, and then processed the file with a custom Python script to work out who had worked with who. Along the way data was gathered on the strength of the relationship, each author’s location, and publication volume for the topic over time. After outputting the data as a .graphml file , it was loaded into Gephi where the network could be analyzed, explored and visualised.

Co-authorship network map of physicians publishing on hepatitis C (detail)

Modelling scientific collaboration in this way gives us access to a range of powerful analytic techniques. For example, the eigenvector centrality or PageRank algorithms allow us to quickly and reliably identify well-connected authors for a given topic (the larger spots). We could also identify sub-networks and cliques, whether of language, institution, specialisation or ideology.

This post originally appeared on my personal blog. The full set of images can be viewed on Flickr.