#include <igraph.h>
int main(void)
{
igraph_integer_t diameter;
igraph_t graph;
igraph_rng_seed(igraph_rng_default(), 42);
igraph_erdos_renyi_game(&graph, IGRAPH_ERDOS_RENYI_GNP, 1000, 5.0/1000,
IGRAPH_UNDIRECTED, IGRAPH_NO_LOOPS);
igraph_diameter(&graph, &diameter, 0, 0, 0, IGRAPH_UNDIRECTED, 1);
printf("Diameter of a random graph with average degree 5: %d\n",
(int) diameter);
igraph_destroy(&graph);
return 0;
}
I2luY2x1ZGUgPGlncmFwaC5oPgoKaW50IG1haW4odm9pZCkKewogICAgIGlncmFwaF9pbnRlZ2VyX3QgZGlhbWV0ZXI7CiAgICAgaWdyYXBoX3QgZ3JhcGg7CiAgICAgaWdyYXBoX3JuZ19zZWVkKGlncmFwaF9ybmdfZGVmYXVsdCgpLCA0Mik7CiAgICAgaWdyYXBoX2VyZG9zX3JlbnlpX2dhbWUoJmdyYXBoLCBJR1JBUEhfRVJET1NfUkVOWUlfR05QLCAxMDAwLCA1LjAvMTAwMCwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICBJR1JBUEhfVU5ESVJFQ1RFRCwgSUdSQVBIX05PX0xPT1BTKTsKICAgICBpZ3JhcGhfZGlhbWV0ZXIoJmdyYXBoLCAmZGlhbWV0ZXIsIDAsIDAsIDAsIElHUkFQSF9VTkRJUkVDVEVELCAxKTsKICAgICBwcmludGYoIkRpYW1ldGVyIG9mIGEgcmFuZG9tIGdyYXBoIHdpdGggYXZlcmFnZSBkZWdyZWUgNTogJWRcbiIsCiAgICAgICAgICAgICAoaW50KSBkaWFtZXRlcik7CiAgICAgaWdyYXBoX2Rlc3Ryb3koJmdyYXBoKTsKICAgICByZXR1cm4gMDsKfQ==