I have no problems using Dijkstra or A* functions, but when I try to run TSP, I really don't know where to start.
What I'm, trying is to get the 'best route' to link four points (typical TSP problem), but I do not know how to implement this. According the documentation:
SELECT seq, id1, id2, round(cost::numeric, 2) AS cost FROM pgr_tsp('SELECT id, x, y FROM vertex_table ORDER BY id', 6, 5);
My questions are:
- What means "cost::numeric" and specially "::"? I have seen it before, but still don't know what it is.
- Should I have another table with the points with x and y fields? Because if tsp refers to a "vertex table" that I supose will be the point table, where is the edge table (e.g streets) that I queried with Dijkstra?
- And what means that 5 and 6?
Sorry if this a strange question, but I'm trying to run this function but I can't do it, and I don't find any documentation but the official docs, (that I don't understand).