jeudi 12 mars 2015

Using igraph C library to generate a network with power law degree distribution


I'm using igraph C library and I want to generate a undirected, without loop, and a single edge network with power law degree distribution. The parameters I have is number of nodes = 25,000, number of edges = 25,000, alpha = 2.16104. I want to use the igraph_static_power_law_game graph generator and I wrote the following code.



#include <igraph.h>

int main() {

igraph_t g;
int igraph_static_power_law_game(&g, 25000, 25000, 2.16104, -1, 0, 0, 1);
igraph_destroy(&g);

return 0;
}


I use the the following commend to compile the code.


gcc testpw.cpp -I/usr/local/Cellar/igraph/0.7.1/include/igraph -L/usr/local/Cellar/igraph/0.7.1/lib -ligraph -o testpw


And it appeared the following error.


error: excess elements in scalar initializer int igraph_static_power_law_game(&g, 25000, 25000, 2.16104, -1, 0, 0, 1); ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 error generated.


Since I can't find an example of using igraph C library to generate power-law degree network online. I don't know what's the way to make it. Am I doing something wrong here? Thank you for your response!




Aucun commentaire:

Enregistrer un commentaire