transitivity {igraph}R Documentation

Transitivity of a graph

Description

Transitivity measures the probability that the adjacent vertices of a vertex are connected. This is sometimes also called the clustering coefficient.

Usage

transitivity(graph, type=c("undirected", "global", "globalundirected",
       "localundirected", "local", "average", "localaverage",
       "localaverageundirected"), vids=NULL)

Arguments

graph

The graph to analyze.

type

The type of the transitivity to calculate. Possible values:

  • globalThe global transitivity of an undirected graph (directed graphs are considered as undirected ones as well). This is simply the ratio of the triangles and the connected triples in the graph. For directed graph the direction of the edges is ignored.

  • localThe local transitivity of an undirected graph, this is calculated for each vertex given in the vids argument. The local transitivity of a vertex is the ratio of the triangles connected to the vertex and the triples centered on the vertex. For directed graph the direction of the edges is ignored.

  • undirectedThis is the same as global.

  • globalundirectedThis is the same as global.

  • localundirectedThis is the same as local.

vids

The vertex ids for the local transitivity will be calculated. This will be ignored for global transitivity types. The default value is NULL, in this case all vertices are considered. It is slightly faster to supply NULL here than V(graph).

Value

For ‘global’ a single number, or NaN if there are no connected triples in the graph.

For ‘local’ a vector of transitivity scores, one for each vertex in ‘vids’.

Author(s)

Gabor Csardi csardi@rmki.kfki.hu

References

Wasserman, S., and Faust, K. (1994). Social Network Analysis: Methods and Applications. Cambridge: Cambridge University Press.

Examples

g <- graph.ring(10)
transitivity(g)
g2 <- erdos.renyi.game(1000, 10/1000)
transitivity(g2)   # this is about 10/1000

[Package igraph version 0.5.5-4 Index]