| igraph Reference Manual |
|---|
int igraph_community_walktrap(const igraph_t *graph, const igraph_vector_t *weights, int steps, igraph_matrix_t *merges, igraph_vector_t *modularity);
finding algorithm, see Pascal Pons, Matthieu Latapy: Computing communities in large networks using random walks, http://arxiv.org/abs/physics/0512106
Currently the original C++ implementation is used in igraph, see http://www.liafa.jussieu.fr/~pons/index.php?item=prog&item2=walktrap&lang=en I'm grateful to Matthieu Latapy and Pascal Pons for providing this source code.
Note that the graph must not contain isolated vertices in order to use this method.
Arguments:
|
The input graph. |
|
Numeric vector giving the weights of the edges. If it is a NULL pointer then all edges will have equal weights. |
|
Integer constant, the length of the random walks. |
|
Pointer to a matrix, the merges performed by the
algorithm will be stored here (if not NULL). Each merge is a
row in a two-column matrix and contains the ids of the merged
clusters. Clusters are numbered from zero and cluster number
smaller than the number of nodes in the network belong to the
individual vertices as singleton clusters. In each step a new
cluster is created from two other clusters and its id will be
one larger than the largest cluster id so far. This means that
before the first merge we have |
|
Pointer to a vector. If not NULL then the modularity score of the current clustering is stored here after each merge operation. |
Returns:
Error code. |
See also:
Time complexity: O(|E||V|^2) in the worst case, O(|V|^2 log|V|) typically, |V| is the number of vertices, |E| is the number of edges.
| << 4. Walktrap: community structure based on random walks | 5. Edge betweenness based community detection >> |