Class PositionBasedRegretInsertion
java.lang.Object
com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
com.graphhopper.jsprit.core.algorithm.recreate.PositionBasedRegretInsertion
- All Implemented Interfaces:
InsertionStrategy
Position-based regret insertion strategy.
Unlike route-based regret which considers only the best insertion per route, position-based regret considers ALL feasible insertion positions across all routes. This approach was ranked #1 in Voigt et al. 2025 meta-analysis of LNS operators.
The key difference from RegretInsertionFast:
- Route-based: compares best positions across routes (one position per route)
- Position-based: compares individual positions across all routes (many positions per route)
This typically yields better solution quality at the cost of more computation, as it has finer granularity for the regret calculation.
- Author:
- schroeder
-
Nested Class Summary
Nested classes/interfaces inherited from class com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
AbstractInsertionStrategy.Insertion -
Field Summary
Fields inherited from class com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
NO_NEW_DEPARTURE_TIME_YET, NO_NEW_DRIVER_YET, NO_NEW_VEHICLE_YET, random, vrp -
Constructor Summary
ConstructorsConstructorDescriptionPositionBasedRegretInsertion(JobInsertionCostsCalculator jobInsertionCalculator, VehicleRoutingProblem vehicleRoutingProblem) -
Method Summary
Modifier and TypeMethodDescriptioninsertUnassignedJobs(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs) voidsetK(int k) Sets the number of positions to consider for regret calculation.voidsetScoringFunction(RegretKScoringFunction scoringFunction) Sets the scoring function for regret calculation.toString()Methods inherited from class com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
addListener, getListeners, insertJob, insertJobs, markUnassigned, removeListener, setRandom
-
Constructor Details
-
PositionBasedRegretInsertion
public PositionBasedRegretInsertion(JobInsertionCostsCalculator jobInsertionCalculator, VehicleRoutingProblem vehicleRoutingProblem)
-
-
Method Details
-
setK
public void setK(int k) Sets the number of positions to consider for regret calculation.- Parameters:
k- number of positions (-1 or Integer.MAX_VALUE for all)
-
setScoringFunction
Sets the scoring function for regret calculation.- Parameters:
scoringFunction- the scoring function
-
toString
-
insertUnassignedJobs
public Collection<Job> insertUnassignedJobs(Collection<VehicleRoute> routes, Collection<Job> unassignedJobs) - Specified by:
insertUnassignedJobsin classAbstractInsertionStrategy
-