> I am finding it challenging to count the number of triangles between two > nodes say u and v for all u,v in N using R
If you mean the number of triangles that contain both u and v, for every u and v in the network, then you can use the cocitation function (igraph_cocitation in C, cocitation() in R, Graph.cocitation() in Python. This is because the number of triangles that involve both u and v is equal to the number of common neighbors of u and v, which is exactly what cocitation() calculates for an undirected graph. Note that cocitation() gives you a full matrix, i.e. you’ll get an n x n matrix for n vertices, so you cannot use it directly if your graph is large. In this case, you’ll have to iterate over the (u,v) pairs of interest on your own, fetch the neighbors, and then calculate the intersection. T. _______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
