Class GRASPConstructive<M extends Move<S,I>,S extends Solution<S,I>,I extends Instance>

java.lang.Object
es.urjc.etsii.grafo.create.Constructive<S,I>
es.urjc.etsii.grafo.create.Reconstructive<S,I>
es.urjc.etsii.grafo.create.grasp.GRASPConstructive<M,S,I>
Direct Known Subclasses:
GreedyRandomGRASPConstructive, RandomGreedyGRASPConstructive

public abstract class GRASPConstructive<M extends Move<S,I>,S extends Solution<S,I>,I extends Instance> extends Reconstructive<S,I>
  • Field Details

  • Constructor Details

  • Method Details

    • construct

      public S construct(S solution)
      Build a solution. Start with an empty solution, end when the solution is valid.
      Specified by:
      construct in class Constructive<S extends Solution<S,I>,I extends Instance>
      Parameters:
      solution - Empty solution, the result of calling the constructor.
      Returns:
      A valid solution that fulfills all the problem constraints.
    • reconstruct

      public S reconstruct(S solution)
      Rebuild a partially assigned / partially destroyed solution
      Specified by:
      reconstruct in class Reconstructive<S extends Solution<S,I>,I extends Instance>
      Parameters:
      solution - solution partially built
      Returns:
      valid solution completely built
    • assignMissing

      public S assignMissing(S solution)
      Assign missing elements to solution. This method ends when the candidate list is empty. The difference between this method and construct is that this method does not call beforeGRASP(). This method can be used in algorithms such as iterated greedy during the reconstruction phase.
      Parameters:
      solution - Solution to complete
      Returns:
      Completed solution.
    • getCandidateIndex

      protected abstract int getCandidateIndex(double alpha, List<M> cl)
      Get candidate using any strategy
      Parameters:
      alpha - alpha value
      cl - candidate list
      Returns:
      candidate index