| Title: | Variable Neighborhood Trust Region Search |
| Version: | 0.3.1 |
| Description: | Implements a variable neighborhood trust region search (VNTRS) algorithm for nonlinear global optimization, based on Bierlaire et al. (2009) "A Heuristic for Nonlinear Global Optimization" <doi:10.1287/ijoc.1090.0343>. The method combines neighborhood exploration with a trust-region framework to search the solution space efficiently. It can terminate a local search early when the iterates converge toward a previously visited local optimum or when further improvement within the current region is unlikely. The algorithm can also be used to identify multiple local optima. |
| URL: | https://loelschlaeger.de/vntrs/ |
| BugReports: | https://github.com/loelschlaeger/vntrs/issues |
| License: | GPL-3 |
| Encoding: | UTF-8 |
| Imports: | checkmate, oeli (≥ 0.7.5), Rcpp |
| LinkingTo: | Rcpp, RcppArmadillo |
| Suggests: | testthat (≥ 3.0.0) |
| Config/testthat/edition: | 3 |
| Config/roxygen2/version: | 8.1.0 |
| NeedsCompilation: | yes |
| Packaged: | 2026-11-27 10:41:45 UTC; loelschlaeger |
| Author: | Lennart Oelschläger
|
| Maintainer: | Lennart Oelschläger <oelschlaeger.lennart@gmail.com> |
| Repository: | CRAN |
| Date/Publication: | 2026-11-27 11:00:02 UTC |
vntrs: Variable Neighborhood Trust Region Search
Description
Implements a variable neighborhood trust region search (VNTRS) algorithm for nonlinear global optimization, based on Bierlaire et al. (2009) "A Heuristic for Nonlinear Global Optimization" doi:10.1287/ijoc.1090.0343. The method combines neighborhood exploration with a trust-region framework to search the solution space efficiently. It can terminate a local search early when the iterates converge toward a previously visited local optimum or when further improvement within the current region is unlikely. The algorithm can also be used to identify multiple local optima.
Author(s)
Maintainer: Lennart Oelschläger oelschlaeger.lennart@gmail.com (ORCID)
Authors:
Lennart Oelschläger oelschlaeger.lennart@gmail.com (ORCID)
See Also
Useful links:
Examples
### Example 1: Rosenbrock function; one global minimum; no local minima
set.seed(1)
rosenbrock <- function(x) 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2
vntrs(f = rosenbrock, npar = 2)
### Example 2: Six-hump camel function; two global minima; four local minima
set.seed(1)
camel <- function(x) {
(4 - 2.1*x[1]^2 + x[1]^4/3) * x[1]^2 + x[1]*x[2] + (-4 + 4*x[2]^2) * x[2]^2
}
vntrs(
f = camel, npar = 2,
lower = c(-3, -2), upper = c(3, 2), # search bounds
collect_all = TRUE, # also collect local optima
neighborhoods = 10 # number of neighborhoods
)
Variable neighborhood trust region search
Description
Run the variable neighborhood trust region search algorithm. Features:
expanding-neighborhood exploration,
local trust-region optimization,
optional parameter bounds,
analytical derivatives are not required,
early stopping of inferior or previously explored search paths,
collection of multiple local optima,
optional time and function-evaluation budgets.
Usage
vntrs(
f,
npar,
lower = NULL,
upper = NULL,
minimize = TRUE,
collect_all = FALSE,
init_runs = 5L,
init_min = -1,
init_max = 1,
init_iterlim = 20L,
neighborhoods = 5L,
neighbors = 5L,
beta = 0.05,
iterlim = 100L,
scale = c("relative", "absolute"),
identical_tolerance = 0.001,
known_optimum_radius = if (scale == "relative") 0.1 else 1,
inferior_tolerance = if (scale == "relative") 1e-06 else 3,
interruption_gradient_tolerance = 0.001,
gradient_tolerance = 1e-06,
time_limit = NULL,
evaluation_limit = NULL,
quiet = TRUE
)
Arguments
f |
[
Missing derivatives are approximated by finite differences. Recommendation: Provide analytical derivatives when available. |
npar |
[ |
lower, upper |
[ |
minimize |
[ |
collect_all |
[ Recommendation: Use |
init_runs |
[ Recommendation: Start with |
init_min, init_max |
[ If a parameter has finite Recommendation: Use |
init_iterlim |
[ Recommendation: Start with |
neighborhoods |
[ Recommendation: Start with |
neighbors |
[ Recommendation: Start with |
beta |
[ This is the weighting rule for Recommendation: Start with |
iterlim |
[ Recommendation: Start with |
scale |
[ Recommendation: Use |
identical_tolerance |
[ Recommendation: Start with |
known_optimum_radius |
[ Recommendation: Use the scale-dependent default ( |
inferior_tolerance |
[
Setting Recommendation: Use the scale-dependent default ( |
interruption_gradient_tolerance |
[ Setting Recommendation: Use |
gradient_tolerance |
[ Here, a component of the projected gradient Recommendation: Start with |
time_limit |
[ |
evaluation_limit |
[ |
quiet |
[ |
Value
A data.frame with one row for each identified optimum, ordered from
best to worst by objective value, or NULL (with a warning) if none
could be determined. The columns are
-
p1, ...,p<npar>for the parameter values, -
valuefor the objective value, and
global, which isTRUEfor the optima with the best objective value among the identified ones (up to a numerical tolerance) andFALSEfor the others.
References
Bierlaire et al. (2009) "A Heuristic for Nonlinear Global Optimization" doi:10.1287/ijoc.1090.0343.
Examples
### Example 1: Rosenbrock function; one global minimum; no local minima
set.seed(1)
rosenbrock <- function(x) 100 * (x[2] - x[1]^2)^2 + (1 - x[1])^2
vntrs(f = rosenbrock, npar = 2)
### Example 2: Six-hump camel function; two global minima; four local minima
set.seed(1)
camel <- function(x) {
(4 - 2.1*x[1]^2 + x[1]^4/3) * x[1]^2 + x[1]*x[2] + (-4 + 4*x[2]^2) * x[2]^2
}
vntrs(
f = camel, npar = 2,
lower = c(-3, -2), upper = c(3, 2), # search bounds
collect_all = TRUE, # also collect local optima
neighborhoods = 10 # number of neighborhoods
)