com.raphtory.algorithms.generic.motif.SquareCount

SquareCount

SquareCount()

Count undirected squares that a vertex is part of

This is similar to counting triangles and especially useful for bipartite graphs. This implementation is based on the algorithm from Towards Distributed Square Counting in Large Graphs

States

adjPlus: Array[Long]

List of neighbours that have a larger degree than the current vertex or the same degree and a larger ID as computed by the AdjPlus algorithm.

squareCount: Long

Number of squares the vertex is part of

Returns

vertex name

square count

name: String

squareCount: Long