For more than two days I'm trying to make the TSP algorithm work in PostgreSQL/PostGIS. My problem seems to occur when I'm trying to take into account the road network for TSP algorithm. I know that the algorithm it will calculate the distance in Euclidean space as a default setting.
As an example:
SELECT vertex_id FROM tsp('SELECT id as source_id, lon AS x, lat AS y FROM point_layer','23,221,63,432,335,',63);
where the point_layer is the table which holds the points information (as PlaceMarks), numbers like:
23,221,63,432,335 stands for places (cities) and
63 as a starting point.
If you have experience with this approach please advise.