Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
So there are lots of cases where I have a Facebook friend whom I have friends with because we are members of a larger circle of friends, e.g. we are coworkers, or we went to camp together. In those cases, we will often have a horde of mutual friends (e.g., our fellow coworkers or campmates) so numerous that it is difficult to browse through.

But sometimes there are unexpected mutual friends! And those are interesting cases to discover. If you were to build an unexpected mutual friends feature, how would you go about doing it?
Posted
Comments
Dominic Burford 11-Nov-14 9:54am    
The way that Facebook does this is using a semantic web vocabulary called FOAF (Friend-of-a-Friend). FOAF is the vocabulary used by social networks such as Facebook when finding friends you have in common with other friends. It does this using the attribute "knows". The full FOAF spec can be found here http://xmlns.com/foaf/0.1/

1 solution

Hi Javed;

I think you'd need a way to describe the relationship or describe common memberships. A knows B wouldn't be enough.

One possible definition for "unexpected mutual friend":

1. you belong to a club or organization and
2. none of your friends belong and
3. one or more mutual friends belong to this club or org.

You asked for data and algorithms.

Principal data types would be a friend and a set of friends.

The main operation to be performed is set intersection.

Examples:

Each person or organization has a set of friends "F".
For person A and entity E, mutual friends are FoA (friend of "A") intersect FoE (friends of E).
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900