[pgrouting-users] suspected bug in TSP distance matrix pgRouting RC1 released
Dave Potts
dave.potts at pinan.co.uk
Fri Jul 19 03:45:57 PDT 2013
I have been trying to do some work which requires the tsp, some of my
values have values of 0.1 in the dataset, I keep getting odd results.
So I tried a well known example from the pgr _tsp distance page and it
work as expected.
I then repeated the same example but reduced all of the distance by a
factor off 10 and got an error. Unless I have make a mistake in my
understanding of the manual page, I think we might a problem where
-- version used
select pgr_version();
pgr_version
-------------------------------------------------
(2.0.0-dev,v2.0.0-rc1,0,bf13fd7,develop,1.48.0)
-- Use a example get a result set
SELECT seq, id FROM
pgr_tsp('{{0,1,3,3},{1,0,2,2},{3,2,0,2},{3,2,2,0}}'::float8[],1);
seq | id
-----+----
0 | 1
1 | 2
2 | 3
3 | 0
(4 rows)
-- repeat for reduce everything by scale factor of 10 ie 1.0 becomes
0.1 etc
SELECT seq, id FROM
pgr_tsp('{{0,0.1,0.3,0.3},{0.1,0,0.2,0.2},{0.3,0.2,0,0.2},{0.3,0.2,0.2,0}}'::float8[],1);
ERROR: Error TSP fail to findEulerianPath, check your distance matrix
is valid.
As far as I understand it my matrix has 0's on the leading diangonal
and [a,b] == [b,a]
Dave.
More information about the Pgrouting-users
mailing list