Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

find_partition

Finds the optimal partition using the Leiden algorithm


Description

Finds the optimal partition using the Leiden algorithm

Usage

find_partition(graph, edge_weights, resolution = 1, niter = 2L)

Arguments

graph

The igraph graph to define the partition on

edge_weights

Vector of edge weights. In weighted graphs, a real number is assigned to each (directed or undirected) edge. Refer to igraph, weighted graphs.

resolution

Integer resoluiton parameter controlling communities detected (default=1.0) Higher resolutions lead to more communities, while lower resolutions lead to fewer communities.

niter

Number of iterations that the algorithm should be run for (default=2)

Value

A vector of membership values

Examples

library(igraph)
library(leidenAlg)

g <- make_star(10)
E(g)$weight <- seq(ecount(g))
find_partition(g, E(g)$weight)

leidenAlg

Implements the Leiden Algorithm via an R Interface

v0.1.1
GPL-3
Authors
Peter Kharchenko [aut], Viktor Petukhov [aut], V.A. Traag [ctb], Gábor Csárdi [ctb], Tamás Nepusz [ctb], Minh Van Nguyen [ctb], Evan Biederstedt [cre, aut]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.