On Thu, Jun 18, 2009 at 10:32 AM, Yong Zou
<address@hidden> wrote:
Hi Tamas,
Thanks a lot for helping me. I tried to understand how to write a
correct code. It seems that I always get a
message:"structural_properties.c:873 :Size of the `res' and the `to'
should match".
igraph_t graph;
igraph_vector_ptr_t result_paths;
igraph_vector_t *result_path;
igraph_integer_t from_node;
igraph_integer_t to_node;
igraph_vector_ptr_init(&result_paths, 0);
from_node = 10;
to_node = 1000;
igraph_get_shortest_paths(&graph, &result_paths, from_node,
igraph_vss_1(to_node), IGRAPH_ALL);
result_path = igraph_vector_ptr_e(&result_paths, 0); // get the
first path in the result vector
for (i=0; i<igraph_vector_size(result_path); i++) {
printf("%ld ", (long)igraph_vector_e(result_path, i));
}
printf("\n");
igraph_vector_destroy(result_path); // destroy the path
igraph_vector_ptr_destroy(result_paths); // free all the pointers
and destroy the pointer list
Best,
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help