Heuristic Search for Global Optimization #
This file provides heuristic search methods using fast floating-point arithmetic to find good candidate points for global optimization. These candidates are used to initialize rigorous branch-and-bound algorithms with tight upper bounds, enabling early pruning of the search space.
Main definitions #
FloatBox- Float representation of a Box for fast samplingPRNG- Simple pseudo-random number generatorsamplePoint- Generate a random point inside a boxfindBestCandidate- Monte Carlo search for minimumgridSearch- Uniform grid sampling
Design notes #
The heuristic results are NOT verified. They are used only to guide the search:
- Find a candidate point with low objective value
- Certify this point using rigorous interval arithmetic
- Use the certified upper bound to prune the branch-and-bound tree
This "oracle-guided" approach can prune 90%+ of the search space on typical problems.
Rational to Float conversion #
Convert a rational to a Float (approximate)
Equations
Instances For
Float representation of boxes #
Equations
Equations
- One or more equations did not get rendered due to their size.
Instances For
Convert a rational Box to float representation
Equations
- One or more equations did not get rendered due to their size.
Instances For
Pseudo-Random Number Generator #
Simple Linear Congruential Generator (LCG) for reproducible randomness. Parameters from Numerical Recipes: a = 1664525, c = 1013904223, m = 2³²
- state : UInt64
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Create a PRNG with given seed
Equations
- LeanCert.Engine.Search.PRNG.new seed = { state := seed.toUInt64 }
Instances For
Generate next random number in [0, 1) and updated PRNG
Equations
Instances For
Equations
- LeanCert.Engine.Search.PRNG.nextN.loop 0 acc r = (acc, r)
- LeanCert.Engine.Search.PRNG.nextN.loop k.succ acc r = match r.next with | (v, r') => LeanCert.Engine.Search.PRNG.nextN.loop k (acc.push v) r'
Instances For
Sampling methods #
Generate n random points inside a float box
Equations
- LeanCert.Engine.Search.samplePoints fb rng n = LeanCert.Engine.Search.samplePoints.loop fb n #[] rng
Instances For
Equations
- LeanCert.Engine.Search.samplePoints.loop fb 0 acc r = (acc, r)
- LeanCert.Engine.Search.samplePoints.loop fb k.succ acc r = match LeanCert.Engine.Search.samplePoint fb r with | (pt, r') => LeanCert.Engine.Search.samplePoints.loop fb k (acc.push pt) r'
Instances For
Monte Carlo Minimization #
Heuristic Minimizer using Monte Carlo sampling.
Samples n points using Float arithmetic and returns the best candidate found.
This is surprisingly effective for finding the "basin of attraction" of the global minimum, especially in high dimensions where grid search is infeasible.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- LeanCert.Engine.Search.findBestCandidate.loop e fb 0 rng bestVal bestPt = (bestPt, bestVal)
Instances For
Find multiple good candidates (for multi-start local search). Returns the k best distinct points found during sampling.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- One or more equations did not get rendered due to their size.
- LeanCert.Engine.Search.findTopCandidates.collectSamples e fb 0 rng acc = acc
Instances For
Grid Search #
Uniform grid search over a box.
Samples a regular grid with pointsPerDim points along each dimension.
Total samples = pointsPerDim^dim, so use sparingly for high dimensions.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Combined Strategy #
Hybrid search combining grid and Monte Carlo. First does a coarse grid search, then refines around the best point with Monte Carlo.
Equations
- One or more equations did not get rendered due to their size.