问题
I have been trying to make graphs using the igraph library in c. I have even reinstalled it but i am unable to understand the problem. The whole program is compiled successfully but i get no graph as an output. All the printf's are executed and are shown in the output only the graph seems to be missing.
Please help i am stuck in this problem.
#include <igraph.h>
int main(void)
{
igraph_real_t diameter;
igraph_t graph;
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: %f\n",
(double) diameter);
igraph_destroy(&graph);
return 0;
}
This is the code i am using. Only the printf statement is being printed.There is no error or warning.
回答1:
You are using igraph from C, and the C core of igraph completely lacks plotting capabilities. (This is deliberate). If you want to plot graphs, you have to use igraph's Python or R bindings; in the Python and R modules, plotting is implemented on top of the C core library.
来源:https://stackoverflow.com/questions/10022102/no-graph-is-being-displayed-in-igraph