GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
allpairs.c File Reference

Network Analysis library - shortest path between all pairs. More...

#include <stdio.h>
#include <stdlib.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
#include <grass/dgl/graph.h>
Include dependency graph for allpairs.c:

Go to the source code of this file.

Functions

int NetA_allpairs (dglGraph_s *graph, dglInt32_t **dist)
 Stores the directed distance between every pair. More...
 

Detailed Description

Network Analysis library - shortest path between all pairs.

Computes the length of the shortest path between all pairs of nodes in the network.

(C) 2009-2010 by Daniel Bundala, and the GRASS Development Team

This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.

Author
Daniel Bundala (Google Summer of Code 2009)

Definition in file allpairs.c.

Function Documentation

int NetA_allpairs ( dglGraph_s graph,
dglInt32_t **  dist 
)

Stores the directed distance between every pair.

Todo:
Use only O(W*W) memory where W is the number of nodes present in the graph

Upon the completion, dist stores the directed distance between every pair (i,j) or -1 if the nodes are unreachable. It must be an array of dimension [nodes+1]*[nodes+1]

Parameters
graphinput graph
[out]distlist of directed distance
Returns
-1 on error
0 on success

Definition at line 38 of file allpairs.c.

References dglEdgeGet_Cost(), dglEdgeGet_Id(), dglEdgeGet_Tail(), dglEdgeset_T_First(), dglEdgeset_T_Initialize(), dglEdgeset_T_Next(), dglEdgeset_T_Release(), dglGet_NodeCount(), dglNode_T_First(), dglNode_T_Initialize(), dglNode_T_Next(), dglNode_T_Release(), dglNodeGet_Id(), dglNodeGet_OutEdgeset(), G_fatal_error(), G_free(), G_message(), G_percent(), and G_percent_reset().