local_triangle_count#

local_triangle_count(graph, v)#

Implementations of various graph algorithms that can be run on a graph.

To run an algorithm simply import the module and call the function with the graph as the argument

Local triangle count - calculates the number of triangles (a cycle of length 3) a node participates in.

This function returns the number of pairs of neighbours of a given node which are themselves connected.

Parameters:
  • graph (GraphView) – Raphtory graph, this can be directed or undirected but will be treated as undirected

  • v (NodeInput) – node id or name

Returns:

number of triangles associated with node v

Return type:

int