[pgrouting-users] Bug in apspWarshall, always directed?

Vicky Vergara vicky_vergara at hotmail.com
Fri Dec 11 12:37:49 PST 2015


Hello Remi:

We are actually working on this problems.
This is the documentation of the proposed function pgr_floydwarshall: 
http://docs.pgrouting.org/dev/src/allpairs/doc/floydWarshall.html

Probably by mid january things will be merged on the main repository for people to start testing.

Here:
https://github.com/pgRouting/pgrouting/issues/324

You can comment about the (v,v,0) case (or open a new ticket)
The proposed function returns the value, so does proposed pgr_johnson and pgr_dijstraCost family 
for consistency if (v,v,0) is not returned, it should also happen to all of those.


regards, 
Vicky

Date: Fri, 11 Dec 2015 13:07:52 +0100
From: remi.cura at gmail.com
To: pgrouting-users at lists.osgeo.org
Subject: [pgrouting-users] Bug in apspWarshall, always directed?

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





_______________________________________________
Pgrouting-users mailing list
Pgrouting-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/pgrouting-users 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20151211/92a325bf/attachment.html>


More information about the Pgrouting-users mailing list