What is the best practice for solving VRPMT problem with optaplanner?

自作多情 提交于 2020-02-02 12:52:26

问题


Our current approach is running solver many times. I am wondering if there is a better approach.

Some explanation:

Vehicle Routing Problem with Multiple Trips (VRPMT): The vehicles can do more than one route.


回答1:


Take the VRP example, rename Vehicle to VehiclePerDay, then introduce 2 fields on it: the vehicle and the LocalDate. This is presuming one trip per day.

If you do multiple trips on the same day, there are 2 approaches:

1) Split Vehicle into VehicleTrip as above and have them point at the previous one. So the second trip leaves when the first trip of the same vehicle returns back to the depot (plus loading time)

2) Use shadow variable sum capacity usage until each visit and introduce "automatic" return back to depot moments. Basically, if a vehicle has a capacity of 10 and delivers to 5 locations with 3 items each, it looks like this:

  • Vehicle A
    • Visit 1: total capacity need 3, @ShadowVariable goBackToDepotFirst=false
    • Visit 2: total capacity need 6, @ShadowVariable goBackToDepotFirst=false
    • Visit 3: total capacity need 9, @ShadowVariable goBackToDepotFirst=false
    • Visit 4: total capacity need 3, @ShadowVariable goBackToDepotFirst=true
    • Visit 5: total capacity need 6, @ShadowVariable goBackToDepotFirst=false


来源:https://stackoverflow.com/questions/58952131/what-is-the-best-practice-for-solving-vrpmt-problem-with-optaplanner

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!