I'm trying to retrieve the amount of triangles from a graph using graphX. As I'm new to both Scala and graphX, I'm currently quite stuck.
I'm creating a graph from an edgefile:
1 2
1 3
2 3
This should be 1 triangle.
Next I'm using the build in function val countTriangles = graph.triangleCount
.
I've however so far been unable to extract the actual trianglecount from this.
triangleCount
counts number of triangles per vertex and returnsGraph[Int,Int]
, so you have to extract vertices: