CPSC120 Assignment 10

Connectedness

Facebook provides a great service for keeping in touch with friends. Facebook doesn’t charge users for the service because it can make money by selling advertisements. The advertisements that Facebook sells are different than the advertisements that many other websites sell because Facebook can target advertisements to specific types of users. The information that Facebook uses to identify types of users includes obvious things such as what a person likes or posts about. Facebook also includes information about how connected a user is. A Facebook user that is connected, has a lot of friends, is a more valuable target for advertisements. A user with a lots of unique connections, lots of friends that cross many different social circles, is even more valuable.

Details

Write a program that measures a person’s connectedness by analyzing their Facebook friend list. The program should prompt the user for a file that contains a mutual friends network graph csv file. Each line of the file contains two quoted names separated with a comma. If two names appear on one line it means that the two people are fiends on Facebook. Note that the order that two friends are listed is not meaningful and that no friendship will be listed twice in the file.

The program should also prompt for the name of the person for whom the csv file was generated. The program should then print the owner’s connectivity score. The owner’s connectivity score can be computed by counting the number of individuals who are friends with the owner, but not friends with any other friend of the owner.

You should test your program on simple files first. You can also test your program on your own mutual friends network graph. To download your mutual friend network graph you can use the Facebook app Give Me My Data. From the application choose “Mutual Friends Network Graph” from the Data drop-down menu, choose “CSV” from the Format drop-down menu, and press the Give me my data button. Depending on how large your friend list is it may take a little while. The text field will be populated with a mutual friends network graph. Select all of the text, copy it, paste it into a file, and save the file with a .csv extension.

Submission: Submit your code as a zip file on the course Inquire site by 5PM on Friday November 30th.

Test Data

The test data for the program should consist of three text files. One text file should contain a mutual friends network graph. The second text file should contain the input to the program, the name of the mutual friends network graph and the name of the owner of the file. Each of the inputs should be on a single line. The third text file should contain the output of the program if the input file is redirected as input to the program.

Submission: Submit your test data as a zip file on the course Inquire site by 9AM on Monday November 26th.

Extra

Draw Friend Graph: Create a graphical program that draws all of the names in a mutual friends network graph evenly spaced around the outside of a circle. Then draw lines connecting any two names that are friends.

A Better Measure: Measuring the connectivity of a Facebook user is a graph problem and Dr. Saoub is a graph theoretician. Talk to Dr. Saoub about a better way to measure connectivity of a Facebook user and implement it.