Class SelfTuningLam

java.lang.Object
org.cicirello.search.sa.SelfTuningLam
All Implemented Interfaces:
Splittable<AnnealingSchedule>, AnnealingSchedule

public final class SelfTuningLam extends Object implements AnnealingSchedule
This class implements the Self-Tuning Lam annealing schedule, which is an improved variation of the Modified Lam annealing schedule. The original Modified Lam annealing schedule dynamically adjusts simulated annealing's temperature parameter up and down to either decrease or increase the neighbor acceptance rate as necessary to attempt to match a theoretically determined ideal. The Modified Lam annealing schedule is a practical realization of Lam and Delosme's (1988) schedule, refined first by Swartz (1993) and then further by Boyan (1998), and later optimized further by Cicirello (2020). The Modified Lam annealing schedule is, however, somewhat sensitive to the magnitude of cost function differences relative to neighboring solutions. In particular, the temperature can be slow to converge to that needed to achieve the target track of the rate of acceptance. The Self-Tuning Lam schedule is a new variation that uses early samples of the cost function to fine-tune several annealing parameters to almost instantaneously achieve the target rate of acceptance, and to better match it throughout the run. This Self-Tuning Lam schedule is not sensitive to cost function scale, nor to run length.

The Self-Tuning Lam is introduced in the following paper, including detailed description of the algorithm, derivations of the mechanisms used for self-tuning, and experiments across a range of problems demonstrating its ability to consistently and accurately follow Lam and Delosme's idealized rate of neighbor acceptance, independent of run length and cost function scale:

For details of the original Modified Lam, as well as prior optimizations, see the following papers:

  • Vincent A. Cicirello. 2020. Optimizing the Modified Lam Annealing Schedule. Industrial Networks and Intelligent Systems, 7(25): 1-11, Article e1 (December 2020). doi:10.4108/eai.16-12-2020.167653. [PDF] [BIB]
  • Lam, J., and Delosme, J. 1988. Performance of a new annealing schedule. In Proc. 25th ACM/IEEE DAC, 306–311.
  • Swartz, W. P. 1993. Automatic Layout of Analog and Digital Mixed Macro/Standard Cell Integrated Circuits. Ph.D. Dissertation, Yale University.
  • Boyan, J. A. 1998. Learning Evaluation Functions for Global Optimization. Ph.D. Dissertation, Carnegie Mellon University, Pittsburgh, PA.

The Chips-n-Salsa library also includes an implementation of the original Modified Lam schedule that is the result of a direct implementation of Boyan's description of the annealing schedule, in the ModifiedLamOriginal class, as well as Cicirello's Optimized Modified Lam in the ModifiedLam class.

The accept(double, double) methods of this class use the classic, and most common, Boltzmann distribution for determining whether to accept a neighbor.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Default constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    accept(double neighborCost, double currentCost)
    Determine whether or not to accept a neighboring solution based on its cost and the current cost, both passed as parameters.
    void
    init(int maxEvals)
    Perform any initialization necessary for the annealing schedule at to the start of a run of simulated annealing.
    Generates a functionally identical copy of this object, for use in multithreaded implementations of search algorithms.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SelfTuningLam

      public SelfTuningLam()
      Default constructor. The Self-Tuning Lam annealing schedule, unlike other annealing schedules, has no control parameters other than the run length (the maxEvals parameter of the init(int) method), so no parameters need be passed to the constructor.
  • Method Details

    • init

      public void init(int maxEvals)
      Description copied from interface: AnnealingSchedule
      Perform any initialization necessary for the annealing schedule at to the start of a run of simulated annealing. This includes initializing the temperature parameter. This method is called once by implementations of simulated annealing at the start of the run. Implementations of simulated annealing that perform reannealing will also call this once at the start of each reanneal.
      Specified by:
      init in interface AnnealingSchedule
      Parameters:
      maxEvals - The maximum length of the run of simulated annealing about to start. Some annealing schedules depend upon prior knowledge of run length. For those annealing schedules that don't depend upon run length, this parameter is ignored.
    • accept

      public boolean accept(double neighborCost, double currentCost)
      Description copied from interface: AnnealingSchedule
      Determine whether or not to accept a neighboring solution based on its cost and the current cost, both passed as parameters. Lower cost indicates better solution. This method must also update the temperature and any other state data related to the annealing schedule.
      Specified by:
      accept in interface AnnealingSchedule
      Parameters:
      neighborCost - The cost of the neighboring solution under consideration.
      currentCost - The cost of the current solution.
      Returns:
      true if simulated annealing should accept the neighbor, and false otherwise.
    • split

      public SelfTuningLam split()
      Description copied from interface: Splittable
      Generates a functionally identical copy of this object, for use in multithreaded implementations of search algorithms. The state of the object that is returned may or may not be identical to that of the original. Thus, this is a distinct concept from the functionality of the Copyable interface. Classes that implement this interface must ensure that the object returned performs the same functionality, and that it does not share any state data that would be either unsafe or inefficient for concurrent access by multiple threads. The split method is allowed to simply return the this reference, provided that it is both safe and efficient for multiple threads to share a single copy of the Splittable object. The intention is to provide a multithreaded search with the capability to provide spawned threads with their own distinct search operators. Such multithreaded algorithms can call the split method for each thread it spawns to generate a functionally identical copy of the operator, but with independent state.
      Specified by:
      split in interface Splittable<AnnealingSchedule>
      Returns:
      A functionally identical copy of the object, or a reference to this if it is both safe and efficient for multiple threads to share a single instance of this Splittable object.