Skip to content

Commit 63fba4f

Browse files
committed
fix: error in community
1 parent 721b75c commit 63fba4f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/igraph/community.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ def _community_leiden(
461461
)
462462

463463

464-
465464
def _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():

0 commit comments

Comments
 (0)