|
From: | Gábor Csárdi |
Subject: | Re: [igraph] Printing results from shortest path function to file |
Date: | Sun, 23 Mar 2014 20:51:16 -0400 |
Hello, I am trying to write the results calculated from shortest path to a file, but not able to do. When i try to print by following way it produces some addresses and not paths. Please guide
void main()
{
igraph_t graph;
igraph_vector_t v;
igraph_vector_ptr_t res;
igraph_vector_t nrgeo;
igraph_integer_t sender;
FILE *input;
FILE *fp;
long int i;
input=fopen("DCell2k.txt", "r");
igraph_read_graph_edgelist(&graph, input, 0, 0);
/*initializing res and nrgeo*/
igraph_vector_ptr_init(&res, 0);
igraph_vector_init(&nrgeo, 0);fp=fopen("results.txt", "w");
for(sender=0; sender<20; sender++)
{
if(sender%3==0)
{
continue;
}
igraph_get_all_shortest_paths(&graph, &res, &nrgeo, sender, igraph_vss_seq(1,20), IGRAPH_ALL);fprintf(fp, "%p\n", VECTOR(res));}
igraph_destroy(&graph);
}
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |