
From:  Tamas Nepusz 
Subject:  Re: [igraph] List triangles 
Date:  Tue, 21 Feb 2017 20:26:01 +0100 
How can one list all the triangles in igraph C? I could not find an example in documentation. I'd like the same output as triangles(g) in R. I tried the following as an example but I cannot get it to work. Error is Segmentation fault (core dumped). Any help would be much appreciated.
#include <igraph.h>
int main(void) {igraph_vector_t v;igraph_vector_int_t triangles;igraph_t graph;
igraph_real_t edges[] = { 0, 1, 0, 2, 1, 2, 2, 3, 2, 4, 3, 4 };igraph_vector_view(&v, edges, sizeof(edges)/sizeof(double));igraph_create(&graph, &v, 0, IGRAPH_UNDIRECTED);
igraph_list_triangles(&graph, &triangles);igraph_vector_int_destroy(&triangles); }
Alex
_______________________________________________
igraphhelp mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraphhelp
[Prev in Thread]  Current Thread  [Next in Thread] 