What is a good optimization algorithm for a binary constraints function?
Mostrar comentarios más antiguos
I'm using fmincon at the moment but one of the equality constraints functions that I have can only output a logical array. This means that fmincon cannot know in which direction to continue its search (right?) so I often get an infeasible point as a result. My question is whether there's an interesting MATLAB algorithm that can deal with this type of nonlinear optimization. Global optimization toolbox perhaps?
To visualize, I'm looking for a solution of n points that each contain 3 variables, so the solution is n by 3 and the logical array is n x 1, indicating whether the solution is possible at all. If any of the logicals is true, the solution is useless. I have no knowledge at all of this constraints function so I cannot adjust the upper/lower bound meaningfully.
4 comentarios
Matt J
el 4 de Nov. de 2021
ga and surrogateopt in the Global Optimization Toolbox support integer (and therefore also binary) constraints. However, it would probably be advisable to show us a more detailed problem description. I've never heard of a case where the output (not the inputs) of a constraint function needed to be integer-valued.
Walter Roberson
el 4 de Nov. de 2021
In my youth, I sometimes wrote constraint functions that returned logicals, not having understood that the information returned by the constraint functions was used to locate the boundary better.
Daniele Sonaglioni
el 4 de Nov. de 2021
You can try to use Global Search with fmincon as routine and put all your constraints inside GlobalSearch. I think that this is a very good way to deal with your problem.
Alternatively, you can use the genetic algorithm which works very well.
Steven H
el 5 de Nov. de 2021
Respuestas (0)
Categorías
Más información sobre Surrogate Optimization en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!