def test_example(filename, size, matrix = False): print("Warning: Networkx version should be 2.3, current version:") print(nx.__version__) if matrix == False: net = nread.read_undirected(filename, size, True) else: net = nread.read_undirected_matrix(filename, include_networkx = True) print("Min-Max degrees:", npr.min_max(net)) ## print("Degree distribution:", network_distribution(net)) ## print("Network diameter:", lengths_ecc_diameter(net)[2]) print("Clique number:", npr.clique_number(net)) print("Average Clustering Coefficient:", npr.average_clustering(net)) print("Graph Density:", npr.graph_density(net)) print(npr.gamma(net))
def test_example_print(filename, size, matrix=False): os.makedirs("output") if matrix == False: net = nread.read_undirected(filename, size, True) else: net = nread.read_undirected_matrix(filename, include_networkx=True) print("Min-Max degrees:", min_max(net)) ## print("Degree distribution:", network_distribution(net)) ## print("Network diameter:", lengths_ecc_diameter(net)[2]) print("Clique number:", clique_number(net, "output/graph_clique_number.txt")) print("Average Clustering Coefficient:", average_clustering(net, "output/graph_acc.txt")) print("Graph Density:", graph_density(net, "output/graph_density.txt")) print(gamma(net, "output/graph_gamma.txt"))
def get_properties_files(filename_base, files_count_from, files_count_to, size, properties, matrix=False): try: os.makedirs("output") except: pass for i in range(int(files_count_from), int(files_count_to + 1)): if matrix == False: net = nread.read_undirected(filename_base + str(i) + ".csv", size, True) else: net = nread.read_undirected_matrix(filename_base + str(i) + ".csv", include_networkx=True) for prop in properties: get_property(prop, net)