Class CheapestInsertion
java.lang.Object
com.graphhopper.jsprit.core.algorithm.recreate.AbstractInsertionStrategy
com.graphhopper.jsprit.core.algorithm.recreate.CheapestInsertion
- All Implemented Interfaces:
InsertionStrategy
True Best Insertion (Cheapest Insertion) as defined in VRP literature.
This algorithm repeatedly:
- Evaluates ALL unassigned jobs at ALL possible positions
- Selects the (job, position) pair with the globally minimum insertion cost
- Inserts that job
- Repeats until all jobs are inserted or no feasible insertion exists
This differs from BestInsertion which processes jobs in random order,
inserting each at its best position (Sequential/Random Order Insertion).
Time complexity: O(J² × R × P) where J = jobs, R = routes, P = positions per route. This is more expensive than random order insertion but typically produces better solutions.
- 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
ConstructorsConstructorDescriptionCheapestInsertion(JobInsertionCostsCalculator insertionCostsCalculator, VehicleRoutingProblem vrp) -
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
-
CheapestInsertion
public CheapestInsertion(JobInsertionCostsCalculator insertionCostsCalculator, VehicleRoutingProblem vrp)
-
-
Method Details
-
toString
-
insertUnassignedJobs
public Collection<Job> insertUnassignedJobs(Collection<VehicleRoute> vehicleRoutes, Collection<Job> unassignedJobs) - Specified by:
insertUnassignedJobsin classAbstractInsertionStrategy
-