Hi,
Recently I am testing with fast regret. I have some questions about the update insertion data part of it.
I understand that, when it is not the first run, if the dependency type of the job is not defined or is NO_TYPE, it updates for the last modified route only; and if the dependency type is INTER_ROUTE or INTRA_ROUTE, it updates for all the routes. I understand the reason is that the current fast regret does not work when there are dependencies between the jobs, as commented in #161.
I used to think that when there is no dependencies between the jobs, if I define INTER_ROUTE or INTRA_ROUTE dependency type on all the jobs, it would return the same solution as the “regular” regret because it always updates for all the routes. However, I have conducted some tests on the pickups_and_deliveries_solomon problems and find out that is not the case. The tests also show that the solution changes quite a bit for some problems when I increase the proportion of the jobs on which I define INTER_ROUTE or INTRA_ROUTE dependency type.
I wonder does it indicate that there is something not correct with the current fast regret approach, or is it expected?
Please find below the code snippet and the test results.
Best regards,
He
code snippet:
VehicleRoutingProblem.Builder vrpBuilder = VehicleRoutingProblem.Builder.newInstance();
VrpXMLReader vrpXMLReader = new VrpXMLReader(vrpBuilder);
vrpXMLReader.read("jsprit-examples/input/pickups_and_deliveries_solomon_c101.xml");
VehicleRoutingProblem vrp = vrpBuilder.build();
Jsprit.Builder algorithmBuilder = Jsprit.Builder.newInstance(vrp);
// fast regret with dependency type intra_route on jobs
StateManager stateManager = new StateManager(vrp);
ConstraintManager constraintManager = new ConstraintManager(vrp, stateManager);
int count = 0;
for (String jobId : vrp.getJobs().keySet()) {
constraintManager.setDependencyType(jobId, DependencyType.INTRA_ROUTE);
count++;
if (count > vrp.getJobs().size() * 0.1) break;
}
algorithmBuilder.setStateAndConstraintManager(stateManager, constraintManager);
algorithmBuilder.setProperty(Jsprit.Parameter.FAST_REGRET, "true");
VehicleRoutingAlgorithm algorithm = algorithmBuilder.buildAlgorithm();
VehicleRoutingProblemSolution s = Solutions.bestOf(algorithm.searchSolutions());
SolutionPrinter.print(vrp, s, SolutionPrinter.Print.CONCISE);
test results: