Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

directory as social_network.py). Of course you can also run the program from the command line and again, assuming facebook-links.txt is in the same directory as

image text in transcribed
image text in transcribed
directory as social_network.py). Of course you can also run the program from the command line and again, assuming facebook-links.txt is in the same directory as social_network.py, it should be able to find it. Looking at the assert statements in social_network.py notice that the number of nodes in your facebook graph should be 63731. The facebook-links.txt file in your homework4 directory is courtesy of the Max Planck Institute for Software Systems. Here is a slightly clarified version of the documentation for this file: File facebook-links.txt contains a list of all the user-to-user links from the Facebook New Orleans networks. These links are undirected on Facebook. Format: Each line contains two numeric user identifiers, meaning the second user appeared in the first user's friend list, and the first user appeared in the second user's friend list. Finally, the third column is a UNIX timestamp with the time of link establishment (if it could be determined, otherwise it is \\N'). A Unix timestamp is the number of seconds since January 1, 1970. You may ignore timestamps in this assignment. (Facebook does use the recency of your activity to help it in making recommendations.) A snippet of the file appears below: 35467 17494 1197992662 35467 4190 35467 18822 1209937599 37188 7741 1219156787 37188 8561 1199853037 When reading in this data you should be sure to convert the numeric user identifiers into ints. Storing them as ints will make your life easier and is the output format that we require for printing (Do NOT print a user ID as '19611' instead print as 19611.) This means your code should work whether nodes are named with strings (as we did with the practice graphs) or ints (as we are doing with the facebook data). In NetworkX nodes can be strings or integers. Hint: You may find it useful to refer to the slides "File input-output." Hint: Don't be alarmed if reading the Facebook data takes a little while. The file is large, and it may take up to a minute for your program to read it. However, do not try to draw the Facebook graph. This may cause your computer to hang, and even if it were successful, you would not learn much from a tangled mess of 817,090 edges

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Euclidean Geometry And Transformations

Authors: Clayton W Dodge

1st Edition

0486138429, 9780486138428

More Books

Students also viewed these Mathematics questions