public class TriangleCount
extends Object
The algorithm is relatively straightforward and can be computed in three steps:
There are two implementations. The default TriangleCount.run
implementation first removes
self cycles and canonicalizes the graph to ensure that the following conditions hold:
TriangleCount.runPreCanonicalized
should be used instead.
val canonicalGraph = graph.mapEdges(e => 1).removeSelfEdges().canonicalizeEdges()
val counts = TriangleCount.runPreCanonicalized(canonicalGraph).vertices
Constructor and Description |
---|
TriangleCount() |
Modifier and Type | Method and Description |
---|---|
static <VD,ED> Graph<Object,ED> |
run(Graph<VD,ED> graph,
scala.reflect.ClassTag<VD> evidence$1,
scala.reflect.ClassTag<ED> evidence$2) |
static <VD,ED> Graph<Object,ED> |
runPreCanonicalized(Graph<VD,ED> graph,
scala.reflect.ClassTag<VD> evidence$3,
scala.reflect.ClassTag<ED> evidence$4) |