Optimization with destination pairs from a set of destinations

Hello,

How can I solve the following problem with Openservice Route? I have a large number of destinations. Each route starts and ends at the same warehouse. Each route always leads to two destinations. How can I find such destination pairs so that the total distance for all routes is minimal?
Regards, mainze

Hey,

on first glance, this sounds like a combinatorial optimization problem that might be modeled as an assignment problem, a matching problem or maybe a max-flow problem.

The openrouteservice can only help you with the underlying data, i.e. via the /matrix-endpoint provide travel distances and durations from your warehouse to any of the destinations, and then between every destination pair.

Set up a bipartite graph with all destinations on both sides, edges between unique pairs of destinations that would be in one route and weight corresponding to the complete tour (i.e. warehouse to dest. 1, dest. 1 to dest. 2 and dest. 2 to warehouse) and look for a matching satisfying whatever conditions you have.

Best regards

1 Like

Hi, thanks for your hints. They are interesting. Unfortunately I need more information to solve this problem.
Regards, mainze

Hey,

this is a forum regarding the openrouteservice. Your question is a bit out of scope, so I’d propose you look for a forum regarding discrete optimization and modeling to see how you can model and solve your problem :slight_smile:

Best regards