Package org.graph4j.measures
Class TriangleCounter
java.lang.Object
org.graph4j.UndirectedGraphAlgorithm
org.graph4j.measures.TriangleCounter
Counts the number of triangles in an undirected graph. A triangle is formed
by three distinct vertices all connected with each other.
Complexity
O(|E|^{3/2}).
See Ullman, Jeffrey: "Mining of Massive Datasets", Chapter 10.- Author:
- Cristian Frăsinaru, Gabriel Ignat
-
Field Summary
Fields inherited from class org.graph4j.UndirectedGraphAlgorithm
graph -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TriangleCounter
-
-
Method Details
-
count
public long count()- Returns:
- the number of triangles in the graph.
-