/* -*- mode: C -*- */ /* IGraph library. Copyright (C) 2011 Gabor Csardi Rue de l'Industrie 5, 1005 Lausanne, Switzerland This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include int main() { igraph_real_t wv[] = { 5,5,9,9, 9,7,9,2, 3,2,2,9, 8,6,3,9, 6,7,5,6 }; igraph_vector_t weights; igraph_t g; igraph_vector_t nrgeo; igraph_vector_ptr_t paths; igraph_vector_t to; int i; igraph_vector_view(&weights, wv, sizeof(wv) / sizeof(igraph_real_t)); igraph_full(&g, 5, /*directed=*/ 1, /*loops=*/ 0); igraph_vector_init(&nrgeo, 0); igraph_vector_ptr_init(&paths, 0); igraph_vector_init_seq(&to, 0, 4); igraph_get_all_shortest_paths_dijkstra(&g, &paths, &nrgeo, /*from=*/ 0, /*to=*/ igraph_vss_all(), &weights, IGRAPH_OUT); for (i=0; i