I am not an expert at OptaPlanner. But I would like to choose what you mentioned in your brackets (or a similar Open Source Framework). However, if OptaPlanner has already provided you with a reasonable solution, you can probably ignore it. If not, or you just want to compare the results, this may be of interest to you.
Firstly, the problem you are describing sounds simple, but is one of the most difficult tasks. This is basically Capacitated VRP with pickup and delivery, several depots, open routes and Windows time / restrictions. You probably can't find many open source solutions for this kind of problem.
I created a project called jsprit . jsprit can solve your problem. It is not like OptaPlanner and is not the basis. He pays great attention to the problems of vehicle routing and is a set of Java tools (i.e. a set of libraries). I implemented your problem. Here you can find the commented code.
I slightly changed one of your restrictions ("The way to move envelopes should be less than three times on the direct route, so delivery does not take too much time"). If you want the deliveries to be relatively fast, I think that you are better off making this restriction regarding the โbestโ messenger. Thus, I replaced it ("The method of moving envelopes should be three times smaller than the direct route with the best messenger, that is, the fastest messenger on the direct route").
Look at the result (you can build it and get a short report) and play with other restrictions or algorithm configurations to adapt it to your requirements. If you have any questions, feel free to contact me.
jsprit is in absolute terms and, compared to OptaPlanner, is a very young project, you will eventually find that errors or limiting restrictions are not as convenient as they should be. But it's good that you can help improve it ... reporting bugs, criticizing and suggesting alternative solutions, etc. :).
source share