Skip to content

Resolves #587 - Implement the Shubert-Piyavskii method for minimization #588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Luis-Varona
Copy link

The Shubert-Piyavskii method optimizes a univariate, Lipschitz continuous function inside a specified interval. Given an accurate Lipschitz constant, it is guaranteed to come within an arbitrary epsilon of the true global minimum. Unlike most other deterministic global optimizations algorithm (e.g., golden-section search), it is not restricted to unimodal functions; moreover, it does not require an initial guess. It deterministically samples points from ever-narrowing subintervals of the search space until the sampled best point is sufficiently close to the lower bound given by the Lipschitz constant.

I have added an implementation of an SP solver in crates/argmin/src/solver/shubertpiyavskii/, modifying crates/argmin/src/lib.rs and crates/argmin/src/solver/mod.rs accordingly. Additionally, I have added an example run of the solver to examples/shubertpiyavskii/.

@Luis-Varona
Copy link
Author

Just added a minor bugfix to one of the doctests (didn't affect the actual implementation, though)--squashed into the same commit to avoid clutter.

@codecov-commenter
Copy link

codecov-commenter commented Apr 20, 2025

Codecov Report

Attention: Patch coverage is 95.47414% with 21 lines in your changes missing coverage. Please review.

Project coverage is 92.17%. Comparing base (b35808a) to head (5d75b8d).

Files with missing lines Patch % Lines
crates/argmin/src/solver/shubertpiyavskii/mod.rs 95.47% 21 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #588      +/-   ##
==========================================
+ Coverage   92.13%   92.17%   +0.04%     
==========================================
  Files         177      178       +1     
  Lines       23672    24139     +467     
==========================================
+ Hits        21810    22250     +440     
- Misses       1862     1889      +27     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Luis-Varona Luis-Varona force-pushed the 587-shubertpiyavskii branch from 90d8204 to c99ead9 Compare April 20, 2025 21:17
@Luis-Varona
Copy link
Author

Luis-Varona commented Apr 20, 2025

One last bugfix--a spelling correction ("arbitraily" -> "arbitrarily") in the examples file and making the PartialOrd impl for SearchInterval more idiomatic in the main solver implementation. Should pass all CI tests now! 🙂

@Luis-Varona Luis-Varona force-pushed the 587-shubertpiyavskii branch from c99ead9 to 4bf9bf2 Compare April 20, 2025 21:21
The Shubert-Piyavskii method optimizes a univariate, Lipschitz continuous function inside a specified interval. Given an accurate Lipschitz constant, it is guaranteed to come within an arbitrary epsilon of the true global minimum. Unlike most other deterministic global optimizations algorithm (e.g., golden-section search), it is not restricted to unimodal functions; moreover, it does not require an initial guess. It deterministically samples points from ever-narrowing subintervals of the search space until the sampled best point is sufficiently close to the lower bound given by the Lipschitz constant.

I have added an implementation of an SP solver in crates/argmin/src/solver/shubertpiyavskii/, modifying crates/argmin/src/lib.rs and crates/argmin/src/solver/mod.rs accordingly. Additionally, I have added an example run of the solver to examples/shubertpiyavskii/.
@Luis-Varona Luis-Varona force-pushed the 587-shubertpiyavskii branch from 4bf9bf2 to 5d75b8d Compare April 21, 2025 07:21
@Luis-Varona
Copy link
Author

Luis-Varona commented Apr 21, 2025

One last fix; code and doctests were all working, but clippy got mad at something non-idiomatic in a match branch, hehe. Now it should be 100% ready, pending your approval @stefan-k :) (No rush!)

@Luis-Varona
Copy link
Author

Hi @stefan-k! Definitely no rush, but I just wanted to ask if you still planned to get around to reviewing this at some point in the future (doesn't matter when!) 🙂 I also plan to make a PR sometime soon for Differential Evolution as per my conversation with @steinhauserc in #499, if you think that's a good idea.

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.

2 participants