Skip to content

Trust Region Method ​

Classical

Trust Region optimization algorithm.

Algorithm Overview ​

This module implements Trust Region optimization algorithms. Trust region methods are a class of optimization algorithms that work by defining a region around the current point where a model (usually quadratic) of the objective function is trusted to be accurate. The algorithm finds the step that minimizes the model within this trust region.

Trust region methods have several advantages:

  • They are globally convergent under reasonable assumptions
  • They automatically adapt the step size based on the quality of the model
  • They handle ill-conditioned problems better than line search methods
  • They are robust to numerical difficulties

This implementation provides access to scipy's trust region methods including:

  • trust-constr: Trust region method with constraints
  • trust-exact: Trust region method with exact Hessian
  • trust-krylov: Trust region method using Krylov subspace

Usage ​

python
from opt.classical.trust_region import TrustRegion
from opt.benchmark.functions import sphere

optimizer = TrustRegion(
    func=sphere,
    lower_bound=-5.12,
    upper_bound=5.12,
    dim=10,
    max_iter=500,
)

best_solution, best_fitness = optimizer.search()
print(f"Best solution: {best_solution}")
print(f"Best fitness: {best_fitness:.6e}")

Parameters ​

ParameterTypeDefaultDescription
funcCallableRequiredObjective function to minimize.
lower_boundfloatRequiredLower bound of search space.
upper_boundfloatRequiredUpper bound of search space.
dimintRequiredProblem dimensionality.
max_iterint1000Maximum iterations per restart.
num_restartsint10Number of random restarts.
methodstr'trust-constr'Trust region variant ('trust-constr', 'trust-exact', 'trust-krylov').
seedint | NoneNoneRandom seed for BBOB reproducibility.

Algorithm Metadata ​

PropertyValue
Algorithm NameTrust Region Method
AcronymTR
Year Introduced1983
AuthorsPowell, M. J. D.; Conn, A. R.; et al.
Algorithm ClassClassical
ComplexityO(n³) per iteration (subproblem solve)
PropertiesAdaptive, Gradient-based
ImplementationPython 3.10+
COCO CompatibleYes

Mathematical Formulation ​

Trust region subproblem at iteration k :

minsmk(s)=fk+gkTs+12sTBks

subject to: ∥s∥≤Δk (trust region radius)

where:

  • fk=f(xk) is current function value
  • gk=∇f(xk) is gradient
  • Bk approximates Hessian
  • Δk is trust region radius (adaptive)

Radius update based on agreement ratio:

ρk=f(xk)−f(xk+sk)mk(0)−mk(sk)

Constraint handling:

  • Boundary conditions: Native bound constraints (trust-constr variant)
  • Feasibility enforcement: During subproblem solve

Hyperparameters ​

ParameterDefaultBBOB RecommendedDescription
max_iter100010000Maximum iterations
num_restarts2510-50Number of random restarts

Sensitivity Analysis:

  • num_restarts: High impact on global optimization
  • Initial radius: Medium (automatically adapted)
  • Recommended: multiple restarts for non-convex problems

COCO/BBOB Benchmark Settings ​

Search Space:

  • Dimensions tested: 2, 3, 5, 10, 20, 40
  • Bounds: Function-specific (typically [-5, 5] or [-100, 100])
  • Instances: 15 per function (BBOB standard)

Evaluation Budget:

  • Budget: dim×10000 function evaluations
  • Independent runs: 15 (for statistical significance)
  • Seeds: 0-14 (reproducibility requirement)

Performance Metrics:

  • Target precision: 1e-8 (BBOB default)
  • Success rate at precision thresholds: [1e-8, 1e-6, 1e-4, 1e-2]
  • Expected Running Time (ERT) tracking

Raises ​

ValueError: If search space is invalid or function evaluation fails.

Notes ​

  • Modifies self.history if track_history=True
  • Uses self.seed for all random number generation
  • BBOB: Returns final best solution after max_iter or convergence

Computational Complexity:

  • Time per iteration: O(n3) for subproblem solve
  • Space complexity: O(n2)
  • BBOB budget usage: 15-40% of dim×10000

BBOB Performance Characteristics:

  • Best function classes: Smooth, Ill-conditioned
  • Weak function classes: Non-smooth, Highly multimodal
  • Success rate at 1e-8: 75-95% (dim=5, smooth)

Convergence Properties:

  • Convergence rate: Superlinear to quadratic near minimum
  • Local vs Global: Local optimizer, multistart for global search
  • Premature convergence risk: Low (adaptive radius prevents divergence)

Reproducibility:

  • Deterministic: Yes (given same seed)
  • BBOB compliance: seed required for 15 runs
  • RNG: numpy.random.default_rng(self.seed)

Known Limitations:

  • Requires gradient computation
  • Cubic subproblem solve expensive for high dimensions
  • Multistart increases function evaluations

Version History:

  • v0.1.0: Initial implementation
  • v0.1.2: COCO/BBOB compliance

References ​

[1] Conn, A. R., Gould, N. I., & Toint, P. L. (2000). "Trust Region Methods." SIAM, Philadelphia. https://doi.org/10.1137/1.9780898719857

[2] Nocedal, J., & Wright, S. J. (2006). "Numerical Optimization" (2nd ed.). Springer, Chapter 4: Trust-Region Methods.

[3] Hansen, N., Auger, A., et al. (2021). "COCO: A platform for comparing continuous optimizers." Optimization Methods and Software, 36(1), 114-144. https://doi.org/10.1080/10556788.2020.1808977

COCO Data Archive:

See Also ​

BFGS: Quasi-Newton with line search instead of trust region BBOB Comparison: Similar performance, TR more robust to ill-conditioning LBFGS: Limited-memory variant with line search BBOB Comparison: TR better on ill-conditioned, L-BFGS better memory scaling

Benchmark Performance ​

Results of the benchmark suite for this optimizer, on the same evaluation budget as every other optimizer and compared with a random search baseline. See the methodology for the protocol and statistics.


Source Code

View the implementation: trust_region.py

Released under the MIT License.