我尝试在python中使用igraph中的community_optimal_modularity函数。文档
gra = igraph.Graph.Full(10)gra.community_optimal_modularity(weights="weight")
导致"community_optimal_modularity</em
elements of P(k) must to be equal to one return kvalues,Pkdef calculate_community_modularity(graph): communities = greedy_modularity_communities(graph) # algorithm
modularity_dictnx.set_node_attributes(graph, modularity_dict, '