multinet.communities {multinet}R Documentation

Community detection algorithms and evaluation functions

Description

Various algorithms to compute communities in multiplex networks, based on flattening (flat_ec, weighted, and flat_wc, unweighted), frequent itemset mining (abacus), adjacent cliques (clique percolation), modularity optimization (generalized louvain), random walks (infomap) and label propagation (mdlp). glouvain2_ml is a more efficient implementation of the original glouvain_ml, no longer based on matrices: it is equivalent to glouvain_ml with gamma set by default to 1.0 (apart from undeterministic behaviour: individual executions are not guaranteed to return the same result). get_community_list_ml is a commodity function translating the result of these algorithms into a list of vertex identifiers, and is internally used by the plotting function.

There are also algorithms to evaluate the resulting communities: generalized modularity (as optimized by glouvain) and normalized mutual information (nmi_ml) and omega index (omega_index_ml) to compare respectively partitioning and general communities. Please consider that both comparison functions use the number of vertices in the network to make a computation, so the absence of actors from some layers would change their result.

Usage

abacus_ml(n, min.actors=3, min.layers=1)
flat_ec_ml(n)
flat_nw_ml(n)
clique_percolation_ml(n, k=3, m=1)
glouvain_ml(n, gamma=1, omega=1)
infomap_ml(n, overlapping=FALSE, directed=FALSE, self.links=TRUE)
mdlp_ml(n)

modularity_ml(n, comm.struct, gamma=1, omega=1)
nmi_ml(n, com1, com2)
omega_index_ml(n, com1, com2)
get_community_list_ml(comm.struct, n)

Arguments

n

A multilayer network.

min.actors

Minimum number of actors to form a community.

min.layers

Minimum number of times two actors must be in the same single-layer community to be considered in the same multi-layer community.

k

Minimum number of actors in a clique. Must be at least 3.

m

Minimum number of common layers in a clique. Not to be confused with number of edges, as it is meant in the summary function (here we use the notation of the paper introducing this algorithm).

gamma

Resolution parameter for modularity in the generalized louvain method.

omega

Inter-layer weight parameter in the generalized louvain method.

overlapping

Specifies if overlapping clusters can be returned.

directed

Specifies whether the edges should be considered as directed.

self.links

Specifies whether self links should be considered or not.

comm.struct

The result of a community detection method.

com1

The result of a community detection method.

com2

The result of a community detection method.

Value

All community detection algorithms return a data frame where each row contains actor name, layer name and community identifier.

abacus_ml, flat_ec_ml, flat_nw_ml, clique_percolation_ml, and glouvain_ml are only implemented to work with undirected networks. clique_percolation_ml automatically considers the network to be undirected even if the edges are directed. glouvain_ml also considers weights, if *all* layers have a DOUBLE attribute named w_.

The evaluation functions return a number between -1 and 1. For the comparison functions, 1 indicates that the two community structures are equivalent. The maximum possible value of modularity is <= 1 and depends on the network, so modularity results should not be compared across different networks. Also, notice that modularity is only defined for partitioning community structures.

get_community_list_ml transforms the output of a community detection function into a list by grouping all the nodes having the same community identifier and the same layer. Notice that:

References

See Also

multinet.plotting

Examples

net <- ml_florentine()
abacus_ml(net)
flat_ec_ml(net)
flat_nw_ml(net)
clique_percolation_ml(net)
glouvain_ml(net)
infomap_ml(net)
mdlp_ml(net)

# evaluation

c1 <- glouvain_ml(net)
modularity_ml(net, c1)

c2 <- flat_ec_ml(net)
nmi_ml(net, c1, c2)

c3 <- abacus_ml(net)
omega_index_ml(net, c1, c2)

[Package multinet version 4.2 Index]