I have a TSP problem that I'd to determine if my solution path is correct. As stated, a classic TSP, I have a number of locations (bikeshare stations) within a city centre (Glasgow, Scotland) that I'd like to find the lowest cost route in terms of distance which connects all points and arrives back at the start point. There are two sets of locations 22 points and 21 points each.

I've fairly comfortable with QGIS, and would like to take my knowledge a further. I'm considering using pgRouting to uncover the route solution listed above. Right now, I'm confident that pgRoute will output a route. However, I want to confirm that pgRouing can use OpenStreetMap as the network parameters. That the routes produced by pgRouting will follow the road system written in OSM. Specifically, - for example, turns not possible, one-way streets.

2 Answers 2


Yes, pgRouting can do TSP: http://pgrouting.org/docs/1.x/tsp.html

Yes, pgRouting uses OSM data - import an OSM extract using osm2pgrouting: http://pgrouting.org/docs/tools/osm2pgrouting.html

As for turns - I haven't gotten into this specifically but there is the Turn Restriction Shortest Path that you should be able to incorporate: http://docs.pgrouting.org/2.0/en/src/trsp/doc/index.html


You can check this application, it might be useful too: osm2po. It can create a routable network on OSM.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.