Spotify Connectivity

Six degrees of separation theory says any two people on the Earth are six or fewer links apart. At first glance this may seem bit crazy but this could be true for most of the people on earth. Why should this be true? Let's do some Math. Look at the complete ternary tree below.

ternary tree

Here we are just modelling your acquaintances as a graph, at the top of the tree node represents you, then next layer represents your direct acquaintances, below that is acquaintances of your direct acquaintances ..

As you can see from the above picture number of nodes increases exponentially with the distance from the first node. Suppose we have a tree branching factor b and it's depth is d, there are bd nodes. If we safely assume that on average a person has 60 acquaintances, by the time we reach the 6 level we will cover the 46,656,000,000 people which is nearly 7 times the current population on the globe i.e every two people on this planet are six or fewer links apart.

Knowing this fascinating theory what I tried is, collect the Indian music artists data on Spotify using their Web API and build the artist graph where two artists are linked by the album they worked together. Ran the traversal algorithm on given graph for all possible pairs of artists it turned out that # links < 6.

Click here to find link between indian music artists.