#include #include int main() { igraph_t g, g2, g3; igraph_vector_t v1; long int i; igraph_vector_init(&v1, 0); printf("Hundred Gnp random graphs\n"); for (i=0; i<100; i++) { igraph_erdos_renyi_game(&g, IGRAPH_ERDOS_RENYI_GNP, 1000, 3.0/1000, /*directed=*/ 0, /*loops=*/ 0); igraph_destroy(&g); } printf("Generate hundred scale free graphs\n"); for (i=0; i<100-1; i++) { igraph_barabasi_game(&g, 1000, 4, /*outseq=*/ 0, /*outpref=*/ 0, /*directed=*/ 1); igraph_destroy(&g); } printf("Rewire a ring graph a hundred times\n"); igraph_erdos_renyi_game(&g2, IGRAPH_ERDOS_RENYI_GNP, 1000, 10.0/1000, /*directed=*/ 0, /*loops=*/ 0); for (i=0; i<100; i++) { igraph_degree(&g2, &v1, igraph_vss_all(), IGRAPH_ALL, /*loops=*/ 1); igraph_degree_sequence_game(&g3, &v1, 0, IGRAPH_DEGSEQ_VL); igraph_destroy(&g3); } igraph_destroy(&g2); igraph_barabasi_game(&g, 1000, 4, /*outseq=*/ 0, /*outpref=*/ 0, /*directed=*/ 1); printf("Simplify 100 graphs\n"); for (i=0; i<100; i++) { igraph_copy(&g2, &g); igraph_simplify(&g2, /*multiple=*/ 1, /*loops=*/ 1); igraph_destroy(&g2); } igraph_simplify(&g, 1, 1); printf("Betweenness (10 times)\n"); for (i=0; i<10; i++) { igraph_betweenness(&g, &v1, igraph_vss_all(), /*directed=*/ 1, /*weights=*/ 0); } printf("Transitivity (10 times)\n"); for (i=0; i<10; i++) { igraph_real_t res; igraph_transitivity_undirected(&g, &res, IGRAPH_TRANSITIVITY_NAN); } printf("Closeness (10 times)\n"); for (i=0; i<10; i++) { igraph_closeness(&g, &v1, igraph_vss_all(), IGRAPH_ALL, /*weights=*/ 0); } igraph_vector_destroy(&v1); igraph_destroy(&g); return 0; } /* user 0m10.017s sys 0m0.044s user 0m10.145s sys 0m0.072s user 0m9.833s sys 0m0.068s user 0m10.065s sys 0m0.044s user 0m9.741s sys 0m0.028s */