Closed 18438602970 closed 3 years ago
When you do not provide a resolution parameter when using a CPMVertexPartition
, it will use the default of 1. For unweighted graphs, the optimal partition will be the singleton partition in that case. Hence, please provide a resolution parameter, e.g. as la.find_partition(self.g, la.CPMVertexPartition, resolution_parameter=0.1)
. For unweighted graphs, the resolution parameters of interest are somewhere between 0 and 1. Please see the documentation for more details.
Regarding the rest of your code, please note that clusters
itself already provides the results as a list of vertices. Just do list(clusters)
to retrieve it, or use for c in clusters:
to iterate through them. See the documentation of igraph
for more details.
When I call
CPMVertexPartition
, the community returned is 0,1,2,3,4,5... Number of nodes. But all other methods can output partition results normally. Is the function invalid, or am I using it incorrectly? My calling code is as follows: