community_fluid: Fluid Communities Detection

View source: R/communities.R

community_fluidR Documentation

Fluid Communities Detection

Description

Simulates fluid dynamics where communities compete for nodes. Requires specifying the number of communities.

Usage

community_fluid(x, no.of.communities, ...)

com_fl(x, no.of.communities, ...)

Arguments

x

Network input

no.of.communities

Number of communities to detect. Required.

...

Additional arguments passed to to_igraph

Value

A cograph_communities object

A cograph_communities object. See detect_communities.

References

Pares, F., Gasulla, D.G., Vilalta, A., Moreno, J., Ayguade, E., Labarta, J., Cortes, U., & Suzumura, T. (2018). Fluid communities: A competitive, scalable and diverse community detection algorithm. Studies in Computational Intelligence, 689, 229-240.

Examples

if (requireNamespace("igraph", quietly = TRUE)) {
  g <- igraph::make_graph("Zachary")

  # Detect exactly 2 communities
  comm <- community_fluid(g, no.of.communities = 2)
}

m <- matrix(runif(25), 5, 5); diag(m) <- 0
net <- as_cograph(m)
com_fl(net, no.of.communities = 2)


cograph documentation built on April 1, 2026, 1:07 a.m.