Distances in shortestPath function (package spatgraphs)
Great, thanks for the answer!
On m?n 18.j?n 2012 11:20, Julian Burgos wrote:
Dear list, I have a question about the shortestPath function (in the package spatgraphs... a very useful package but with very sparse documentation). The function finds the shortest connection between two nodes in a graph. According to the documentation, the usage of the function is shortestPath(i, j, g, pp=NULL, dbg=FALSE) where i and j are the starting and ending nodes, g is the graph that defines de edges, and pp is a point pattern. If pp is given, "the edges are of Euclidian length, otherwise each edge is of length 1.". So this is my question: if I give a point pattern, does the shortesPath function finds the shortest path in terms of distances between nodes or in terms of number of nodes? In other words, will the algorithm select a shorter path in terms of distance even if it goes through a larger number of nodes? I am asking because my graph is very dense (has lots of points) in some areas, and it is very sparse in others. I want to make sure that the algorithm actually picks the track with the shortest distance and not the track with the lowest number of nodes. Thanks! Julian
Julian Mariano Burgos, PhD Hafranns?knastofnunin/Marine Research Institute Sk?lagata 4, 121 Reykjav?k, Iceland S?mi/Telephone : +354-5752037 Br?fs?mi/Telefax: +354-5752001 Netfang/Email: julian at hafro.is