I have a question regarding Jsprit.Parameter.FAST_REGRET.
I am trying to use it with initial routes, but no solution is generated. If I remove “Jsprit.Parameter.FAST_REGRET”, the solution is generated. I don’t know why is that.
From the description of FAST_REGRET, it says “Fast regret boosts your computation, i.e. it reduces computation time significantly. However, it can only be use currently if no complicated dependencies between jobs and activities are defined.”
What does “no complicated dependencies between jobs and activities are defined” mean?
Is it possible to use FAST_REGRET when you have initial routes?
This is incredibly obscure I’m afraid. What do you mean “no solution is generated”? How are you using “Jsprit.Parameter.FAST_REGRET”? Are there errors; what’s your setup? You need to give us some basis on which to make a judgement.
The problem is that there are no errors to show or tack, and no solution is produced. It is just stopped.
However, if I remove the initialRoute part, it works fine and the solution is produced. Or if I remove the vraBuilder.setProperty(Jsprit.Parameter.FAST_REGRET, “true”) part and keep the initialRoute part, it works fine and the solution is produced.
services 44 and 26 are added to the initial route by .addService(getService(“44”, vrpBuilder)) and .addService(getService(“26”, vrpBuilder)). it looks to me that they are part of the vrp, no?
No, they are not part of the vrp. You can check it using:
vrp.getJobs().containsKey(“44”);
vrp.getJobs().containsKey(“26”);
“since job (service) 26 and 44 are already planned in initial route and thus static AND sequence is fixed they should not be in jobMap anymore (only variable jobs are in jobMap).”
I got the following error when I run the above code with “Jsprit.Parameter.FAST_REGRET”:
Exception in thread “main” java.lang.ArrayIndexOutOfBoundsException: 50
at jsprit.core.algorithm.recreate.RegretInsertionFast.updateInsertionData(RegretInsertionFast.java:164)
at jsprit.core.algorithm.recreate.RegretInsertionFast.insertUnassignedJobs(RegretInsertionFast.java:136)
at jsprit.core.algorithm.recreate.AbstractInsertionStrategy.insertJobs(AbstractInsertionStrategy.java:89)
at jsprit.core.algorithm.InsertionInitialSolutionFactory.createSolution(InsertionInitialSolutionFactory.java:56)
at jsprit.core.algorithm.PrettyAlgorithmBuilder$2.informAlgorithmStarts(PrettyAlgorithmBuilder.java:144)
at jsprit.core.algorithm.listener.VehicleRoutingAlgorithmListeners.algorithmStarts(VehicleRoutingAlgorithmListeners.java:127)
at jsprit.core.algorithm.VehicleRoutingAlgorithm.algorithmStarts(VehicleRoutingAlgorithm.java:296)
at jsprit.core.algorithm.VehicleRoutingAlgorithm.searchSolutions(VehicleRoutingAlgorithm.java:196)
at MultipleDepotWithInitialRoutesExample.main(MultipleDepotWithInitialRoutesExample.java:48)
look at the following example. s1 is added to the initial route, and is also added to the vrp. yes vrp.getJobs().containsKey(“s1”) will return false, but the algo will throw the error you encountered.
how to fix it? do not call .addJob(s1) when constructing the vrp.