find_partition | R Documentation |
Finds the optimal partition using the Leiden algorithm
find_partition(graph, edge_weights, resolution = 1, niter = 2)
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. For an unweighted graph, this is set to 1. Refer to igraph, weighted graphs. |
resolution |
Numeric scalar, resolution 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) |
A vector of membership values
library(igraph)
library(leidenAlg)
g <- make_star(10)
E(g)$weight <- seq(ecount(g))
find_partition(g, E(g)$weight)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.