Class RuinKruskalClusters
java.lang.Object
com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
com.graphhopper.jsprit.core.algorithm.ruin.RuinKruskalClusters
- All Implemented Interfaces:
RuinStrategy
Ruin strategy that removes clusters of jobs identified using Kruskal's MST algorithm.
Algorithm: 1. Select target route (random or via job neighborhoods) 2. Build MST of jobs in route using Kruskal's algorithm 3. Cut longest edge to get 2 clusters 4. Remove one cluster 5. Repeat with neighboring routes until q jobs removed
Ranked #2 in Voigt (2025) "A review and ranking of operators in adaptive large neighborhood search for vehicle routing problems."
Advantages over DBSCAN-based clustering: - No parameters to tune (ε, minPts) - Always produces exactly 2 clusters - Never fails (no fallback needed) - Deterministic given the distances
-
Field Summary
Fields inherited from class com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
jobFilter, random, ruinShareFactory -
Constructor Summary
ConstructorsConstructorDescriptionRuinKruskalClusters(VehicleRoutingProblem vrp, int initialNumberJobsToRemove, JobNeighborhoods jobNeighborhoods) -
Method Summary
Modifier and TypeMethodDescriptionruinRoutes(Collection<VehicleRoute> vehicleRoutes) voidsetPreferSmallerCluster(boolean preferSmallerCluster) If true, prefers removing the smaller of the two clusters.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
-
RuinKruskalClusters
public RuinKruskalClusters(VehicleRoutingProblem vrp, int initialNumberJobsToRemove, JobNeighborhoods jobNeighborhoods)
-
-
Method Details
-
setPreferSmallerCluster
public void setPreferSmallerCluster(boolean preferSmallerCluster) If true, prefers removing the smaller of the two clusters. If false, randomly chooses between clusters. -
ruinRoutes
- Specified by:
ruinRoutesin classAbstractRuinStrategy
-
toString
-