Skip to content

Conversation

diluculo
Copy link
Contributor

@diluculo diluculo commented Apr 3, 2025

This PR adds both a new unified interface for least squares minimization and a Basin Hopping implementation for global optimization.

ILeastSquaresMinimizer Interface

First, this PR introduces a standardized interface for nonlinear least squares minimization algorithms:

  • Added new ILeastSquaresMinimizer interface
  • Defined two overloads of the FindMinimum method:
    • One accepting a Vector<double> parameter
    • One accepting a double[] parameter
  • Updated LevenbergMarquardtMinimizer and TrustRegionMinimizerBase to implement this interface

Basin Hopping Implementation

Building on this interface, the PR adds a Basin Hopping algorithm for global optimization. Basin hopping is a stochastic algorithm that efficiently finds global minima in complex energy landscapes by combining random Monte Carlo steps with local optimization (Wikipedia).

Key features:

  • Implements both ILeastSquaresMinimizer and IUnconstrainedMinimizer interfaces
  • Allows using any local minimizer for basin refinement:
    • For least squares problems: LevenbergMarquardtMinimizer, TrustRegionDogLegMinimizer, TrustRegionNewtonCGMinimizer
    • For unconstrained optimization: BfgsMinimizer, LimitedMemoryBfgsMinimizer, ConjugateGradientMinimizer, NewtonMinimizer

Note: This PR supersedes PR #1119 which only contained the interface portion of these changes.

- Introduce a unified interface for nonlinear least squares minimization.
- Define two overloads of the FindMinimum method (one accepting a Vector<double> and one accepting a double[]).
- Update LevenbergMarquardtMinimizer and TrustRegionMinimizerBase classes to implement ILeastSquaresMinimizer.
@diluculo diluculo changed the title Add Basin Hopping Global Optimization Algorithm Add Basin Hopping Global Optimization Algorithm with New Least Squares Interface Apr 3, 2025
- Implements the basin-hopping algorithm for global optimization based on the approach in SciPy.
- Basin-hopping combines Monte Carlo random displacement with local minimization to efficiently find global minima in complex energy landscapes.
- Supports both ILeastSquaresMinimizer and IUnconstrainedMinimizer interfaces, allowing for flexibility in choosing local minimization algorithms.
- Depends on PR mathnet#1119 (ILeastSquaresMinimizer interface) which must be merged first.
@diluculo
Copy link
Contributor Author

diluculo commented Apr 6, 2025

Fixed unintended text changes in Builder.cs file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant