Class RuinRadialDynamic
java.lang.Object
com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
com.graphhopper.jsprit.core.algorithm.ruin.RuinRadialDynamic
- All Implemented Interfaces:
RuinStrategy
Revised radial ruin strategy that operates on route activities instead of jobs.
Unlike RuinRadial, this strategy:
- Includes jobs without static locations (locationless jobs)
- Uses actual activity locations from routes rather than pre-computed job distances
- Computes distances dynamically at runtime
The trade-off is slightly higher runtime cost O(m·log(k)) vs O(k) per call, where m is the number of activities in routes and k is the number of jobs to remove. For typical VRP sizes, this overhead is negligible.
- Author:
- schroeder
-
Field Summary
Fields inherited from class com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
jobFilter, random, ruinShareFactory, vrp -
Constructor Summary
ConstructorsConstructorDescriptionRuinRadialDynamic(VehicleRoutingProblem vrp, double fraction2beRemoved) Constructs RuinRadialRevised.RuinRadialDynamic(VehicleRoutingProblem vrp, int noJobs2beRemoved) Constructs RuinRadialRevised. -
Method Summary
Modifier and TypeMethodDescriptionruinRoutes(Collection<VehicleRoute> vehicleRoutes) Ruins the collection of vehicleRoutes by removing jobs in spatial proximity.toString()Methods inherited from class com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
addListener, filterJobs, getListeners, getRuinShareFactory, removeJob, removeJob, removeListener, ruin, setJobFilter, setRandom, setRuinShareFactory
-
Constructor Details
-
RuinRadialDynamic
Constructs RuinRadialRevised.- Parameters:
vrp- the vehicle routing problemfraction2beRemoved- the share of jobs to be removed (relative to total jobs in vrp)
-
RuinRadialDynamic
Constructs RuinRadialRevised.- Parameters:
vrp- the vehicle routing problemnoJobs2beRemoved- the number of jobs to be removed
-
-
Method Details
-
toString
-
ruinRoutes
Ruins the collection of vehicleRoutes by removing jobs in spatial proximity.Unlike the original RuinRadial, this method:
- Selects a random activity from routes (not from jobs)
- Finds nearest neighbor activities based on current route locations
- Removes the corresponding jobs from routes
- Specified by:
ruinRoutesin classAbstractRuinStrategy
-