Skip to content
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

Clarification of potential bug in ISRES implementation #590

Open
kramawa opened this issue Feb 13, 2025 · 3 comments
Open

Clarification of potential bug in ISRES implementation #590

kramawa opened this issue Feb 13, 2025 · 3 comments

Comments

@kramawa
Copy link

kramawa commented Feb 13, 2025

In the referenced paper, the ISRES algorithm contains the following line for differential variation of the best $k < \mu$:

$x_k' \gets x_i + \gamma (x_1 - x_{i+1})$

In the corresponding code this is stated as

xs[rk*n+j] += GAMMA * (x0[j] - xs[(k+1)*n+j])

where int rk = irank[k];

Since xs[rk*n+j] references similarly $x_k'$ and $x_i$, shouldn't for referencing $x_{i+1}$ instead of xs[(k+1)*n+j],
the following be used: xs[irank[k+1]*n+j]?

My current understanding is that xs[(k+1)*n+j] just references the point with index $k+1$ in the population set, but which is - from my understanding of the algorithm at this point - not necessarily the ranked point $x_{i+1}$ that should be actually accessed.

Full affected line can be found here:

xs[rk*n+j] += GAMMA * (x0[j] - xs[(k+1)*n+j]);

Would appreciate any comments or clarifications regarding this matter.

@stevengj
Copy link
Owner

I haven't looked at this code for years, but it's possible you are right. Can you try the modified version on a test problem?

@kramawa
Copy link
Author

kramawa commented Feb 14, 2025

I just tried both versions with the test-tool (testopt) on all objective functions with seed equaling to $1$ and with $300000$ evaluations.

There is for some values a slight difference, the biggest one is at Shekel m=5 function, where the modified algorithm seems to have the more precise value.

Here is the output with the current version of ISRES:

-----------------------------------------------------------
Optimizing Rosenbrock function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -2 -2]
upper bounds at ub = [ 2 2]
Starting guess x = [ -0.165956 0.440649]
Starting function value = 18.4252
finished after 0.046917 seconds.
return code 5 from nlopt_minimize
Found minimum f = 0 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 1]
|f - minf| = 0
vs. global minimum f = 0 at x = [ 1 1]
-----------------------------------------------------------
Optimizing McCormic function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -1.5 -3]
upper bounds at ub = [ 4 4]
Starting guess x = [ 1.02181 1.27114]
Starting function value = 3.45767
finished after 0.051592 seconds.
return code 5 from nlopt_minimize
Found minimum f = -1.91322 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -0.547198 -1.5472]
|f - minf| = 4.98104e-09, |f - minf| / |minf| = 2.603479e-09
vs. global minimum f = -1.91322 at x = [ -0.547198 -1.5472]
-----------------------------------------------------------
Optimizing Box and Betts exponential quadratic sum (3 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0.9 9 0.9]
upper bounds at ub = [ 1.2 11.2 1.2]
Starting guess x = [ 1.03755 10.3424 0.975017]
Starting function value = 0.00122421
finished after 0.098883 seconds.
return code 5 from nlopt_minimize
Found minimum f = 0 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 10 1]
|f - minf| = 0
vs. global minimum f = 0 at x = [ 1 10 1]
-----------------------------------------------------------
Optimizing Paviani function (10 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 2.001 2.001 2.001 2.001 2.001 2.001 2.001 2.001 2.001 2.001]
upper bounds at ub = [ 9.999 9.999 9.999 9.999 9.999 9.999 9.999 9.999 9.999 9.999]
Starting guess x = [ 5.66817 6.88108 4.00096 5.20953 4.58738 4.36976 4.74535 5.3824 5.58717 6.15523]
Starting function value = 10.9262
finished after 0.189978 seconds.
return code 5 from nlopt_minimize
Found minimum f = -45.7785 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027]
|f - minf| = 7.44631e-09, |f - minf| / |minf| = 1.626597e-10
vs. global minimum f = -45.7785 at x = [ 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027]
-----------------------------------------------------------
Optimizing Generalized Rosenbrock function (30 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30]
upper bounds at ub = [ 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30]
Starting guess x = [ -2.48934 6.60973 -14.9966 -5.93002 -10.5973 -12.2298 -9.41219 -4.63318 -3.09698 1.1645 -2.42416 5.55659 -8.86643 11.3435 -14.1784 5.11403 -2.48086 1.76069 -10.7884 -9.05696 9.02234 14.0478 -5.59727 5.76968 11.2917 11.8382 -12.4487 -13.8284 -9.90509 11.3443]
Starting function value = 3.55995e+07
finished after 0.473126 seconds.
return code 5 from nlopt_minimize
Found minimum f = 29.0893 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 0.293901 0.083745 0.0292208 -0.0241097 0.0457075 0.00271288 0.0136066 0.0329111 0.00186233 0.0179083 0.0127778 -0.00600684 0.0406652 0.00304871 -0.00947953 0.00840274 0.0211317 0.0478192 0.000118107 -0.00820445 0.0229245 0.0303591 0.0424255 -0.000709953 0.0458232 0.0281055 0.0134992 0.0246513 0.0134011 -0.00294885]
|f - minf| = 29.0893
vs. global minimum f = 0 at x = [ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
-----------------------------------------------------------
Optimizing Goldstein and Price function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -2 -2]
upper bounds at ub = [ 2 2]
Starting guess x = [ -0.165956 0.440649]
Starting function value = 4523.99
finished after 0.051598 seconds.
return code 5 from nlopt_minimize
Found minimum f = 3 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1.07396e-09 -1]
|f - minf| = 9.59233e-14, |f - minf| / |minf| = 3.197442e-14
vs. global minimum f = 3 at x = [ 0 -1]
-----------------------------------------------------------
Optimizing Shekel m=5 function (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ 4.58511 6.10162 2.50057 4.01166]
Starting function value = -0.308018
finished after 0.080257 seconds.
return code 5 from nlopt_minimize
Found minimum f = -3.84957 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 3.92292 3.79056 4.19722 4.2863]
|f - minf| = 6.30363, |f - minf| / |minf| = 6.208516e-01
vs. global minimum f = -10.1532 at x = [ 4.00004 4.00013 4.00004 4.00013]
-----------------------------------------------------------
Optimizing Shekel m=7 function (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ 4.58511 6.10162 2.50057 4.01166]
Starting function value = -0.670516
finished after 0.084586 seconds.
return code 5 from nlopt_minimize
Found minimum f = -10.4029 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 4.00057 4.00069 3.99949 3.99961]
|f - minf| = 3.18133e-09, |f - minf| / |minf| = 3.058111e-10
vs. global minimum f = -10.4029 at x = [ 4.00057 4.00069 3.99949 3.99961]
-----------------------------------------------------------
Optimizing Shekel m=10 function (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ 4.58511 6.10162 2.50057 4.01166]
Starting function value = -0.741761
finished after 0.079244 seconds.
return code 5 from nlopt_minimize
Found minimum f = -10.5364 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 4.00075 4.00059 3.99966 3.99951]
|f - minf| = 3.30795e-09, |f - minf| / |minf| = 3.139541e-10
vs. global minimum f = -10.5364 at x = [ 4.00075 4.00059 3.99966 3.99951]
-----------------------------------------------------------
Optimizing Levy n=4 function (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -10 -10 -10 -10]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ -0.82978 2.20324 -4.99886 -1.97667]
Starting function value = 43.4181
finished after 0.089601 seconds.
return code 5 from nlopt_minimize
Found minimum f = -21.5024 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 1 1 -9.75236]
|f - minf| = 2.38633e-09, |f - minf| / |minf| = 1.109797e-10
vs. global minimum f = -21.5024 at x = [ 1 1 1 -9.75236]
-----------------------------------------------------------
Optimizing Levy n=5 function (5 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -5 -5 -5 -5 -5]
upper bounds at ub = [ 5 5 5 5 5]
Starting guess x = [ -0.41489 1.10162 -2.49943 -0.988337 -1.76622]
Starting function value = 17.2599
finished after 0.096389 seconds.
return code 5 from nlopt_minimize
Found minimum f = -11.5044 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 1 1 1 -4.7544]
|f - minf| = 1.37622e-09, |f - minf| / |minf| = 1.196257e-10
vs. global minimum f = -11.5044 at x = [ 1 1 1 1 -4.7544]
-----------------------------------------------------------
Optimizing Levy n=6 function (6 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -5 -5 -5 -5 -5 -5]
upper bounds at ub = [ 5 5 5 5 5 5]
Starting guess x = [ -0.41489 1.10162 -2.49943 -0.988337 -1.76622 -2.03831]
Starting function value = 28.1595
finished after 0.117763 seconds.
return code 5 from nlopt_minimize
Found minimum f = -11.5044 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 1 1 1 1 -4.7544]
|f - minf| = 1.37622e-09, |f - minf| / |minf| = 1.196257e-10
vs. global minimum f = -11.5044 at x = [ 1 1 1 1 1 -4.7544]
-----------------------------------------------------------
Optimizing Levy n=7 function (7 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -5 -5 -5 -5 -5 -5 -5]
upper bounds at ub = [ 5 5 5 5 5 5 5]
Starting guess x = [ -0.41489 1.10162 -2.49943 -0.988337 -1.76622 -2.03831 -1.5687]
Starting function value = 43.4563
finished after 0.133465 seconds.
return code 5 from nlopt_minimize
Found minimum f = -11.5044 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 1 1 1 1 1 -4.7544]
|f - minf| = 1.37622e-09, |f - minf| / |minf| = 1.196257e-10
vs. global minimum f = -11.5044 at x = [ 1 1 1 1 1 1 -4.7544]
-----------------------------------------------------------
Optimizing Griewank function (10 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -500 -500 -500 -500 -500 -500 -500 -500 -500 -500]
upper bounds at ub = [ 600 600 600 600 600 600 600 600 600 600]
Starting guess x = [ 4.3621 171.178 -224.937 -58.7171 -144.284 -174.214 -122.557 -34.9416 -6.77789 71.3492]
Starting function value = 39.978
finished after 0.182145 seconds.
return code 5 from nlopt_minimize
Found minimum f = 0.027037 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -2.52187e-09 4.43844 6.06611e-09 6.65291e-10 1.2603e-08 -5.43648e-09 1.16176e-09 9.84502e-10 9.38255 1.26715e-09]
|f - minf| = 0.027037
vs. global minimum f = 0 at x = [ 0 0 0 0 0 0 0 0 0 0]
-----------------------------------------------------------
Optimizing Six-hump camel back function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -5 -5]
upper bounds at ub = [ 5 5]
Starting guess x = [ -0.41489 1.10162]
Starting function value = 1.2077
finished after 0.10642 seconds.
return code 5 from nlopt_minimize
Found minimum f = -1.03163 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 0.089842 -0.712656]
|f - minf| = 4.89878e-10, |f - minf| / |minf| = 4.748589e-10
vs. global minimum f = -1.03163 at x = [ 0.089842 -0.712656]
-----------------------------------------------------------
Optimizing Convex product of cosh functions (10 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -1 0 0 0 0 0 0 0 0 0]
upper bounds at ub = [ 2 3 6 7 8 10 11 13 14 16]
Starting guess x = [ 0.375533 1.83049 1.50034 2.80816 2.58702 2.96169 3.77443 5.49614 6.27737 8.31053]
Starting function value = 1.75958e+29
finished after 0.184133 seconds.
return code 5 from nlopt_minimize
Found minimum f = 1 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -1.87084e-09 1 2 3 4 5 6 7 8 9]
|f - minf| = 0, |f - minf| / |minf| = 0.000000e+00
vs. global minimum f = 1 at x = [ 0 1 2 3 4 5 6 7 8 9]
-----------------------------------------------------------
Optimizing Branin function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -10 -10]
upper bounds at ub = [ 10 10]
Starting guess x = [ -0.82978 2.20324]
Starting function value = 9.61175
finished after 0.048849 seconds.
return code 5 from nlopt_minimize
Found minimum f = 3.08149e-33 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 0.148696 0.402086]
|f - minf| = 3.08149e-33
vs. global minimum f = -0 at x = [ 1 0]
-----------------------------------------------------------
Optimizing Shubert function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -10 -10]
upper bounds at ub = [ 10 10]
Starting guess x = [ -0.82978 2.20324]
Starting function value = 4.74089
finished after 0.07388 seconds.
return code 5 from nlopt_minimize
Found minimum f = -24.0625 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -6.77458 -6.77458]
|f - minf| = 4.33429e-09, |f - minf| / |minf| = 1.801265e-10
vs. global minimum f = -24.0625 at x = [ -6.77458 -6.77458]
-----------------------------------------------------------
Optimizing Hansen function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -10 -10]
upper bounds at ub = [ 10 10]
Starting guess x = [ -0.82978 2.20324]
Starting function value = 4.09728
finished after 0.062086 seconds.
return code 5 from nlopt_minimize
Found minimum f = -176.542 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -1.30671 -7.70831]
|f - minf| = 4.57305e-11, |f - minf| / |minf| = 2.590352e-13
vs. global minimum f = -176.542 at x = [ -1.30671 -1.42513]
-----------------------------------------------------------
Optimizing 1d oscillating function with a single minimum (1 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -5]
upper bounds at ub = [ 5]
Starting guess x = [ -0.41489]
Starting function value = 0.926593
finished after 0.032019 seconds.
return code 5 from nlopt_minimize
Found minimum f = -1 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1.23457]
|f - minf| = 0, |f - minf| / |minf| = 0.000000e+00
vs. global minimum f = -1 at x = [ 1.23457]
-----------------------------------------------------------
Optimizing 4d function with minimum at corner (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 1 1 1 1]
Starting guess x = [ 0.458511 0.610162 0.250057 0.401166]
Starting function value = 3.48162
finished after 0.087994 seconds.
return code 5 from nlopt_minimize
Found minimum f = 1 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 2.61998e-09 3.00523e-17 8.03991e-16 2.42016e-16]
|f - minf| = 0, |f - minf| / |minf| = 0.000000e+00
vs. global minimum f = 1 at x = [ 0 0 0 0]
-----------------------------------------------------------
Optimizing 4d function with minimum at side (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0.1 -1 -1 -1]
upper bounds at ub = [ 1 1 1 1]
Starting guess x = [ 0.51266 0.220324 -0.499886 -0.197667]
Starting function value = -23.7322
finished after 0.080519 seconds.
return code 5 from nlopt_minimize
Found minimum f = -141.285 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 0.1 0.102971 0.0760521 -0.0497099]
|f - minf| = 4.78678e-10, |f - minf| / |minf| = 3.388034e-12
vs. global minimum f = -141.285 at x = [ 0.1 0.102971 0.0760521 -0.0497099]

And here is the output with my proposed modification. For convenience I added an additional printf-statement to the ISRES implementation.

-----------------------------------------------------------
Optimizing Rosenbrock function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -2 -2]
upper bounds at ub = [ 2 2]
Starting guess x = [ -0.165956 0.440649]
Starting function value = 18.4252
ISRES: Using updated version of indeces.
finished after 0.049579 seconds.
return code 5 from nlopt_minimize
Found minimum f = 0 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 1]
|f - minf| = 0
vs. global minimum f = 0 at x = [ 1 1]
-----------------------------------------------------------
Optimizing McCormic function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -1.5 -3]
upper bounds at ub = [ 4 4]
Starting guess x = [ 1.02181 1.27114]
Starting function value = 3.45767
ISRES: Using updated version of indeces.
finished after 0.048238 seconds.
return code 5 from nlopt_minimize
Found minimum f = -1.91322 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -0.547198 -1.5472]
|f - minf| = 4.98104e-09, |f - minf| / |minf| = 2.603479e-09
vs. global minimum f = -1.91322 at x = [ -0.547198 -1.5472]
-----------------------------------------------------------
Optimizing Box and Betts exponential quadratic sum (3 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0.9 9 0.9]
upper bounds at ub = [ 1.2 11.2 1.2]
Starting guess x = [ 1.03755 10.3424 0.975017]
Starting function value = 0.00122421
ISRES: Using updated version of indeces.
finished after 0.097927 seconds.
return code 5 from nlopt_minimize
Found minimum f = 0 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 10 1]
|f - minf| = 0
vs. global minimum f = 0 at x = [ 1 10 1]
-----------------------------------------------------------
Optimizing Paviani function (10 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 2.001 2.001 2.001 2.001 2.001 2.001 2.001 2.001 2.001 2.001]
upper bounds at ub = [ 9.999 9.999 9.999 9.999 9.999 9.999 9.999 9.999 9.999 9.999]
Starting guess x = [ 5.66817 6.88108 4.00096 5.20953 4.58738 4.36976 4.74535 5.3824 5.58717 6.15523]
Starting function value = 10.9262
ISRES: Using updated version of indeces.
finished after 0.193015 seconds.
return code 5 from nlopt_minimize
Found minimum f = -45.7785 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027]
|f - minf| = 7.44631e-09, |f - minf| / |minf| = 1.626597e-10
vs. global minimum f = -45.7785 at x = [ 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027 9.35027]
-----------------------------------------------------------
Optimizing Generalized Rosenbrock function (30 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30 -30]
upper bounds at ub = [ 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30 30]
Starting guess x = [ -2.48934 6.60973 -14.9966 -5.93002 -10.5973 -12.2298 -9.41219 -4.63318 -3.09698 1.1645 -2.42416 5.55659 -8.86643 11.3435 -14.1784 5.11403 -2.48086 1.76069 -10.7884 -9.05696 9.02234 14.0478 -5.59727 5.76968 11.2917 11.8382 -12.4487 -13.8284 -9.90509 11.3443]
Starting function value = 3.55995e+07
ISRES: Using updated version of indeces.
finished after 0.481741 seconds.
return code 5 from nlopt_minimize
Found minimum f = 29.3491 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 0.297308 0.0717253 -0.00478655 0.0281387 0.00109478 -0.0375167 -0.0151316 -0.0149271 0.0078109 0.0164012 0.0069337 0.0192961 -0.00895776 -0.00961966 0.0601332 0.0494229 0.023024 0.00305588 -0.00634535 0.000961425 0.0109218 0.00334781 -0.00145413 0.00868089 0.000194466 -0.00382627 0.0255585 -0.00421487 0.0108357 -0.0447896]
|f - minf| = 29.3491
vs. global minimum f = 0 at x = [ 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1]
-----------------------------------------------------------
Optimizing Goldstein and Price function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -2 -2]
upper bounds at ub = [ 2 2]
Starting guess x = [ -0.165956 0.440649]
Starting function value = 4523.99
ISRES: Using updated version of indeces.
finished after 0.050635 seconds.
return code 5 from nlopt_minimize
Found minimum f = 3 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -1.07475e-09 -1]
|f - minf| = 9.59233e-14, |f - minf| / |minf| = 3.197442e-14
vs. global minimum f = 3 at x = [ 0 -1]
-----------------------------------------------------------
Optimizing Shekel m=5 function (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ 4.58511 6.10162 2.50057 4.01166]
Starting function value = -0.308018
ISRES: Using updated version of indeces.
finished after 0.081207 seconds.
return code 5 from nlopt_minimize
Found minimum f = -10.1532 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 4.00004 4.00013 4.00004 4.00013]
|f - minf| = 9.41769e-10, |f - minf| / |minf| = 9.275592e-11
vs. global minimum f = -10.1532 at x = [ 4.00004 4.00013 4.00004 4.00013]
-----------------------------------------------------------
Optimizing Shekel m=7 function (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ 4.58511 6.10162 2.50057 4.01166]
Starting function value = -0.670516
ISRES: Using updated version of indeces.
finished after 0.083889 seconds.
return code 5 from nlopt_minimize
Found minimum f = -10.4029 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 4.00057 4.00069 3.99949 3.99961]
|f - minf| = 3.18133e-09, |f - minf| / |minf| = 3.058111e-10
vs. global minimum f = -10.4029 at x = [ 4.00057 4.00069 3.99949 3.99961]
-----------------------------------------------------------
Optimizing Shekel m=10 function (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ 4.58511 6.10162 2.50057 4.01166]
Starting function value = -0.741761
ISRES: Using updated version of indeces.
finished after 0.082556 seconds.
return code 5 from nlopt_minimize
Found minimum f = -10.5364 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 4.00075 4.00059 3.99966 3.99951]
|f - minf| = 3.30795e-09, |f - minf| / |minf| = 3.139541e-10
vs. global minimum f = -10.5364 at x = [ 4.00075 4.00059 3.99966 3.99951]
-----------------------------------------------------------
Optimizing Levy n=4 function (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -10 -10 -10 -10]
upper bounds at ub = [ 10 10 10 10]
Starting guess x = [ -0.82978 2.20324 -4.99886 -1.97667]
Starting function value = 43.4181
ISRES: Using updated version of indeces.
finished after 0.093282 seconds.
return code 5 from nlopt_minimize
Found minimum f = -21.5024 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 1 1 -9.75236]
|f - minf| = 2.38633e-09, |f - minf| / |minf| = 1.109797e-10
vs. global minimum f = -21.5024 at x = [ 1 1 1 -9.75236]
-----------------------------------------------------------
Optimizing Levy n=5 function (5 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -5 -5 -5 -5 -5]
upper bounds at ub = [ 5 5 5 5 5]
Starting guess x = [ -0.41489 1.10162 -2.49943 -0.988337 -1.76622]
Starting function value = 17.2599
ISRES: Using updated version of indeces.
finished after 0.097082 seconds.
return code 5 from nlopt_minimize
Found minimum f = -11.5044 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 1 1 1 -4.7544]
|f - minf| = 1.37622e-09, |f - minf| / |minf| = 1.196257e-10
vs. global minimum f = -11.5044 at x = [ 1 1 1 1 -4.7544]
-----------------------------------------------------------
Optimizing Levy n=6 function (6 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -5 -5 -5 -5 -5 -5]
upper bounds at ub = [ 5 5 5 5 5 5]
Starting guess x = [ -0.41489 1.10162 -2.49943 -0.988337 -1.76622 -2.03831]
Starting function value = 28.1595
ISRES: Using updated version of indeces.
finished after 0.120365 seconds.
return code 5 from nlopt_minimize
Found minimum f = -11.5044 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 1 1 1 1 -4.7544]
|f - minf| = 1.37622e-09, |f - minf| / |minf| = 1.196257e-10
vs. global minimum f = -11.5044 at x = [ 1 1 1 1 1 -4.7544]
-----------------------------------------------------------
Optimizing Levy n=7 function (7 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -5 -5 -5 -5 -5 -5 -5]
upper bounds at ub = [ 5 5 5 5 5 5 5]
Starting guess x = [ -0.41489 1.10162 -2.49943 -0.988337 -1.76622 -2.03831 -1.5687]
Starting function value = 43.4563
ISRES: Using updated version of indeces.
finished after 0.186066 seconds.
return code 5 from nlopt_minimize
Found minimum f = -11.5044 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1 1 1 1 1 1 -4.7544]
|f - minf| = 1.37622e-09, |f - minf| / |minf| = 1.196257e-10
vs. global minimum f = -11.5044 at x = [ 1 1 1 1 1 1 -4.7544]
-----------------------------------------------------------
Optimizing Griewank function (10 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -500 -500 -500 -500 -500 -500 -500 -500 -500 -500]
upper bounds at ub = [ 600 600 600 600 600 600 600 600 600 600]
Starting guess x = [ 4.3621 171.178 -224.937 -58.7171 -144.284 -174.214 -122.557 -34.9416 -6.77789 71.3492]
Starting function value = 39.978
ISRES: Using updated version of indeces.
finished after 0.197683 seconds.
return code 5 from nlopt_minimize
Found minimum f = 0.0664047 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -3.14002 4.43844 -5.43325 6.27064 -2.49705e-09 -3.20354e-09 1.33174e-08 8.85036 -9.38255 -1.56563e-08]
|f - minf| = 0.0664047
vs. global minimum f = 0 at x = [ 0 0 0 0 0 0 0 0 0 0]
-----------------------------------------------------------
Optimizing Six-hump camel back function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -5 -5]
upper bounds at ub = [ 5 5]
Starting guess x = [ -0.41489 1.10162]
Starting function value = 1.2077
ISRES: Using updated version of indeces.
finished after 0.052905 seconds.
return code 5 from nlopt_minimize
Found minimum f = -1.03163 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -0.089842 0.712656]
|f - minf| = 4.89878e-10, |f - minf| / |minf| = 4.748589e-10
vs. global minimum f = -1.03163 at x = [ 0.089842 -0.712656]
-----------------------------------------------------------
Optimizing Convex product of cosh functions (10 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -1 0 0 0 0 0 0 0 0 0]
upper bounds at ub = [ 2 3 6 7 8 10 11 13 14 16]
Starting guess x = [ 0.375533 1.83049 1.50034 2.80816 2.58702 2.96169 3.77443 5.49614 6.27737 8.31053]
Starting function value = 1.75958e+29
ISRES: Using updated version of indeces.
finished after 0.213436 seconds.
return code 5 from nlopt_minimize
Found minimum f = 1 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -5.96653e-09 1 2 3 4 5 6 7 8 9]
|f - minf| = 0, |f - minf| / |minf| = 0.000000e+00
vs. global minimum f = 1 at x = [ 0 1 2 3 4 5 6 7 8 9]
-----------------------------------------------------------
Optimizing Branin function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -10 -10]
upper bounds at ub = [ 10 10]
Starting guess x = [ -0.82978 2.20324]
Starting function value = 9.61175
ISRES: Using updated version of indeces.
finished after 0.051607 seconds.
return code 5 from nlopt_minimize
Found minimum f = 3.08149e-33 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 0.148696 0.402086]
|f - minf| = 3.08149e-33
vs. global minimum f = -0 at x = [ 1 0]
-----------------------------------------------------------
Optimizing Shubert function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -10 -10]
upper bounds at ub = [ 10 10]
Starting guess x = [ -0.82978 2.20324]
Starting function value = 4.74089
ISRES: Using updated version of indeces.
finished after 0.067208 seconds.
return code 5 from nlopt_minimize
Found minimum f = -24.0625 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -0.491391 -6.77458]
|f - minf| = 4.33429e-09, |f - minf| / |minf| = 1.801263e-10
vs. global minimum f = -24.0625 at x = [ -6.77458 -6.77458]
-----------------------------------------------------------
Optimizing Hansen function (2 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -10 -10]
upper bounds at ub = [ 10 10]
Starting guess x = [ -0.82978 2.20324]
Starting function value = 4.09728
ISRES: Using updated version of indeces.
finished after 0.067565 seconds.
return code 5 from nlopt_minimize
Found minimum f = -176.542 after 300000 evaluations (numevals = 300000).
Minimum at x = [ -7.58989 -1.42513]
|f - minf| = 4.57021e-11, |f - minf| / |minf| = 2.588742e-13
vs. global minimum f = -176.542 at x = [ -1.30671 -1.42513]
-----------------------------------------------------------
Optimizing 1d oscillating function with a single minimum (1 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ -5]
upper bounds at ub = [ 5]
Starting guess x = [ -0.41489]
Starting function value = 0.926593
ISRES: Using updated version of indeces.
finished after 0.034017 seconds.
return code 5 from nlopt_minimize
Found minimum f = -1 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 1.23457]
|f - minf| = 0, |f - minf| / |minf| = 0.000000e+00
vs. global minimum f = -1 at x = [ 1.23457]
-----------------------------------------------------------
Optimizing 4d function with minimum at corner (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0 0 0 0]
upper bounds at ub = [ 1 1 1 1]
Starting guess x = [ 0.458511 0.610162 0.250057 0.401166]
Starting function value = 3.48162
ISRES: Using updated version of indeces.
finished after 0.089929 seconds.
return code 5 from nlopt_minimize
Found minimum f = 1 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 3.11425e-09 3.91903e-16 1.69425e-16 3.77083e-16]
|f - minf| = 0, |f - minf| / |minf| = 0.000000e+00
vs. global minimum f = 1 at x = [ 0 0 0 0]
-----------------------------------------------------------
Optimizing 4d function with minimum at side (4 dims) using ISRES evolutionary constrained optimization (global, no-derivative) algorithm
lower bounds at lb = [ 0.1 -1 -1 -1]
upper bounds at ub = [ 1 1 1 1]
Starting guess x = [ 0.51266 0.220324 -0.499886 -0.197667]
Starting function value = -23.7322
ISRES: Using updated version of indeces.
finished after 0.091347 seconds.
return code 5 from nlopt_minimize
Found minimum f = -141.285 after 300000 evaluations (numevals = 300000).
Minimum at x = [ 0.1 0.102971 0.0760521 -0.0497099]
|f - minf| = 4.78678e-10, |f - minf| / |minf| = 3.388034e-12
vs. global minimum f = -141.285 at x = [ 0.1 0.102971 0.0760521 -0.0497099]

What is your opinion about that?

@stevengj
Copy link
Owner

stevengj commented Feb 16, 2025

What stopping criteria are you using? I would use something like -m 1e-2 so that it stops when it is within 0.01 of the optimum, and check how many iterations this took.

It would be good to try it on a problem with a nonlinear constraint, e.g. https://github.com/stevengj/nlopt/blob/master/test/t_tutorial.cxx (probably after #591 is merged so that you can see the evaluation count).

Update: I tried the old and new versions of isres.c with t_tutorial.cxx, after merging the PR, above. Running it 1000 times and collecting the evaluation counts with repeat 1000 test/t_tutorial 35 |cut -d' ' -f18, I got a median of 14618 iterations for the old version and 15237 iterations for the new version (the std. dev was about ±3000 iterations for both, but the difference is larger than stddev/sqrt(1000) so it seems significant). So it's certainly not an obvious improvement, and may even be worse.

(As I said, I don't remember this code very well; I'd have to go back and read it and the paper carefully to be sure what was intended here.)

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

No branches or pull requests

2 participants