networkx compute modularity