cluster_eigen: This function implements a vector partition algorithm with...

Description Usage Arguments Value Examples

View source: R/cluster_eigen.R

Description

This function implements a vector partition algorithm with global initialization that maximizes the modilarity measure and provide membership for community assignment. The idea is that the uncontrained solution of community assignment is the eigenvectors of the modualrity matrix. We project graph distance matrix to the eigenvectos in order to get a constrained solution and furture tune current assignment with one-iteration of k-means clustering or set it as an initialization of a full iteration of k-means clustering.

Usage

1
cluster_eigen(g, kopt = 2, tune = c("fast", "fine"), verbose = FALSE)

Arguments

g

The input unweigheted and undirected graph.

kopt

The specified number of clusters.

tune

Methods selected to tune community assignment by one-iteration of k-means clustering with "fast" tune or full iteration of k-means clustering with "fine" tune. Defaut is "fine" tune.

verbose

output message

Value

Returns a list with entries:

k:

The number of communities detected in current community assignment.

modularity:

The calculated modularity for current community assignment showed by "label" in cluster list.

cluster:

A list of membership, normalized membership and label for current and updated community assignment after tunning.

k_up:

The number of communities detected in updated community assignment.

modularity_up:

The calculated modularity for updated community assignment showed by "label_up" in cluster list.

Examples

1
2
3
4
5
library(igraph)
g <- make_full_graph(5) %du% make_full_graph(5) %du% make_full_graph(5)
g <- add_edges(g, c(1,6, 1,11, 6, 11))
res <- cluster_eigen(g)
plot(g, vertex.color = res$cluster[[1]]$label_up)

WenlanzZ/eigencluster documentation built on Jan. 19, 2021, 8:23 p.m.