asyn_fluidc(G, k, max_iter=100, seed=None)¶
Returns communities in
Gas detected by Fluid Communities algorithm.
The asynchronous fluid communities algorithm is described in 1. The algorithm is based on the simple idea of fluids interacting in an environment, expanding and pushing each other. It’s initialization is random, so found communities may vary on different executions.
The algorithm proceeds as follows. First each of the initial k communities is initialized in a random vertex in the graph. Then the algorithm iterates over all vertices in a random order, updating the community of each vertex based on its own community and the communities of its neighbours. This process is performed several times until convergence. At all times, each community has a total density of 1, which is equally distributed among the vertices it contains. If a vertex changes of community, vertex densities of affected communities are adjusted immediately. When a complete iteration over all vertices is done, such that no vertex changes the community it belongs to, the algorithm has converged and returns.
This is the original version of the algorithm described in 1. Unfortunately, it does not support weighted graphs yet.
k (integer) – The number of communities to be found.
max_iter (integer) – The number of maximum iterations allowed. By default 100.
seed (integer, random_state, or None (default)) – Indicator of random number generation state. See Randomness.
communities – Iterable of communities given as sets of nodes.
- Return type
k variable is not an optional argument.