find_partition_with_rep_rcpp {leidenAlg} | R Documentation |
Finds the optimal partition using the Leiden algorithm
Description
Finds the optimal partition using the Leiden algorithm
Usage
find_partition_with_rep_rcpp(
edgelist,
edgelist_length,
num_vertices,
direction,
edge_weights,
resolution = 1,
niter = 2L,
nrep = 1L
)
Arguments
edgelist |
The graph edge list |
edgelist_length |
integer The length of the graph edge list |
num_vertices |
integer The number of vertices in the graph |
direction |
boolean Whether the graph is directed or undirected |
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, 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) |
nrep |
Number of replicate starts with random number being updated. (default=10) The result with the best quality will be returned. |
Details
For notes of the graph object, refer to https://igraph.org/c/doc/igraph-Basic.html
Examples
library(igraph)
edgelist <- as.vector(t(igraph::as_edgelist(exampleGraph, names=FALSE))) - 1
edgelist_len <- length(edgelist) ## The length of the graph edge list
n_vertices <- length(igraph::V(exampleGraph)) - 1 ## The number of vertices in the graph
direct <- igraph::is_weighted(exampleGraph) ## Whether the graph is directed or undirected
edge_weights <- E(exampleGraph)$weight
find_partition_with_rep_rcpp(edgelist, edgelist_len, n_vertices, direct, edge_weights, nrep = 10)