Very long-running optimization job

Hi all.
I’m trying to run a problem that has 1323 jobs and 18 vehicles.
As you can see in these log lines

INFO  [2019-06-19 15:36:54,133] com.graphhopper.jsprit.core.problem.VehicleRoutingProblem: setup problem: [fleetSize=FINITE][#jobs=1323][#vehicles=18][#vehicleTypes=12][transportCost=CostMatrixFactory$FastVehicleRoutingTransportCost
INFO  [2019-06-19 15:36:54,523] SolverManager: Problem e135fee6-235e-432d-a96e-afc07c19d50c: [fleetSize=FINITE][#jobs=1323][#vehicles=18][#vehicleTypes=12][transportCost=CostMatrixFactory$FastVehicleRoutingTr
INFO  [2019-06-19 15:36:54,523] com.graphhopper.jsprit.core.algorithm.VehicleRoutingAlgorithm: algorithm starts: [maxIterations=1024]
INFO  [2019-06-19 15:36:54,524] com.graphhopper.jsprit.core.algorithm.InsertionInitialSolutionFactory: create initial solution

It started to create the initial solution yesterday, and it’s not done yet (over 24hs later). It’s running on 4 CPUs with the following parameters

			algorithmBuilder.setProperty(Parameter.ITERATIONS, "1024");
			algorithmBuilder.setProperty(Parameter.FAST_REGRET, "true");
			algorithmBuilder.setProperty(Parameter.THREADS, "4");

The jobs have no dependencies among them, so I think fast regret is fine. I added a run-time-based PrematureAlgorithmTermination but since that is evaluated between iterations, and it’s still running the first iteration, it’s never finishing.

I’m not sure why it’s taking SO long.

Any ideas on what I might need to tweak to make it faster?


1 Like

@stefan, @karussell, do you know of anything I could try?

Use bestinsertion for construction. It will be much faster in this case.

Thanks! I will try that!

It is faster, but looking at the code I noticed it still has a lot of serial code, so the speedup is limited. Or am I missing something?

Can you please explain how to create the bestinsertion?

algorithmBuilder.setProperty(Parameter.CONSTRUCTION, Construction.BEST_INSERTION.toString());

Can you please explain, how BEST_INSERTION parameter works and in the which case need to use it?