Class EnergyDistributionHeuristic<S extends AnnealingSolution<S>>
- Type Parameters:
S- the concrete solution type for the annealing problem
- All Implemented Interfaces:
TemperatureHeuristic<S>
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 Summary
ConstructorsConstructorDescriptionEnergyDistributionHeuristic(int samples, double targetAcceptance, double minT0) Construct a new energy-distribution-based temperature heuristic. -
Method Summary
Modifier and TypeMethodDescriptionestimate(AnnealingProblem<S> problem, Random rng) Estimate an initial temperature by sampling the energy distribution of random solutions.
-
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- ifsamples < 10ortargetAcceptance ∉ (0,1)
-
-
Method Details
-
estimate
Estimate an initial temperature by sampling the energy distribution of random solutions.- Specified by:
estimatein interfaceTemperatureHeuristic<S extends AnnealingSolution<S>>- Parameters:
problem- the annealing problem providing random solutions and an energy functionrng- source of randomness- Returns:
- an
InitialTemperaturerecord containing the estimated temperature and diagnostic statistics (median, MAD, sample count)
-