public class MatrixBasedNumberOfTrianglesAlgorithm extends GrphAlgorithm<java.lang.Integer>
Constructor and Description |
---|
MatrixBasedNumberOfTrianglesAlgorithm() |
Modifier and Type | Method and Description |
---|---|
java.lang.Integer |
compute(Grph g)
Computes the number of triangles in g (Note: the number of triangles in a
graph equals the trace of A^3 / 6, where A is the adjacency matrix of the
graph).
|
cacheResultForGraph, getSourceCode
public MatrixBasedNumberOfTrianglesAlgorithm()
public java.lang.Integer compute(Grph g)
compute
in class GrphAlgorithm<java.lang.Integer>