There are also the undocumented, internal functions:
Optimization`FindMinimax
Optimization`FindMaximin
Optimization`NMinimax
Optimization`NMaximin
A typical call has the form
Optimization`FindMinimax[{f, cons}, vars, opts]
where f
is a vector of objective functions. The call is translated to a call of the form
optimizer[{z, And @@ Flatten[{cons}, 1] && And @@ Thread[r[z, f]]}, vars, opts]
where optimizer
is either FindMinimum
, FindMaximum
, NMinimize
, or NMaximize
, respectively. Essentially, then, this implements the same approach as @Niki.
@Niki's first example:
Optimization`FindMinimax[{{Sin[x], Cos[x]}, {}}, {x}]
(* {0.707107, {x -> 0.785398}} *)
My example doesn't give a good result, even with a pretty good starting point. It gives a minimum of 1344.09
with starting values of {{x, 5}, {y, 2}}
. The "InteriorPoint"
method gives a better result, a minimum of 43.1525
with automatically chosen starting points and good minimum with the starting point of {5, 2}
:
Optimization`FindMinimax[{{Max[{Abs[2 x^2 + y^2 - 48 x - 40 y + 304],
Abs[-x^2 - 3 y^2], Abs[x + 3 y - 18], Abs[-x - y],
Abs[x + y - 8]}]},
{}},
{{x, 5}, {y, 2}}, Method -> "InteriorPoint"]
(* {37.2375, {x -> 4.92671, y -> 2.07865}} *)
Using the global optimizer NMinimize
works a bit better:
Optimization`NMinimax[{{Max[{Abs[2 x^2 + y^2 - 48 x - 40 y + 304],
Abs[-x^2 - 3 y^2], Abs[x + 3 y - 18], Abs[-x - y],
Abs[x + y - 8]}]},
{}},
{x, y}]
(* {37.239, {x -> 4.92601, y -> 2.07954}} *)
The method "DifferentialEvolution"
is slightly faster (1.35 sec. vs. 1.6 sec):
Optimization`NMinimax[{{Max[{Abs[2 x^2 + y^2 - 48 x - 40 y + 304],
Abs[-x^2 - 3 y^2], Abs[x + 3 y - 18], Abs[-x - y],
Abs[x + y - 8]}]},
{}},
{x, y},
Method -> "DifferentialEvolution"]
(* {37.239, {x -> 4.92601, y -> 2.07954}} *)
y
in Matlab'sfminimax
has to be finite. So this min-max-problem can be formulated as a convention optimization problem. Things become significantly harder ify
varies over a continuous range. $\endgroup$f
happen to be concave iny
? In that case you can use the KKT conditions (iny
) as constraints for the optimization problem inx
. Otherwise, this might be a very, very hard optimization problem. $\endgroup$