Class BestInsertion
java.lang.Object
com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
com.graphhopper.jsprit.core.algorithm.recreate.BestInsertion
- All Implemented Interfaces:
InsertionStrategy
Sequential insertion that processes jobs in random order, inserting each at its best position.
Note: Despite the name, this is NOT "Best Insertion" as defined in VRP literature. This implementation:
- Shuffles jobs randomly
- Sorts by priority
- For each job in this order, inserts it at the position with minimum additional cost
For true Best Insertion (Cheapest Insertion) as defined in literature, where the globally
cheapest (job, position) pair is selected at each iteration, use CheapestInsertion.
- Author:
- stefan schroeder
- See Also:
-
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
ConstructorsConstructorDescriptionBestInsertion(JobInsertionCostsCalculator jobInsertionCalculator, VehicleRoutingProblem vehicleRoutingProblem) -
Method Summary
Modifier and TypeMethodDescriptioninsertUnassignedJobs(Collection<VehicleRoute> vehicleRoutes, Collection<Job> unassignedJobs) toString()Methods inherited from class com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
addListener, getListeners, insertJob, insertJobs, markUnassigned, removeListener, setRandom
-
Constructor Details
-
BestInsertion
public BestInsertion(JobInsertionCostsCalculator jobInsertionCalculator, VehicleRoutingProblem vehicleRoutingProblem)
-
-
Method Details
-
toString
-
insertUnassignedJobs
public Collection<Job> insertUnassignedJobs(Collection<VehicleRoute> vehicleRoutes, Collection<Job> unassignedJobs) - Specified by:
insertUnassignedJobsin classAbstractInsertionStrategy
-