leading.eigenvector.community(graph, steps = -1,
options = igraph.arpack.default)
leading.eigenvector.community.naive(graph, steps = -1,
options = igraph.arpack.default)
leading.eigenvector.community.step (graph, fromhere = NULL,
membership = rep(0, vcount(graph)), community = 0,
options=igraph.arpack.default)
community.le.to.membership(merges, steps, membership)
For community.le.to.membership
the number of merges to
produce from the supplied membership
TRUE
then it simply considers both communities as separate
graphs and then creates modularity matrices for both commleading.eigenvector.community.step
. This will serve as a
starting point to take another step. This argument is ignored if it
is NULL
.leading.eigenvector.community
.leading.eigenvector.community
and
leading.eigenvector.community.naive
return a named list with
the following members:
membership
member. This is a two-column matrix and each
line describes a merge of two communities, the first line is the
first merge and it creates community N
N
is the number of initial communities in the graph, the second line
creates community N+1
, etc.arpack
for details.community.le.to.membership
B
, which is B=A-P
, A
being the adjacency matrix of
the (undirected)
network, and P
contains the probability that certain edges are
present according to the P[i,j]
element of P
is the probability that
there is an edge between vertices i
and j
in a random
network in which the degrees of all vertices are the same as in the
input graph.
The leading eigenvector method works by calculating the eigenvector
of the modularity matrix for the largest positive eigenvalue and
then separating vertices into two community based on the sign of
the corresponding element in the eigenvector. If all elements in
the eigenvector are of the same sign that means that the network
has no underlying comuunity structure.
Check Newman's paper to understand why this is a good method for
detecting community structure. leading.eigenvector.community
is the proper implementation of
the proposed algorithm. leading.eigenvector.community.naive
is
considered worse, in this implementation a community found after a
division is considered as a separate graph for further divisions.
leading.eigenvector.community.step
is the proper
implementation, but makes only one step, by trying to split the
specified community.
From igraph 0.5 these functions use ARPACK to calculate the
eigenvectors. See arpack
for details.
community.le.to.memberhip
creates a membership vector from the
result of leading.eigenvector.community
or
leading.eigenvector.community.naive
. It takes membership
and permformes steps
merges, according to the supplied
merges
matrix.
modularity
, walktrap.community
,
edge.betweenness.community
,
fastgreedy.community
,
as.dendrogram
g <- graph.full(5) %du% graph.full(5) %du% graph.full(5)
g <- add.edges(g, c(0,5, 0,10, 5, 10))
leading.eigenvector.community(g)
lec <- leading.eigenvector.community.step(g)
lec$membership
# Try one more split
leading.eigenvector.community.step(g, fromhere=lec, community=0)
leading.eigenvector.community.step(g, fromhere=lec, community=1)
Run the code above in your browser using DataLab