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

Equality constraints not handled #27

Open
ras9841 opened this issue Mar 4, 2019 · 1 comment
Open

Equality constraints not handled #27

ras9841 opened this issue Mar 4, 2019 · 1 comment

Comments

@ras9841
Copy link

ras9841 commented Mar 4, 2019

It seems that the equality constraints, referenced in the documentation as eq, are not support. See https://github.com/Stefan-Endres/shgo/blob/master/shgo/_shgo.py#L495.

for cons in constraints:
  if cons['type'] is 'ineq':
    self.g_cons.append(cons['fun'])
    try:
      self.g_args.append(cons['args'])
    except KeyError:
      self.g_args.append(())
self.g_cons = tuple(self.g_cons)
self.g_args = tuple(self.g_args)

If I've missed how to specify, please let me know.

@Stefan-Endres
Copy link
Owner

Stefan-Endres commented May 8, 2019

The equality constraints are not used in the global sampling step of shgo, they are passed to the local solver routine (therefore they will only work if the chosen local minimization algorithm supports equality constraints, the default SLSQP (also the default of scipy.optimize.minimize) does support equality constraints).

If the final solutions of your problem instances are not KKT feasible points I would recommend trying different local solver methods from those available in scipy.optimize.minimize.

Ideally I would like to add methods to shgo reduce the dimensionality of the global problem by handling arbitrary equality constraints (through, for example, the implicit function theorem) since this will drastically speed up the problem and reduce sampling size, however, currently the only way to do this is to reformulate the objective function itself.

(I apologise for the late reply, annoyingly I have not been getting any of my feed notifications from Github lately).

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