Sign up ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free.

I'm curious to learn from a technical perspective what techniques can be used to make recommendations for e.g. Facebook's "People You May Know" (what algorithm do they use, etc.)?

One of the things that come to my mind is the number of mutual friends. Other than this, what are the different parameters they use to make suggestions?

share|improve this question

closed as too broad by gnat, MichaelT, GlenH7, Thomas Owens Jan 20 '14 at 18:03

There are either too many possible answers, or good answers would be too long for this format. Please add details to narrow the answer set or to isolate an issue that can be answered in a few paragraphs.If this question can be reworded to fit the rules in the help center, please edit the question.

Any other personal info like: location, schools, interests, mutual sites you like. – JeffO Jan 15 '12 at 15:24
Read up on the Netflix Algorithm that won the Netflix Prize and you'll see that something like this is not as trivial as it sounds. – Marvin Pinto Jan 15 '12 at 15:35
Wizards. That's the only explanation I can find. Despite my giving NO information to Facebook, when one person invited me, it listed people I might know who I did know but there's no way on earth the other person could have known. – pdr Jan 15 '12 at 18:05
@pdr: Your email address may have been in someone else's address book. When you joined, it made the connection. – Daenyth Jan 16 '12 at 3:10
Honestly while there are some sophisticated algorithms out there, I'm not sure that Facebook's is one of them. I use the site, and the people it suggests to me, tend to be just random people with one or more friends in common. But since I'm only speculating, I could be completely wrong ! – Antonio2011a Jan 16 '12 at 3:55

3 Answers 3

up vote 10 down vote accepted

I know this question will bring up a lot of speculation and it may be hard for @brainydexter to choose a correct answer, and maybe there is no one correct answer. Maybe it's a matter of using the statistics that are available to you via the data the app collects. Remember people know each other via their real-life social circles as well as virtual circles.

  • # of mutual friends is an excellent starting point. Give it a weight of .2 for 10% of friends are mutual friends, .5 for 30% of friends are mutual, .9 for 70% of friends
  • current company. Weighted .8 for companies 200 employees and smaller, .5 for 200-2000, .3 for 2000+
  • current residence. Weighted based on size of town a range of say .1 to .5
  • current school weight range of .1 to .5
  • previous residence, previous company, previous school (1/5 the weight of current ones listed above...or could even base it on how long ago did each attend)
  • If you shared an email list with them and there's a user in their system with that same email, then give it a weight of 1

Add all the weights up and sort descending.

Always measure what the user responds with when presented with "Do you know this guy?". Track how many times they clicked no vs yes along with the values in your algorithm. Play with those weights based upon the yes/no response from that individual.

Sometimes the weights might work well for one personality type (popular guy) while another algorithm works better for another (the nerd). With the statistics of how they clicked yes/no and your values in your algorithm, you can learn what personality type they fall into.

share|improve this answer
Thanks for the insight. Definitely gives me a starting point. – brainydexter Jan 17 '12 at 18:07
Be sure to have the tracking metrics in place to monitor the algorithm, otherwise you'll be left guessing. Be sure to use the yes/no feedback from the users to help tweak the algorithm values. :) Happy coding! – DMCS Jan 17 '12 at 19:57
@DMCS thank you! – sonnuforevis Jun 22 '14 at 14:28

People share their email contacts with Facebook. Facebook then uses this information to recommend new friends not just to the one who shared the addresses, but also to people in the list. I.e., Facebook can recommend friends to you even before you have joined their social network.

share|improve this answer
Yes, my friends on facebook gave their email address book from their yahoo mail etc to facebook. Now i get sent spam to join when facebook matches addresses from other people's address books. – james Jan 16 '12 at 1:37

I don't know so much about Facebook, but the number of mutual friends appears as the single most important factor. Other things that may come to mind include: whether you're in the same physical location/network/go to the same school...etc... I think it's about the things that you and another "non-friend" have in common.

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.