igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Help with using igraph_centralization_betweenness


From: Tamás Nepusz
Subject: Re: [igraph] Help with using igraph_centralization_betweenness
Date: Wed, 11 Jul 2012 21:35:52 +0200

> 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.

> igraph_centralization_closeness(&graph,0, 0,&centr_clos,0,0);
> 
> yields
> 
> Error at centrality.c:2563 :calculating closeness, Invalid mode
The mode parameter (i.e. the third one) must be one of IGRAPH_IN, IGRAPH_OUT or 
IGRAPH_ALL. Since your graph is undirected, it does not matter which value you 
set it to, but it must be one of the above.

> igraph_centralization_degree(&graph,0, 0, 1,&centr_degree,0,0);
> 
> yields
> 
> Error at type_indexededgelist.c:941 :degree calculation failed, Invalid mode
See above.

Best,
T.




reply via email to

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