Skip to main content

triangle_count

Function triangle_count 

Source
pub fn triangle_count(graph: &Graph) -> u64
Expand description

Counts the total number of triangles in the graph.

A triangle is a set of three nodes {a, b, c} where all three edges exist: a-b, b-c, a-c.

§Arguments

  • graph - The graph (usually undirected for meaningful triangle counting)

§Returns

Total count of triangles