Is there a primitive function for counting triangles in graph-tool? 

Currently i am explicitly creating a triangle graph and then using the motif 
function to search for this graph. - 

triangle = Graph()
v1 = triangle.add_vertex()
v2 = triangle.add_vertex()
v3 = triangle.add_vertex()
e = triangle.add_edge(v1, v2)
e = triangle.add_edge(v1, v3)
e = triangle.add_edge(v3, v2)
triangle.set_directed(False)

motifsgraph, num_triangles = motifs(tempG, 3, motif_list=[triangle])

Just wondering if there is a better way to do this as it is 1) slow and 2) 
turning up some strange results.

Many Thanks,

Rob
_______________________________________________
graph-tool mailing list
[email protected]
https://lists.skewed.de/mailman/listinfo/graph-tool

Reply via email to