[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Help with using igraph_centralization_betweenness

From: Giuseppe G.
Subject: Re: [igraph] Help with using igraph_centralization_betweenness
Date: Thu, 12 Jul 2012 11:03:07 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1

Hi Tamás, thanks for the reply. Centralisation degree and centralisation closeness work with no errors now.

However I still get the same problem with the centralisation_betweenness

igraph_real_t centr_betw;
igraph_real_t t_max;

igraph_centralization_betweenness(&graph,0, 0, 0,&centr_betw,&t_max,0);
printf("Centralization - betweenness %f, max %f\n", (float) centr_betw, (float)t_max);

printf("Centralization - betweenness %lf, max %lf\n", centr_betw,t_max);

and I get

Centralization - betweenness 4555078144.000000, max -980219904.000000

Any other suggestions on what I might be doing wrong? I played with the other boolean parameters with no success unfortunately.


On 11/07/12 20:35, Tamás Nepusz wrote:
igraph_real_t centr_betw;
igraph_read_graph_edgelist(&graph, instream, 0, IGRAPH_UNDIRECTED);

igraph_centralization_betweenness(&graph,0, 0, 0,&centr_betw,&t_max,0);
printf("Betweenness Centralization %f, max %f\n", centr_betw, t_max);

which gives

Betweenness Centralization 4555078098.244157, max -980219902.000000
The maximum should definitely be positive :) My guess here is that %f in the 
printf format string requires a float, but igraph_real_t is actually a double. 
Either cast the values down to floats or use %lf, which is the right format 
string for printing floats.

The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]