<div dir="ltr"><div>Check out <a href="https://github.com/mapbox/node-or-tools#node-or-tools">https://github.com/mapbox/node-or-tools#node-or-tools</a></div><div><br></div><div>The pickup and delivery feature makes sure</div><div>- the delivery location is served by the same car serving the pickup location</div><div>- the delivery location is served after the pickup location</div><div><br></div><div>For example for (pickup, delivery)-pairs (4, 12), (9, 8) you can set:<br></div><div><pre>  pickups<span class="gmail-pl-k">:</span> [<span class="gmail-pl-c1">4</span>, <span class="gmail-pl-c1">9</span>],
  deliveries<span class="gmail-pl-k">:</span> [<span class="gmail-pl-c1">12</span>, <span class="gmail-pl-c1">8</span>]<br><br></pre></div><div><li><code>pickups</code> <strong><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" rel="nofollow">Array</a></strong> with node indices for picking up good. The corresponding delivery node index is in the <code>deliveries</code> <strong><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" rel="nofollow">Array</a></strong>
 at the same position (parallel arrays). For a pair of pickup and 
delivery indices: pickup location comes before the corresponding 
delivery location and is served by the same vehicle.</li></div><div><br></div><div>
<li><code>deliveries</code> <strong><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" rel="nofollow">Array</a></strong> with node indices for delivering picked up goods. The corresponding pickup node index is in the <code>pickups</code> <strong><a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array" rel="nofollow">Array</a></strong>
 at the same position (parallel arrays). For a pair of pickup and 
delivery indices: pickup location comes before the corresponding 
delivery location and is served by the same vehicle.</li></div><div><br></div><div>Hope that helps,</div><div>Daniel J H<br></div><div><br></div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 5, 2018 at 9:56 AM, Sasha Khapyorsky <span dir="ltr"><<a href="mailto:sashakh@gmail.com" target="_blank">sashakh@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Guys,<br>
<br>
May be another "ordering" example: pickup and dropoff points . Let's<br>
say I'm delivery man with 10 orders for today, each one should be<br>
picked up first and dropped off later. This looks like 20 points TSP,<br>
but there are also dependencies - some job(s) can be dependant from<br>
another job(s). Any thoughts?<br>
<br>
I know, it is not really OSRM stuff, but related to the topic.<br>
<span class="HOEnZb"><font color="#888888"><br>
Sasha<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
On Sat, Aug 4, 2018 at 11:22 PM, Julien Coupey <<a href="mailto:osm@coupey.fr">osm@coupey.fr</a>> wrote:<br>
> Hi Valerio,<br>
><br>
> In your example, if the 3 ordered points need to be visited in a row, then<br>
> you can easily transform your problem into a TSP by treating them as a<br>
> single "job". You'd just have to adjust the matrix by ensuring that from any<br>
> other place, the cost to that job is the cost to the first point, and the<br>
> cost from that job is the cost from the third point.<br>
><br>
> HTH<br>
> Julien<br>
><br>
><br>
> On 02/08/2018 15:12, Valerio Paruscio wrote:<br>
>><br>
>> Hi,<br>
>> i'm wandering if its possible to set the order of some points in the<br>
>> routing service.<br>
>> I mean, I need to keep 3 out of 10 points in a certain order, while the<br>
>> remaining 7 can be in whatever order.<br>
>> Is that possible<br>
>><br>
>> Thank you very much<br>
>><br>
>> Valerio<br>
>><br>
>><br>
>> ______________________________<wbr>_________________<br>
>> OSRM-talk mailing list<br>
>> <a href="mailto:OSRM-talk@openstreetmap.org">OSRM-talk@openstreetmap.org</a><br>
>> <a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.<wbr>org/listinfo/osrm-talk</a><br>
>><br>
><br>
> ______________________________<wbr>_________________<br>
> OSRM-talk mailing list<br>
> <a href="mailto:OSRM-talk@openstreetmap.org">OSRM-talk@openstreetmap.org</a><br>
> <a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.<wbr>org/listinfo/osrm-talk</a><br>
<br>
______________________________<wbr>_________________<br>
OSRM-talk mailing list<br>
<a href="mailto:OSRM-talk@openstreetmap.org">OSRM-talk@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.<wbr>org/listinfo/osrm-talk</a><br>
</div></div></blockquote></div><br></div>