No Graph is Being Displayed in IGraph

泪湿孤枕 提交于 2019-12-11 17:59:57

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!