5.2. igraph_community_eb_get_merges — Calculating the merges, ie. the dendrogram for an edge betweenness community structure

int igraph_community_eb_get_merges(const igraph_t *graph, 
				   const igraph_vector_t *edges,
				   igraph_matrix_t *res,
				   igraph_vector_t *bridges);

This function is handy if you have a sequence of edge which are gradually removed from the network and you would like to know how the network falls apart into separate components. The edge sequence may come from the igraph_community_edge_betweenness() function, but this is not neccessary. Note that igraph_community_edge_betweenness can also calculate the dendrogram, via its merges argument.

Arguments: 

graph:

The input graph.

edges:

Vector containing the edges to be removed from the network, all edges are expected to appear exactly once in the vector.

res:

Pointer to an initialized matrix, if not NULL then the dendrogram will be stored here, in the same form as for the igraph_community_walktrap() function: the matrix has two columns and each line is a merge given by the ids of the merged components. The component ids are number from zero and component ids smaller than the number of vertices in the graph belong to individual vertices. The non-trivial components containing at least two vertices are numbered from n, n is the number of vertices in the graph. So if the first line contains a and b that means that components a and b are merged into component n, the second line creates component n+1, etc. The matrix will be resized as needed.

bridges:

Pointer to an initialized vector or NULL. If not null then the index of the edge removals which split the network will be stored here. The vector will be resized as needed.

Returns: 

Error code.

See also: 

igraph_community_edge_betweenness().

Time complexity: O(|E|+|V|log|V|), |V| is the number of vertices, |E| is the number of edges.