[pgrouting-users] Bug in apspWarshall, always directed?
Rémi Cura
remi.cura at gmail.com
Fri Dec 11 04:07:52 PST 2015
Hey dear list,
this is my first post,
so sorry if my question
feels strange.
I use the latest pgr with 9.3 postgres
"(2.1.0,pgrouting-2.1.0,1,b38118a,master,1.54.0)"
I can't figure out how to use the result of the
`
pgr_apspWarshall
`
function
According to the doc, it is supposed to
"Returns all costs for each pair of nodes in the graph."
OK, so using the sample data,
with a graph of 17 nodes, the results should be
17 * ( 17 - 1 ) / 2 costs, that is 136 edges .
Yet I get only 74 edges.
In short the algorithm seems to not use at all the
"directed" parameter (true of false returns the same result).
Even when manually duplicating all edges to create a directed graph that is
equivalent to an undirected graph (2 directed edges instead of 1 undirected
edge), I still don't get the right result number (160). (same for jonhson)
Morevover, what's the point to return in the result all the
source, target, cost
X , X , 0
, this is only bloating the result imo.
At first I thought you had choose to return the shortest path tree for
better memory management, but it doesn't seems to be the case
(could be a good idea).
I tracked the problem to
'
https://github.com/pgRouting/pgrouting/blob/master/src/apsp_warshall/src/apsp_boost_wrapper.cpp
'
, which is the function that get called at the end.
It seems that the argument 'directed' is never used!
The querry is
-------------
SELECT seq, id1 AS source, id2 AS destination, cost aS cost_
FROM pgr_apspWarshall(
'SELECT id, source, target, cost FROM edge_table_test',
directed:=false, has_reverse_cost:=false
--------------
Lastly the doc is out of data at
"
http://docs.pgrouting.org/2.1/src/apsp_warshall/doc/index.html#pgr-apsp-warshall
"
in 2.1 the argument is no more "reverse_cost"
but "has_reverse_cost"
Cheers,
Rémi-C
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20151211/f7d68628/attachment.html>
More information about the Pgrouting-users
mailing list