except: K=1 #K = int(input("Enter the value of k\n")) check = False try: L = int(input("Enter the value of l\n")) check=True except: L = 1 while not check: try: L = int(input("Enter the value of l\n")) check = True except: L=1 #L = int(input("Enter the value of l\n")) if a == 1: G1,G2,X,Y,E = edge_editing.edge_editing(K,L,l,k,1,path) helpers.centrality_top_20_compare(G1,G2) else: G1,G2,X,Y,E = noise_node_addition.noise_node_addition(K,L,l,k,1,path) helpers.centrality_top_20_compare(G1,G2) helpers.plot_graph2(G1,G2,helpers.get_title(l-1,k-1))
from src import noise_node_addition import networkx as nx import operator import pandas as pd G1 = nx.Graph() G2 = nx.Graph() mp = {} k = int(input("Enter the value of k \n")) l = int(input("Enter the value of l \n")) X = Y = E = 0 title = [] g = [] for i in range(0, 3): for j in range(0, 5): mp[helpers.get_title(i, j)] = [] #print(i+1,j+1) G1, G2, X, Y, E = noise_node_addition.noise_node_addition( k, l, i + 1, j + 1, 1, r'..\..\data\karate.gml') Y = Y / (1024 * 1024) #print(X,Y) g.append(G2) title.append(helpers.get_title(i, j)) mp[helpers.get_title(i, j)].append(G2) mp[helpers.get_title(i, j)].append(X) mp[helpers.get_title(i, j)].append(Y) mp[helpers.get_title(i, j)].append(E) mp[helpers.get_title(i, j)].append(len(G2.nodes) - len(G1.nodes)) mp[helpers.get_title(i, j)].append( helpers.centrality_top_20_compare(G1, G2))
from src import edge_editing import networkx as nx import operator import pandas as pd G1 = nx.Graph() G2 = nx.Graph() mp = {} k = int(input("Enter the value of k \n")) l = int(input("Enter the value of l \n")) X = Y = E = 0 title = [] g = [] for i in range(0,3): for j in range(0,5): mp[helpers.get_title(i,j)] = [] #print(i+1,j+1) G1,G2,X,Y,E = edge_editing.edge_editing(k,l,i+1,j+1,1,r'..\..\data\netscience.gml') Y = Y/(1024*1024) #print(X,Y) g.append(G2) title.append(helpers.get_title(i,j)) mp[helpers.get_title(i,j)].append(G2) mp[helpers.get_title(i,j)].append(X) mp[helpers.get_title(i,j)].append(Y) mp[helpers.get_title(i,j)].append(E) mp[helpers.get_title(i,j)].append(abs(len(G2.edges) - len(G1.edges))) mp[helpers.get_title(i,j)].append(helpers.centrality_top_20_compare(G1,G2)) sorted_time = sorted(mp.items(), key = lambda x: x[1][1]) time = {}