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

[Bug report] Optimal solution is slightly infeasible #2098

Closed
paulduf opened this issue Apr 11, 2022 · 7 comments
Closed

[Bug report] Optimal solution is slightly infeasible #2098

paulduf opened this issue Apr 11, 2022 · 7 comments
Labels

Comments

@paulduf
Copy link
Collaborator

paulduf commented Apr 11, 2022

Describe the bug

The optima solution obtained with the (hidden) method problem._best_parameter for problem f18 in 20-D has some very small positive value for some constraints. This prevents the triggering of the final target (and maybe some others) when evaluating what is supposed to be a reference for the global optimum.

Your System (please complete the following information when it seems relevant):

  • Operating system: Ubuntu 18.04
  • COCO version: 2.6.2

Minimal Reproducible Example

import cocoex
import numpy as np
suite = cocoex.Suite("bbob-constrained", "", "")
problem = suite.get_problem_by_function_dimension_instance(18, 20, 1)
problem._best_parameter('print')
_xopt = np.loadtxt('._bbob_problem_best_parameter.txt')
problem(_xopt)
problem.final_target_hit
max(problem.constraint(_xopt))

Outputs:

0
1.5969018398508795e-13
@paulduf paulduf added the bug label Apr 11, 2022
@nikohansen
Copy link
Contributor

nikohansen commented Apr 15, 2022

It looks like subtracting 1e-12 from the constraint values solves the issue on all (first) 15 function instances in all dimensions. This should have practically no influence on the performance evaluation. In the construction, constraints are multiplied by up to about 1e5.
EDIT: it should be 1e-11 and I am not sure why the multiplier is relevant.

@paulduf
Copy link
Collaborator Author

paulduf commented Apr 19, 2022

Related plot: CDF of max(g-values) over the first 100 instances of all problems in all dimensions (on a symlog scale).

CDF of max g values

@nikohansen
Copy link
Contributor

nikohansen commented Apr 21, 2022

I thought changing the 0.0 in this line https://github.com/numbbo/coco/blob/master/code-experiments/src/c_linear.c#L75 to -1e-11 should do the trick, but it seems like this code has no effect at all.

nikohansen added a commit that referenced this issue Apr 21, 2022
@nikohansen
Copy link
Contributor

nikohansen commented Apr 21, 2022

I implemented a different solution 9294678 which does in each coordinate this transformation
Screen Shot 2022-04-21 at 21 02 51
and returns exactly zero in the above example. The distribution of the maximal constraint in the optimum over all instances looks like
Screen Shot 2022-04-21 at 20 47 49
and the maximal value is zero.

A condition of x[i] > 1e-12 instead of > 1e-11 gives a maximum constraint violation of 6.83612196645526e-12.

nikohansen added a commit that referenced this issue Apr 22, 2022
@nikohansen
Copy link
Contributor

@paulduf, @brockho how do we check that 9294678 doesn't break the regression test for the testbed?

@brockho
Copy link
Contributor

brockho commented Apr 22, 2022

python do.py test-suites should do what you want, shouldn't it? The documentation says "Runs regression test on all benchmark suites".

@nikohansen
Copy link
Contributor

nikohansen commented Apr 23, 2022

The regression test passes. It tests like np.abs(x - y) < 1e-9, so 1e-11 should not matter even when we test this very position.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants