9.2. igraph_transitivity_local_undirected — Calculates the local transitivity (clustering coefficient) of a graph

int igraph_transitivity_local_undirected(const igraph_t *graph,
					 igraph_vector_t *res,
					 const igraph_vs_t vids);

The transitivity measures the probability that two neighbors of a vertex are connected. In case of the local transitivity, this probability is calculated separately for each vertex.

Arguments: 

graph:

The input graph, it can be directed but direction of the edges will be ignored.

res:

Pointer to an initialized vector, the result will be stored here. It will be resized as needed.

vids:

Vertex set, the vertices for which the local transitivity will be calculated.

Returns: 

Error code.

See also: 

igraph_transitivity_undirected(), igraph_transitivity_avglocal_undirected().

Time complexity: O(n*d^2), n is the number of vertices for which the transitivity is calculated, d is the average vertex degree.