File tree Expand file tree Collapse file tree 1 file changed +3
-4
lines changed
Expand file tree Collapse file tree 1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -461,7 +461,6 @@ def _community_leiden(
461461 )
462462
463463
464-
465464def _community_fluid_communities (graph , no_of_communities ):
466465 """Community detection based on fluids interacting on the graph.
467466
@@ -475,15 +474,15 @@ def _community_fluid_communities(graph, no_of_communities):
475474 Scalable and Diverse Community Detection Algorithm.
476475
477476 @param no_of_communities: The number of communities to be found. Must be
478- greater than 0 and fewer than number of vertices in the graph.
477+ greater than 0 and fewer than or equal to the number of vertices in the graph.
479478 @return: an appropriate L{VertexClustering} object.
480479 """
481480 # Validate input parameters
482481 if no_of_communities <= 0 :
483482 raise ValueError ("no_of_communities must be greater than 0" )
484483
485- if no_of_communities >= graph .vcount ():
486- raise ValueError ("no_of_communities must be fewer than the number of vertices" )
484+ if no_of_communities > graph .vcount ():
485+ raise ValueError ("no_of_communities must be fewer than or equal to the number of vertices" )
487486
488487 # Check if graph is weighted (not supported)
489488 if graph .is_weighted ():
You can’t perform that action at this time.
0 commit comments