You are on page 1of 3

# COMP 208: Computers in Engineering Winter, 2013 Assignment 3: Friends and More Friends

Due Date
Assignment 3 is due on Friday, February 22 at midnight. The cutoff is automated and is exactly at this time. Assignments submitted within the next hour will be considered late. After that time they will not be accepted at all. The assignment is to be done individually. You can collaborate on understanding the problem but you must write the solutions independently. Submissions might be subject to being checked by plagiarism detection software.

Introduction
On a social network site (Facebook, LinkedIn, etc..) pairs of people can be friends. If Alice is friends with Bob and Carol and David is also friends with Bob and Carol, then Alice and David have two mutual friends. If Alice and David are not friends, the site might suggest to each of them that they might want to become friends (since they have at least two mutual friends). The purpose of this assignment is to examine the set of friends in a social network and discover pairs of people who are not friends but have mutual friends.

Assignment
Your program should read a file containing a description of a social network. It should then output a list of suggested new friends for each pair of members of the network who have the most mutual friends.

Analysis
Suppose the social network has n members. The set of friends can be represented by an n by n two dimensional matrix. The entry F(i,j) equals 0 if member i and member j are not friends and equals 1 if they are friends. We also require that the diagonal elements (F(i, i)) be equal to 0 since a person cannot be friends with him or herself in the network. We note that the matrix is symmetric since if members i and j are friends, then F(i,j) = F(j,i) = 1.