The method Facebook uses to suggest Friends

Ever questioned how Facebook’s people you may know algorithm works? It’s so accurate it’s nearly creepy. At its core, the underlying concept is kind of simple, and we can model Facebook’s friend suggestion algorithm as a PageRank problem.

Let’s say we want to seek out potential friends for a user. Let each of their friends act as a hub, and each of the friends’ friends act as an authority (getting rid of duplicates, as well as the user and their friends). Now, we’ve got a listing of people that the user isn’t friends with, however has mutual friends with. We are able to assign a score from every of the user’s friends to the potential friends in a variety of ways in which. We are able to set each potential friend’s score to the sum of the number of mutual friends that each of the user’s friends has with them. From here, we are able to back-propagate and repeat the process as we did in class, and assign the hub score for each of the user’s friends based on how “interleaved” they’re within the web of the potential friends. After iterating a set number of times or reaching equilibrium, we are able to recommend the potential friends with the highest scores to the user. Whereas this is a simplified model of how Facebook suggests friends, it provides a decent framework for understanding how the system works.

Facebook’s scoring algorithm is kind of complex, and definitely doesn’t only depend on mutual friends. In fact, sometimes Facebook recommends friends to you that you don’t have any mutual friends with. Therefore how does this work? Facebook’s scoring algorithm, based on what they have in public acknowledged, involves mutual friends, interests, work and education info, search history, and mobile contacts. Even then, the accuracy of their algorithm may be quite shocking given these factors; however this is only a testament to the power of the PageRank algorithm.

The idea of recommending things based on some kind of PageRank algorithm isn’t unique to Facebook. Almost any recommendation system will involve some elements of PageRank, as well as Facebook’s News Feed sorting algorithm, YouTube’s recommended videos section, Amazon’s suggested items section, and Twitter’s tweet sorting algorithm. Each of these systems are more advanced than a simple PageRank algorithm, however they use some of the core ideas of PageRank to lay their foundation. Ultimately, in a world where targeting info to users is very lucrative, PageRank is crucial to serve as a basis to jump off of.

About the Author