Class RuinRadialDynamic

java.lang.Object
com.graphhopper.jsprit.core.algorithm.ruin.AbstractRuinStrategy
com.graphhopper.jsprit.core.algorithm.ruin.RuinRadialDynamic
All Implemented Interfaces:
RuinStrategy

public final class RuinRadialDynamic extends AbstractRuinStrategy
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
  • Constructor Details

    • RuinRadialDynamic

      public RuinRadialDynamic(VehicleRoutingProblem vrp, double fraction2beRemoved)
      Constructs RuinRadialRevised.
      Parameters:
      vrp - the vehicle routing problem
      fraction2beRemoved - the share of jobs to be removed (relative to total jobs in vrp)
    • RuinRadialDynamic

      public RuinRadialDynamic(VehicleRoutingProblem vrp, int noJobs2beRemoved)
      Constructs RuinRadialRevised.
      Parameters:
      vrp - the vehicle routing problem
      noJobs2beRemoved - the number of jobs to be removed
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • ruinRoutes

      public Collection<Job> ruinRoutes(Collection<VehicleRoute> vehicleRoutes)
      Ruins the collection of vehicleRoutes by removing jobs in spatial proximity.

      Unlike the original RuinRadial, this method:

      1. Selects a random activity from routes (not from jobs)
      2. Finds nearest neighbor activities based on current route locations
      3. Removes the corresponding jobs from routes
      This approach naturally includes locationless jobs since their activities have locations assigned when inserted into routes.
      Specified by:
      ruinRoutes in class AbstractRuinStrategy