-
Notifications
You must be signed in to change notification settings - Fork 138
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
equal constraints #8
Comments
Not directly, no. Equality constraints are inherently difficult to satisfy in optimization routines because the basically force your solution to lie on an infinitely thin line, which, especially for algorithms like PSO, is really hard to land on and stay on by simply guessing values for the input. A better approach, if possible, is to refactor your objective code to use the equality constraint as a driving calculation that helps determine the objective value. That way, you are guaranteed to satisfy the constraint at all times. In other words, if you have the constraint ab = c-d and the objective function uses d as an input, then I would change it so that d is calculated, rather than guessed: d = c-(ab) |
Another option, if you aren't able to refactor your code, would be to use a tolerance band around the equality constraint |
thanks tisimst , very detailed and clear answer. |
That makes sense. In that case, I'd start with a generous tolerance and see if you can fine-tune it to something more narrow. |
Hi there, I've tried to find a way to define some equal constraints but didn't find one, is there a way to do that?
The text was updated successfully, but these errors were encountered: