Optimization seems wrong

Here the Input and the result:

[{“address”:“starting”,“lat”:“48.9108945”,“lng”:“2.782249”},{“address”:“1”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.69241”,“lng”:“2.50375”,“servicetime”:5},{“address”:“2”,“lat”:“48.634254”,“lng”:“2.514352”,“servicetime”:15},{“address”:“3”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.602011”,“lng”:“2.468802”,“servicetime”:5},{“address”:“4”,“lat”:“48.610868”,“lng”:“2.428292”,“servicetime”:0},{“address”:“5”,“lat”:“48.632432”,“lng”:“2.413783”,“servicetime”:0},{“address”:“6”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.644673”,“lng”:“2.268202”,“servicetime”:5},{“address”:“7”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.6387”,“lng”:“2.26747”,“servicetime”:5},{“address”:“8”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.63654”,“lng”:“2.26664”,“servicetime”:5},{“address”:“9”,“lat”:“48.599163”,“lng”:“2.279093”,“servicetime”:0},{“address”:“10”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.62122”,“lng”:“2.330025”,“servicetime”:5},{“address”:“11”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.64396”,“lng”:“2.38854”,“servicetime”:5},{“address”:“12”,“lat”:“48.708043”,“lng”:“2.309801”,“servicetime”:0},{“address”:“13”,“lat”:“48.704391”,“lng”:“2.303933”,“servicetime”:15},{“address”:“14”,“lat”:“48.68423”,“lng”:“2.344414”,“servicetime”:0},{“address”:“15”,“lat”:“48.618469”,“lng”:“2.37376”,“servicetime”:15},{“address”:“16”,“lat”:“48.685137”,“lng”:“2.350313”,“servicetime”:0},{“address”:“17”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.697278”,“lng”:“2.385868”,“servicetime”:5},{“address”:“18”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.679998”,“lng”:“2.344162”,“servicetime”:5},{“address”:“19”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.67217”,“lng”:“2.31756”,“servicetime”:5},{“address”:“20”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.700231”,“lng”:“2.292005”,“servicetime”:5},{“address”:“21”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.7002”,“lng”:“2.2922”,“servicetime”:5},{“address”:“22”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.707137”,“lng”:“2.30088”,“servicetime”:5},{“address”:“23”,“lat”:“48.72931”,“lng”:“2.279717”,“servicetime”:15},{“address”:“24”,“lat”:“48.731875”,“lng”:“2.271774”,“servicetime”:15},{“address”:“25”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.732873”,“lng”:“2.248104”,“servicetime”:5},{“address”:“26”,“lat”:“48.723174”,“lng”:“2.249394”,“servicetime”:0},{“address”:“27”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.69931”,“lng”:“2.22978”,“servicetime”:5},{“address”:“28”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.71302”,“lng”:“2.18067”,“servicetime”:5},{“address”:“29”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.69651”,“lng”:“2.1685”,“servicetime”:5},{“address”:“30”,“lat”:“48.703691”,“lng”:“2.155152”,“servicetime”:15},{“address”:“31”,“restrictions”:{“ready”:275,“due”:185},“lat”:“48.72881”,“lng”:“2.29431”,“servicetime”:5},{“address”:“32”,“lat”:“48.739123”,“lng”:“2.329892”,“servicetime”:0},{“address”:“arrival”,“lat”:“48.912638”,“lng”:“2.799862”}]

{“id”:“6g4zLssY”,“count”:34,“feasible”:true,“route”:{“0”:{“name”:“starting”,“arrival”:0,“distance”:0.0},“1”:{“name”:“1”,“arrival”:45,“distance”:42.7},“2”:{“name”:“2”,“arrival”:60,“distance”:51.3},“3”:{“name”:“3”,“arrival”:82,“distance”:58.9},“4”:{“name”:“4”,“arrival”:93,“distance”:64.0},“5”:{“name”:“5”,“arrival”:97,“distance”:67.5},“6”:{“name”:“6”,“arrival”:110,“distance”:81.2},“7”:{“name”:“7”,“arrival”:116,“distance”:82.0},“8”:{“name”:“8”,“arrival”:121,“distance”:82.2},“9”:{“name”:“9”,“arrival”:136,“distance”:88.3},“10”:{“name”:“10”,“arrival”:145,“distance”:94.3},“11”:{“name”:“11”,“arrival”:160,“distance”:101.7},“12”:{“name”:“12”,“arrival”:175,“distance”:113.0},“13”:{“name”:“13”,“arrival”:180,“distance”:116.4},“14”:{“name”:“14”,“arrival”:202,“distance”:123.2},“15”:{“name”:“15”,“arrival”:214,“distance”:134.2},“16”:{“name”:“16”,“arrival”:239,“distance”:146.8},“17”:{“name”:“17”,“arrival”:245,“distance”:150.7},“18”:{“name”:“18”,“arrival”:287,“distance”:155.2},“19”:{“name”:“19”,“arrival”:297,“distance”:157.8},“20”:{“name”:“20”,“arrival”:308,“distance”:162.3},“21”:{“name”:“21”,“arrival”:313,“distance”:162.4},“22”:{“name”:“22”,“arrival”:323,“distance”:164.9},“23”:{“name”:“23”,“arrival”:333,“distance”:168.3},“24”:{“name”:“24”,“arrival”:350,“distance”:169.2},“25”:{“name”:“25”,“arrival”:370,“distance”:171.6},“26”:{“name”:“26”,“arrival”:378,“distance”:173.2},“27”:{“name”:“27”,“arrival”:384,“distance”:176.7},“28”:{“name”:“28”,“arrival”:398,“distance”:181.9},“29”:{“name”:“29”,“arrival”:410,“distance”:186.0},“30”:{“name”:“30”,“arrival”:418,“distance”:187.8},“31”:{“name”:“31”,“arrival”:449,“distance”:202.2},“32”:{“name”:“32”,“arrival”:460,“distance”:206.1},“33”:{“name”:“arrival”,“arrival”:507,“distance”:256.7}}}

Point 15 seems oddly placed.

It should have been placed before point 14

Regards

We ran your input on our website but got a different result:

The result you shared seems to be in the same order as your input, as if the algorithm did not sort your locations. Did you set the skipOptimisation parameter? Make sure not to use it when your route must be optimised, even setting it to false can give bad results.

It is a user which warn me of the problem, there is button to send me the input by mail

As the route is already optimized, it is in same order, I don’t use skipOptimisation

The problem seems to be related to “restrictions”:{“ready”:275,“due”:185} (some visit are closed for lunch)

It may indeed happen that a distant stop is visited during lunch time of other stops, if that decreases the total time for the route. Our algorithm is geared to minimize time, not distance as such. To prevent this behaviour, you may try to add lunch time to all stops.