[Solved]Usage Usage Sna Inputfile Username Outputfile Requirements Summary Create Program Read Tex Q37091609
Usage Usage: sna inputFile userName outputFile RequirementsSummary Create a program that will read in the text file containinggraph specification of Twitter account followers and write to theoutput a list of all users within a depth of 3 of the specifiedroot user (the user specified from the userName command lineargument), that are not already being followed by that user. Theprogram should be able to create the directed graph from the inputfile and output the results according to the In-Degree ofCentrality. Assignment Name The assignment name for this assignmentis: sna 1. Social Network Analysis and Common Metrics As socialnetworking is becoming more and more popular among people, there isa growing interest in the study of extracting information fromthese networks, the so-called social network analysis (SNA). Theusage of social network analysis, however, is far beyond that ofFacebook or Twitter. The principle of SNA can be applied to otherthings; such as, finding the source and flow of an infectiousdisease, and scheduling the optimal production-market distributionfor a globalized company. The basic structure of SNA is a graph. Toevaluate the characteristics of a graph and the nodes inside,people gradually develop a set of metrics, some of them are: Degreeof Centrality In an undirected graph, the degree centrality of anode i (denoted by CD(i)) is the node degree (number of edges),denoted by deg (i). CD(i) = deg (i) Centrality captures “howconnected” a node is in general. In a directed graph, the degree ofcentrality comes in two types: the in-degree centrality and theout-degree centrality. The in-degree centrality is number of edgesthat end at the node (i.e., the number of edges going to the node).The out-degree centrality is the number edges starting at the node(i.e., the number of edges leaving the node). 2. DatasetDescription: Twitter accounts and their friends The inputFile willconsist of real Twitter accounts with their friends and for eachfriend his/hers friends etc. By using this data build up a graphand calculate the In-Degree of Centrality for each user. The inputfile will have the following format: github john_stewart githubmicrosoft microsoft oracle Each line contains two usernamesseparated by three spaces. Each username is no longer than 15characters and contain only alphanumeric characters (lettersA-Z,a-z, numbers 0-9) with the exception of underscores. The twocolumns define the relationship between two accounts. The user inthe second column is following the user in the first column. Thus,this is a directed graph. For an empty file, a file that does nothave the correct format, or if the specified userName is not found,the program should create an empty output file. You can also assumethat the input graph will be connected. Starting at any node, yourprogram will be able to visit all other nodes using a breadth-firstor depth-first search, or a variant thereof. 3. Task DecompositionDefine User class and read input file Define a User classrepresenting each node in the graph. For this class there are someessential concepts that must be captured: name: store a username followers: other users following this account following: otherusers that this account is following The created User class objectsneed to be stored properly. Decide a way to store this list of allusers from input data sets; class definitions are up to you, butthe fundamental structure will reflect a directed graph with nodesand edges. Calculate the in-Degree centrality Calculate thein-degree centrality for all users. Using the followingrelationship, the program should find all users within a depth of 3from the specified root user who are not already followed by thespecified root user. Write results to output file The programshould create the outputFile consisting of a list of all the userswithin a depth of 3 of the specified root user, that are notalready being followed by that user. The list should be printed indescending order of in-degree of centrality. In case of ties, theusers should be output alphabetically by username(case-insensitive). The outputFile should have the followingformat. inDegreeofCentrality should be output using the defaultprecision. Looking for new accounts for userName(inDegreeofCentrality) to follow userName1 (inDegreeofCentrality)userName2 (inDegreeofCentrality) 4. Alpha Submission For the alphasubmission, submit a complete project that reads in the data,creates the directed graph, and calculates the in-degree ofcentrality for all users. Then print to the output file thefollowing single line with the specified root users in-degreecentrality. inDegreeofCentrality should be output using the defaultprecision. Looking for new accounts for userName(inDegreeofCentrality) to follow
Expert Answer
Answer to Usage Usage: sna inputFile userName outputFile Requirements Summary Create a program that will read in the text file con… . . .
OR

