Symmetry in an Optimization - fmincon

4 views (last 30 days)
John R.
John R. on 23 Mar 2016
Answered: Walter Roberson on 23 Mar 2016
I am running an fmincon optimization where sometimes multiple variables can have the same effect on the objective function. As a result, the optimizer doesn't prefer one variable over the other and can find multiple solutions all with the same objective value. Sometimes this will result in an exitflag of 2.
This can cause it to "switch" between values as the optimization is run over and over again. This is not necessarily a problem, but rather an annoyance and does not realistically represent the physical system that optimization is attempting to model.
My question is, is there a way to "detect" that this kind of symmetry exists in the problem?
My problem is quite complex and uses linear equality constraints and both linear and nonlinear inequality constraints. And 'x' can be anywhere from a few values to several dozen.
Thank you for you time.

Answers (1)

Walter Roberson
Walter Roberson on 23 Mar 2016
In the situation where the calculation is all by formula and no "if" or logical indexing, then if you have the symbolic toolbox, you can call the objective function with different orders of symbols and see if you get the same output. The outputs might not be in identical order, so subtract the two prospective outputs and see if the result is 0.
If f(x,y,z) has output equivalent to f(x,z,y) for symbolic x, y, z then the function is symmetric around y vs z.

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!