BF: Fix bug in WeightedPartition, specificying nx.adjacency_matrix(graph).todense()