Traveling salesman routing


We are migrating from OSRM to Graphopper but are missing locally hosted OSRM trip service replacement (travelling salesman routing). In POST routing enpoint API I see optimize parameter but it has no effect on calls to our locally running GH. And it is not mentioned in documentation on GitHub. So, is there a way to make it working locally?

GraphHopper (the routing engine) does not include TSP. You need jsprit for this:

Thanks. Can I integrate jsprit with GH easily to have such HTTP API or it is not a trivial task? I can accept to do some light Java coding :slight_smile: if necessary. Or are there some instructions for this?

There is no designated way to do this in GraphHopper, so yes you will have to do some custom programming for this. You basically need to calculate the routes with GraphHopper and feed the results to jsprit and solve the TSP there. If you want to support this using an optimize flag for the /route endpoint you will have to adjust accordingly. You can also search the forum, there might be something useful in previous posts (Iā€™m not sure).

1 Like
Powered by Discourse