{"id":20048464,"url":"https://github.com/aggstam/networkmanipulation","last_synced_at":"2025-08-22T01:09:33.025Z","repository":{"id":155101773,"uuid":"424352085","full_name":"aggstam/NetworkManipulation","owner":"aggstam","description":"Python script performing social network analysis on the network graph of stackoverflow.","archived":false,"fork":false,"pushed_at":"2023-01-31T17:24:14.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-02T08:24:20.566Z","etag":null,"topics":["graph-neural-networks","python","social-network-analysis","stackoverflow"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aggstam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-03T19:19:15.000Z","updated_at":"2022-11-05T12:47:01.000Z","dependencies_parsed_at":"2023-05-12T10:45:19.395Z","dependency_job_id":null,"html_url":"https://github.com/aggstam/NetworkManipulation","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aggstam/NetworkManipulation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2FNetworkManipulation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2FNetworkManipulation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2FNetworkManipulation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2FNetworkManipulation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aggstam","download_url":"https://codeload.github.com/aggstam/NetworkManipulation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aggstam%2FNetworkManipulation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271569729,"owners_count":24782474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-neural-networks","python","social-network-analysis","stackoverflow"],"created_at":"2024-11-13T11:44:12.798Z","updated_at":"2025-08-22T01:09:32.959Z","avatar_url":"https://github.com/aggstam.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NetworkManipulation\nThis python script performs fundamental social network analysis tasks on the temporal network graph for the StackOverflow-related dataset [1].\n\u003cbr\u003e\nOn each execution, a dedicated folder is created containing all result files.\n\u003cbr\u003e\nScript calculates tmin and tmax timestamps and splits records in N sub-networks.\n\u003cbr\u003e\nFor each sub-network, the following are calculated:\n- Various centralities (e.g. Degree, Closeness, Eigenvector, etc.)\n- Similarity tables (e.g. Graph Distance, Jaccard's Coefficient, etc.)\n- Metrics predictions of consecutive sub-networks\n\n## Dependencies\n- Python 3.8.5(x64)\n- numpy latest\n- networkx latest\n- pandas latest\n- matplotlib latest\n- scipy latest\n\n## Usage\nBefore executing any script, install required dependencies:\n```\n% pip install --user -r requirements.txt\n```\nA test network file(sub-set) has been provided to play with!\n\u003cbr\u003e\nExecute the script:\n```\n% python NetworkManipulation.py\n```\n\n## Execution example\n```\n❯ python NetworkManipulation.py\nWelcome to Network Analysis application.\nPlease provide the network file path: test-network.txt\nPlease provide N (int) for splitting the network to time periods: 5\nPlease provide the following metric weights in 0.xx format (e.g 50% -\u003e 0.50):\nPgd -\u003e 0.50\nPcn -\u003e 0.50\nPjc -\u003e 0.50\nPa -\u003e 0.50\nPpa -\u003e 0.50\n\nExecution starting...\n\nReading network file test-network.txt...\nNetwork loaded.\n\nCreating outputs folder...\nOutputs folder 2023_01_22_15_44_53 created.\n\nCreating Network Graph figure file...\nNetwork Graph figure file Network_Graph.png created.\n\nNetwork information:\n\tNodes: 434\n\tEdges: 448\n\tEarliest Network node: User 4550 connected with user 4550 on 2008-09-06 22:26:30.\n\tLatest Network node: User 3171 connected with user 6180 on 2008-09-16 18:27:45.\n\nCreating 5 sub-networks...\n\tPeriod 0: [2008-09-06 22:26:30, 2008-09-08 21:38:45)\n\tPeriod 1: [2008-09-08 21:38:45, 2008-09-10 20:51:00)\n\tPeriod 2: [2008-09-10 20:51:00, 2008-09-12 20:03:15)\n\tPeriod 3: [2008-09-12 20:03:15, 2008-09-14 19:15:30)\n\tPeriod 4: [2008-09-14 19:15:30, 2008-09-16 18:27:45]\nSub-networks created.\n\nCreating Sub-Networks files...\n\tGraph figure file Period_0_Sub_Network_Graph.png created.\n\tAdjacency matrix file Period_0_Sub_Network_Adjacency_Matrix.csv created.\n\tGraph figure file Period_1_Sub_Network_Graph.png created.\n\tAdjacency matrix file Period_1_Sub_Network_Adjacency_Matrix.csv created.\n\tGraph figure file Period_2_Sub_Network_Graph.png created.\n\tAdjacency matrix file Period_2_Sub_Network_Adjacency_Matrix.csv created.\n\tGraph figure file Period_3_Sub_Network_Graph.png created.\n\tAdjacency matrix file Period_3_Sub_Network_Adjacency_Matrix.csv created.\n\tGraph figure file Period_4_Sub_Network_Graph.png created.\n\tAdjacency matrix file Period_4_Sub_Network_Adjacency_Matrix.csv created.\nSub-Networks files created.\n\nCreating Sub-Networks Centrality Distribution files...\n\tDegree Centrality Distribution file Period_0_Sub_Network_Degree_Centrality_Distribution.png created.\n\tInDegree Centrality Distribution file Period_0_Sub_Network_InDegree_Centrality_Distribution.png created.\n\tOutDegree Centrality Distribution file Period_0_Sub_Network_OutDegree_Centrality_Distribution.png created.\n\tCloseness Centrality Distribution file Period_0_Sub_Network_Closeness_Centrality_Distribution.png created.\n\tBetweenness Centrality Distribution file Period_0_Sub_Network_Betweenness_Centrality_Distribution.png created.\n\tEigenvector Centrality Distribution file Period_0_Sub_Network_Eigenvector_Centrality_Distribution.png created.\n\tKatz Centrality Distribution file Period_0_Sub_Network_Katz_Centrality_Distribution.png created.\n\tDegree Centrality Distribution file Period_1_Sub_Network_Degree_Centrality_Distribution.png created.\n\tInDegree Centrality Distribution file Period_1_Sub_Network_InDegree_Centrality_Distribution.png created.\n\tOutDegree Centrality Distribution file Period_1_Sub_Network_OutDegree_Centrality_Distribution.png created.\n\tCloseness Centrality Distribution file Period_1_Sub_Network_Closeness_Centrality_Distribution.png created.\n\tBetweenness Centrality Distribution file Period_1_Sub_Network_Betweenness_Centrality_Distribution.png created.\n\tEigenvector Centrality Distribution file Period_1_Sub_Network_Eigenvector_Centrality_Distribution.png created.\n\tKatz Centrality Distribution file Period_1_Sub_Network_Katz_Centrality_Distribution.png created.\n\tDegree Centrality Distribution file Period_2_Sub_Network_Degree_Centrality_Distribution.png created.\n\tInDegree Centrality Distribution file Period_2_Sub_Network_InDegree_Centrality_Distribution.png created.\n\tOutDegree Centrality Distribution file Period_2_Sub_Network_OutDegree_Centrality_Distribution.png created.\n\tCloseness Centrality Distribution file Period_2_Sub_Network_Closeness_Centrality_Distribution.png created.\n\tBetweenness Centrality Distribution file Period_2_Sub_Network_Betweenness_Centrality_Distribution.png created.\n\tEigenvector Centrality Distribution file Period_2_Sub_Network_Eigenvector_Centrality_Distribution.png created.\n\tKatz Centrality Distribution file Period_2_Sub_Network_Katz_Centrality_Distribution.png created.\n\tDegree Centrality Distribution file Period_3_Sub_Network_Degree_Centrality_Distribution.png created.\n\tInDegree Centrality Distribution file Period_3_Sub_Network_InDegree_Centrality_Distribution.png created.\n\tOutDegree Centrality Distribution file Period_3_Sub_Network_OutDegree_Centrality_Distribution.png created.\n\tCloseness Centrality Distribution file Period_3_Sub_Network_Closeness_Centrality_Distribution.png created.\n\tBetweenness Centrality Distribution file Period_3_Sub_Network_Betweenness_Centrality_Distribution.png created.\n\tEigenvector Centrality Distribution file Period_3_Sub_Network_Eigenvector_Centrality_Distribution.png created.\n\tKatz Centrality Distribution file Period_3_Sub_Network_Katz_Centrality_Distribution.png created.\n\tDegree Centrality Distribution file Period_4_Sub_Network_Degree_Centrality_Distribution.png created.\n\tInDegree Centrality Distribution file Period_4_Sub_Network_InDegree_Centrality_Distribution.png created.\n\tOutDegree Centrality Distribution file Period_4_Sub_Network_OutDegree_Centrality_Distribution.png created.\n\tCloseness Centrality Distribution file Period_4_Sub_Network_Closeness_Centrality_Distribution.png created.\n\tBetweenness Centrality Distribution file Period_4_Sub_Network_Betweenness_Centrality_Distribution.png created.\n\tEigenvector Centrality Distribution file Period_4_Sub_Network_Eigenvector_Centrality_Distribution.png created.\n\tKatz Centrality Distribution file Period_4_Sub_Network_Katz_Centrality_Distribution.png created.\nSub-Networks Centrality Distribution files created.\n\nCreating consecutive sub-networks files...\n\tFile V[t0,t2].txt created.\n\tFile E[t0,t1].txt created.\n\tFile E[t1,t2].txt created.\n\tFile V[t1,t3].txt created.\n\tFile E[t1,t2].txt created.\n\tFile E[t2,t3].txt created.\n\tFile V[t2,t4].txt created.\n\tFile E[t2,t3].txt created.\n\tFile E[t3,t4].txt created.\n\tFile V[t3,t5].txt created.\n\tFile E[t3,t4].txt created.\n\tFile E[t4,t5].txt created.\nConsecutive sub-networks files created.\n\nCreating consecutive sub-networks similarity tables files...\n\tFile Consecutive_Sub_Networks_0_and_1_Graph_Distances.csv created.\n\tFile Consecutive_Sub_Networks_0_and_1_Common_Neighbors.csv created.\n\tFile Consecutive_Sub_Networks_0_and_1_Jaccards_Coefficient.csv created.\n\tFile Consecutive_Sub_Networks_0_and_1_Adamic_Adar.csv created.\n\tFile Consecutive_Sub_Networks_0_and_1_Preferential_Attachment.csv created.\n\tFile Consecutive_Sub_Networks_1_and_2_Graph_Distances.csv created.\n\tFile Consecutive_Sub_Networks_1_and_2_Common_Neighbors.csv created.\n\tFile Consecutive_Sub_Networks_1_and_2_Jaccards_Coefficient.csv created.\n\tFile Consecutive_Sub_Networks_1_and_2_Adamic_Adar.csv created.\n\tFile Consecutive_Sub_Networks_1_and_2_Preferential_Attachment.csv created.\n\tFile Consecutive_Sub_Networks_2_and_3_Graph_Distances.csv created.\n\tFile Consecutive_Sub_Networks_2_and_3_Common_Neighbors.csv created.\n\tFile Consecutive_Sub_Networks_2_and_3_Jaccards_Coefficient.csv created.\n\tFile Consecutive_Sub_Networks_2_and_3_Adamic_Adar.csv created.\n\tFile Consecutive_Sub_Networks_2_and_3_Preferential_Attachment.csv created.\n\tFile Consecutive_Sub_Networks_3_and_4_Graph_Distances.csv created.\n\tFile Consecutive_Sub_Networks_3_and_4_Common_Neighbors.csv created.\n\tFile Consecutive_Sub_Networks_3_and_4_Jaccards_Coefficient.csv created.\n\tFile Consecutive_Sub_Networks_3_and_4_Adamic_Adar.csv created.\n\tFile Consecutive_Sub_Networks_3_and_4_Preferential_Attachment.csv created.\nConsecutive sub-networks similarity tables files created.\n\nCreating consecutive sub-networks similarity metrics predictions files...\n\tPrediction metrics weights: Pgd = 0.50, Pcn = 0.50, Pjc = 0.50, Pa = 0.50, Ppa = 0.50\n\tFile Consecutive_Sub_Networks_0_and_1_Graph_Distances_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_0_and_1_Common_Neighbors_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_0_and_1_Jaccards_Coefficient_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_0_and_1_Adamic_Adar_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_0_and_1_Preferential_Attachment_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_1_and_2_Graph_Distances_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_1_and_2_Common_Neighbors_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_1_and_2_Jaccards_Coefficient_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_1_and_2_Adamic_Adar_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_1_and_2_Preferential_Attachment_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_2_and_3_Graph_Distances_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_2_and_3_Common_Neighbors_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_2_and_3_Jaccards_Coefficient_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_2_and_3_Adamic_Adar_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_2_and_3_Preferential_Attachment_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_3_and_4_Graph_Distances_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_3_and_4_Common_Neighbors_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_3_and_4_Jaccards_Coefficient_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_3_and_4_Adamic_Adar_Predictions.txt created.\n\tFile Consecutive_Sub_Networks_3_and_4_Preferential_Attachment_Predictions.txt created.\nConsecutive sub-networks similarity metrics predictions files created.\n\nExecution finished!\n```\n\n## References\n[1] https://snap.stanford.edu/data/sx-stackoverflow.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faggstam%2Fnetworkmanipulation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faggstam%2Fnetworkmanipulation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faggstam%2Fnetworkmanipulation/lists"}