I created a distance matrix table with pgr_dijkstraCostMatrix.
This table is now holding 168.000.000 records. (id = integer, start_vid = bigint, end_vid = bigint agg_cost = double precision)
I also have a points table (these are the points to visit). Holding 13 records. (id = bigint , name = var char)
If I check whether all the points are in the matrix, I get a good result. There are 156 records returned, so: 13*13 -13. That is what I expected.
The SQL for this check:
SELECT start_vid, end_vid, agg_cost
FROM distance AS a
INNER JOIN
points AS b
ON a.start_vid = b.id
INNER JOIN
points AS c
ON a.end_vid = c.id order by start_vid, end_vid
Now, when I am using pgr_TSP on this, I am getting the error:
ERROR: A Non symmetric Matrix was given as input CONTEXT: SQL function "pgr_tsp" statement 1 SQL state: XX000
SQL used:
SELECT * FROM pgr_TSP(
$$
SELECT start_vid, end_vid, agg_cost
FROM distance AS a
INNER JOIN
points AS b
ON a.start_vid = b.id
INNER JOIN
points AS c
ON a.end_vid = c.id
$$,
start_id := 92242,
randomize := false
);
What I am missing here? If my select produces a full matrix for my 13 points?
Using PostgreSQL 12, PostGIS 3.0.1 and pgRouting 3.0.0.