Add drivers for orders - vehicle routing problem

1390
10
Jump to solution
08-13-2018 04:59 AM
PeterStiegler
Esri Contributor

Is there a possibility to add several drivers to specific order?  I add two routes, see at the attached screenshot. 

My assumption under Routes is Driver 1 and Driver 2 registered. I assagin the orders to the drivers:

The Orders are assigned to the specific Driver but every time I want to solve the routes, the route is only calculated for Driver1 and the assigned jobs for Driver 2 go to Driver 1.

 

What could be the problem?

Thanks

Peter

0 Kudos
1 Solution

Accepted Solutions
HeatherMoe
Esri Contributor

Hi Peter,

Glad to hear that you were able to get Option 1 working and that you are willing to try out Option 2.  From looking at the set up you showed in the picture, it looks like you still have the Assignment Rule set to PreserveRoute from working with Option 1.  If you set that to Override for all of your orders, you should then be able to solve without a sequence value being added manually.  Also for Option 2 you do not need to specify a RouteName any more.  That will be taken care of by the specialties.  

Let me know if that works for you.

View solution in original post

10 Replies
HeatherMoe
Esri Contributor

Hello Peter,

There are two options for getting the solver to keep the assignments that you want for orders being assigned to the driver within the VRP solver.  

The first option is to assign the drivers using the route name field like you have already done, and also give them an arbitrary sequencing and change the assignment rule to Preserve Route.  This will allow the driver assignments that you have given to be respected but the sequencing to be optimized.  The one potential down fall to this method is that the solver will start from the sequence that you have given it and then try to improve from there.  This has caused some sub-optimal routes in rare cases because it gets into a local optimal when a better solution is still out there.  If you have orders that could be serviced by either route you would leave them without a route name and sequence and leave the assignment rule as Override. 

The second option is to use the specialties.  So for this you would go to the Specialties table and add a specialty for each driver.  Then under Routes you would add the driver name specialty to the designated route in the SpecialtyNames field in Routes.  Last you would add the required driver specialty to each order using the SpecialtyNames field in Orders.  The down side to this is it has more steps but it will allow for finding the best sequencing that our solver can find.  If you have orders that could be serviced by either route you would simply not give the order a specialty.

PeterStiegler
Esri Contributor

Hello Heather,

thank you very much for your detailed information, option 1 worked. In my case option 2 would be the better solution.

I would have a question about that. Is it necessary to enter a sequence in option two? If I carry out the settings without Sequence, I receive the following message:

If I enter a sequence manually, then I get a solution for it. However, according to your statement, I would understand that the Network Analyst for Option 2 should solve it by itself. Is that correct? Specialties are set up for the route and for the orders.

Thanks,

Peter

0 Kudos
HeatherMoe
Esri Contributor

Hi Peter,

Glad to hear that you were able to get Option 1 working and that you are willing to try out Option 2.  From looking at the set up you showed in the picture, it looks like you still have the Assignment Rule set to PreserveRoute from working with Option 1.  If you set that to Override for all of your orders, you should then be able to solve without a sequence value being added manually.  Also for Option 2 you do not need to specify a RouteName any more.  That will be taken care of by the specialties.  

Let me know if that works for you.

PeterStiegler
Esri Contributor

Hi Heather,

thank you so much, now option 2 worked as well.

one more question I would have to reach my goal.

I also want to generate routes for several days as described in this thread (Vehicle Routing Problem with orders taking multiple days)

Is that true that I can only calculate routes for a week and not for a whole month?

According to the description in the thread I made these settings.

As a test 3 breaks for 3 days. It is solved to me, but I always see only one route. Which starts on 16.8 and stops on 18.8. Is there a point I have to keep in mind? Thank you so much for your help!

0 Kudos
HeatherMoe
Esri Contributor

Hi Peter,

A single route can only have 5 breaks.  So if modeling that route to be out for multiple days you can only have 5 overnight breaks making for a six day route (assuming you do not model a break during the day as well).  This will create a single route for all of six days but you should see that the breaks are taken and the orders are distributed during the working hours of the different days.

I don't have a great sense of scale from your map of orders, but are they all in roughly the same geographic area and you are wanting the drivers to go home at the end of the night?  Or are you wanting them to stay the night out somewhere and continue on from that same location the next day (usually used for routes that travel long distances)?  If you are trying to model the first where the route ends for the day and the drivers go home we have some better modeling options then breaks and depending on the scale of your problem we could potentially help you plan for the whole month.  Let me know if this is more what you are trying to do and I can help with that.  I'd need to know for the 30 days how many (roughly) orders would be in the problem, do all of the orders have assigned drivers or are their some that could be visited by multiple drivers or all drivers, do any of the orders have specific days they need to be visited, and how many drivers are you routing for the month.

0 Kudos
PeterStiegler
Esri Contributor

Hi Heather,

thank you very much for your help and your detailed questions. 

In this case all orders a in the same geographic area. I want that the driver stops at 17 o'clock (Maximum Drive Time 8 Hours) and he should drive back to the deopot and at the next day the driver should carry on. If possible, that should generated for 1 month.

The orders are always assigned to a driver and the orders have no assigned date, 15 drivers are involved.

0 Kudos
HeatherMoe
Esri Contributor

Hi Peter,

With all orders being assigned to a specific driver that means there is no actual overlap between the drivers on the VRP and so you can actually make your problem simpler and be able to plan for the whole month.  The first step will be to separate the problem into a different VRP model per driver so only the orders that are assigned for that driver are in the specific model and only that driver's routes are in the model.  You can use the VRP layer's name to signify what driver that model is for and then set up 15 different layers for your 15 different drivers.  This means you do not need to use specialties to signify the drivers since the matching has already been done.  

The next step is to set up the routes so that there is one for each day in the month that you are wanting to model.  It sounds like the work days for the drivers are the same settings so the routes can be copies of each other.  Just change the naming so that it signifies the day that route will be taken such as Day1, Day2, Day3...  You therefore do not need to use the breaks to signify the end of the day (you could use them for lunch breaks if needed) and each day is modeled as a different route. 

Without any day of the week constraints on the orders, you are mostly just wanting the VRP solver to break the work up into different routes to use.  I might suggest adding dynamic seed points to get some better clustering allowing the driver to stay in one area of the region on a specific day.  

Let me know if you have more questions or need clarification on this.

PeterStiegler
Esri Contributor

Hi Heather,

Thank you very much for the detailed explanation, that was very useful for me.
Assuming I want to specify by the solver on which day the order should be carried out, would that be possible as well?

With these settings you wrote the order already assigned a day (In my case 16.8 for example)

Thanks

Peter

0 Kudos
PeterStiegler
Esri Contributor

Hi Heather,

i think i solved my problem, i made a route per day (like the screenshot above) without a pre-assignment of the route, after that the solver automatically assign the orders per day (route)

Thank you very much for your help!

0 Kudos