Function graph_transitivity

Source
pub fn graph_transitivity<G>(graph: G) -> f64
Expand description

Compute the transitivity of an undirected graph.

The transitivity of a graph is 3*number of triangles / number of connected triples, where “connected triple” means a single vertex with edges running to an unordered pair of others.

This function is multithreaded and will launch a thread pool with threads equal to the number of CPUs by default. You can tune the number of threads with the RAYON_NUM_THREADS environment variable. For example, setting RAYON_NUM_THREADS=4 would limit the thread pool to 4 threads.

The function implicitly assumes that there are no parallel edges or self loops. It may produce incorrect/unexpected results if the input graph has self loops or parallel edges.