4
$\begingroup$

There's more than 20 functions having to do with minimization

MinMax, ConstrainedMin, NMinimize, NArgMin, FindMinimumCut, 
NMinValue, MinLimit, Minimize, DiscreteMinLimit, MinValue, ArgMin, 
FindMinimum, BooleanMinterms, FindMinValue, RankedMin, FindArgMin, 
MinimalBy, Min, BooleanMinimize, BayesianMinimization, MinDate

What is each of them for? Are there patterns to help remember them?

$\endgroup$

1 Answer 1

5
$\begingroup$

Looking at Names["*Min*"], we find all functions that involve "Min" in their name.

function minimization

These symbols have to do with finding local and global minima for functions (i.e. $f:\mathbb R\to\mathbb R$)

FindArgMin,   NArgMin,   ArgMin,   (*gives argument(s) of minimum*)
FindMinimum,  NMinimize, Minimize, (*gives list(s) {arg,value}*)
FindMinValue, NMinValue, MinValue  (*gives value(s) of minimum*)

The middle row is all that really matters

  • Find*Min is numerical, and iteratively steps toward a local min from a starting point.
  • N*Min is semi-numerical, and looks for a global min.
  • The right column finds exact non-numerical minima, unless it can't in which case it actually calls the numerical ones.

discrete minimization

  • Min gives the smallest value of a list
  • RankedMin gives the $n$th smallest value of a list
  • MinimalBy allows the use of a function to evaluate smallness. Since different elements could evaluate to the same number, it returns all minimal elements instead of just one

There are other functions that have to do with minimizing on different pieces of data, like booleans, graphs, colors, dates, sequences, etc.

For each of the functions, there's a maximization counterpart (except MinMax which is just {Min@#,Max@#}&).

The functions aren't named perfectly: Minimize being related to MinValue but not to Min is annoying.

$\endgroup$
1
  • 1
    $\begingroup$ Pretty good synopsis. One thing to note: the exact functions will not invoke numeric counterparts unless the input contains approximate values. $\endgroup$ Commented Mar 25, 2022 at 14:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.