Class EnergyDistributionHeuristic<S extends AnnealingSolution<S>>

java.lang.Object
edu.cnu.mdi.sim.simanneal.heuristics.EnergyDistributionHeuristic<S>
Type Parameters:
S - the concrete solution type for the annealing problem
All Implemented Interfaces:
TemperatureHeuristic<S>

public class EnergyDistributionHeuristic<S extends AnnealingSolution<S>> extends Object implements TemperatureHeuristic<S>
Estimates an initial temperature for simulated annealing by sampling the distribution of energies from random solutions.

This heuristic draws a number of independent random solutions from the AnnealingProblem, computes their energies, and uses robust statistics to estimate a characteristic energy scale ΔE. The initial temperature T0 is then chosen so that a typical uphill move of size ΔE would be accepted with a specified probability p:

     p ≈ exp(-ΔE / T0)  ⇒  T0 = -ΔE / ln(p)
 

Robust statistics

Rather than relying on the mean and standard deviation (which can be highly sensitive to outliers), this heuristic uses:

  • Median of the sampled energies as a location estimate
  • Median Absolute Deviation (MAD) as a robust scale estimate

The MAD is converted to a "sigma-like" scale using the standard normal consistency factor 1.4826. If the energy landscape is effectively flat (MAD ≈ 0), the heuristic falls back to an interquartile-range-based estimate.

Intended use

This heuristic is designed to be used during simulation initialization to automatically choose a reasonable starting temperature without manual tuning. It is problem-agnostic and works well for a wide range of combinatorial and continuous optimization problems.

  • Constructor Details

    • EnergyDistributionHeuristic

      public EnergyDistributionHeuristic(int samples, double targetAcceptance, double minT0)
      Construct a new energy-distribution-based temperature heuristic.
      Parameters:
      samples - number of random solutions to sample (must be ≥ 10)
      targetAcceptance - desired acceptance probability for a typical uphill move (must lie strictly in (0,1))
      minT0 - minimum allowed initial temperature (non-negative)
      Throws:
      IllegalArgumentException - if samples < 10 or targetAcceptance ∉ (0,1)
  • Method Details