igraph-help
[Top][All Lists]
Advanced

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

[igraph] Printing results from shortest path function to file


From: Sana Rahim
Subject: [igraph] Printing results from shortest path function to file
Date: Sun, 23 Mar 2014 13:15:27 -0700 (PDT)

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);

}


reply via email to

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