I've noticed some odd behavior when using igraph's random graph generation tools. It seems that srand() doesn't affect any immediately following random graph generators, but it does affect subsequent calls. The little program below illustrates. The first loop generates a sequence of random ERG graphs and prints the number of edges. They should all be the same because of the call to srand in the loop. In actuality, the last 4 graphs are the same but the first is almost certainly different from these. In the second loop, all the graphs are the same - presumably, due some srand initialization from the first. You can comment out the first loop to see that the same thing happens with GRG graphs as well.
There is a simple work around; simply call some random graph generator at the start of your program.
Mark McClure
-------- Random program ---------- #include <igraph.h> #include <stdlib.h>
int main(void) { igraph_t graph; igraph_vector_t x, y; int i;