Facebook Draws its Relationships Visualization Graph
Stats have always been well manipulated with graphs but what about 3-D visualization of them. Yes here an internee at facebook data infrastructure engineering team – Paul Butler did this. He just visualized how facebook connects 500 million users of it throughout the word. The graph shows how people are connected via facebook from one part of the world to the other.

A high resolution version of this can be seen here: Facebook Visualization – 3.8MB
Paul in a blog post explained how he managed to do it.
I began by taking a sample of about ten million pairs of friends from Apache Hive, our data warehouse. I combined that data with each user’s current city and summed the number of friends between each pair of cities. Then I merged the data with the longitude and latitude of each city.
At that point, I began exploring it in R, an open-source statistics environment. As a sanity check, I plotted points at some of the latitude and longitude coordinates. To my relief, what I saw was roughly an outline of the world. Next I erased the dots and plotted lines between the points. After a few minutes of rendering, a big white blob appeared in the center of the map. Some of the outer edges of the blob vaguely resembled the continents, but it was clear that I had too much data to get interesting results just by drawing lines. I thought that making the lines semi-transparent would do the trick, but I quickly realized that my graphing environment couldn’t handle enough shades of color for it to work the way I wanted.
Instead I found a way to simulate the effect I wanted. I defined weights for each pair of cities as a function of the Euclidean distance between them and the number of friends between them. Then I plotted lines between the pairs by weight, so that pairs of cities with the most friendships between them were drawn on top of the others. I used a color ramp from black to blue to white, with each line’s color depending on its weight. I also transformed some of the lines to wrap around the image, rather than spanning more than halfway around the world.
After a few minutes of rendering, the new plot appeared, and I was a bit taken aback by what I saw. The blob had turned into a surprisingly detailed map of the world. Not only were continents visible, certain international borders were apparent as well. What really struck me, though, was knowing that the lines didn’t represent coasts or rivers or political borders, but real human relationships. Each line might represent a friendship made while travelling, a family member abroad, or an old college friend pulled away by the various forces of life.
Later I replaced the lines with great circle arcs, which are the shortest routes between two points on the Earth. Because the Earth is a sphere, these are often not straight lines on the projection.
Related posts
- Reality of ProPakistani - A Complete Story
- Facebook Banned In Bangladesh
- Facebook Finally Opens on PTCL Broadband
- Freedom of Speech
- YouTube Opens, Facebook to be Banned till 31st of May
- Mobilink Challenges your Cricket Knowledge with Jazz Cric-IQ2
- LHC Asks PTA About Action Against Blasphemy
If you like this post then you may also like receiving latest interesting stories Every Morning in your email Click here to Subscribe







