#global-optimization #optimization #numerical-optimization #science #nonlinear-equations

gomez

Framework and implementation for mathematical optimization and solving non-linear systems of equations

9 unstable releases (4 breaking)

0.5.0 Nov 22, 2023
0.4.1 May 15, 2023
0.3.2 Apr 28, 2023
0.3.1 May 8, 2022
0.1.0 Dec 20, 2021

#1147 in Math

Download history 6/week @ 2024-07-19 13/week @ 2024-07-26 16/week @ 2024-08-02 3/week @ 2024-08-09 52/week @ 2024-08-23 47/week @ 2024-08-30 3/week @ 2024-09-06 31/week @ 2024-09-20 23/week @ 2024-09-27 12/week @ 2024-10-04 13/week @ 2024-10-11 79/week @ 2024-10-18 23/week @ 2024-10-25 103/week @ 2024-11-01

219 downloads per month

MIT license

175KB
3.5K SLoC

gomez

Build License Cargo Documentation

gomez is a framework and implementation for mathematical optimization and solving non-linear systems of equations.

The library is written completely in Rust. Its focus is on being useful for practical problems and having API that is simple for easy cases as well as flexible for complicated ones. The name stands for global optimization & non-linear equations solving, with a few typos.

Practical problems

The main goal is to be useful for practical problems. This is manifested by the following features:

  • Derivative-free. No algorithm requires an analytical derivative (gradient, Hessian, Jacobian). Methods that use derivatives approximate it using finite difference method1.
  • Constraints support. It is possible to specify the problem domain with constraints2, which is necessary for many engineering applications.
  • Non-naive implementations. The code is not a direct translation of a textbook pseudocode. It's written with performance in mind and applies important techniques from numerical mathematics. It also tries to handle situations that hurt the methods but occur in practice.

1 There is a plan to provide ways to override this approximation with a real derivative.

2 Currently, only unconstrained and box-bounded domains are supported.

Algorithms

  • Trust region – Recommended method to be used as a default and it will just work in most cases.
  • LIPO – Global optimization algorithm useful for searching good initial guesses in combination with a numerical algorithm.
  • Steffensen – Fast and lightweight method for solving one-dimensional systems of equations.
  • Nelder-Mead – Direct search optimization method that does not use any derivatives.

This list will be extended in the future. But at the same time, having as many algorithms as possible is not the goal. Instead, the focus is on providing quality implementations of battle-tested methods.

Roadmap

Listed not in priority order.

  • Homotopy continuation method to compare the performance with the trust region method
  • Conjugate gradient method
  • Experimentation with various global optimization techniques for initial guess search
    • Evolutionary/nature-inspired algorithms
    • Bayesian optimization
  • Focus on initial guesses search and tools for analysis in general

License

Licensed under MIT.

There are gsl-wrapper and gsl-sys crates which are licensed under the GPLv3 identically as GSL itself. This code is part of the repository but is not part of the gomez library. Its purpose is solely for comparison in the benchmarks.

Dependencies

~3.5MB
~77K SLoC