WOLFRAM

ArgMin[f,x]

gives a position xmin at which f is minimized.

ArgMin[f,{x,y,}]

gives a position {xmin,ymin,} at which f is minimized.

ArgMin[{f,cons},{x,y,}]

gives a position at which f is minimized subject to the constraints cons.

ArgMin[,xrdom]

constrains x to be in the region or domain rdom.

ArgMin[,,dom]

constrains variables to the domain dom, typically Reals or Integers.

Details and Options

  • ArgMin finds the global minimum of f subject to the constraints given.
  • ArgMin is typically used to find the smallest possible values given constraints. In different areas, this may be called the best strategy, best fit, best configuration and so on.
  • If f and cons are linear or polynomial, ArgMin will always find a global minimum.
  • The constraints cons can be any logical combination of:
  • lhs==rhsequations
    lhs>rhs, lhsrhs, lhs<rhs, lhsrhsinequalities (LessEqual,)
    lhsrhs, lhsrhs, lhsrhs, lhsrhsvector inequalities (VectorLessEqual,)
    Exists[], ForAll[]quantified conditions
    {x,y,}rdomregion or domain specification
  • ArgMin[{f,cons},xrdom] is effectively equivalent to ArgMin[{f,consxrdom},x].
  • For xrdom, the different coordinates can be referred to using Indexed[x,i].
  • Possible domains rdom include:
  • Realsreal scalar variable
    Integersinteger scalar variable
    Vectors[n,dom]vector variable in
    Matrices[{m,n},dom]matrix variable in
    vector variable restricted to the geometric region
  • By default, all variables are assumed to be real.
  • ArgMin will return exact results if given exact input. With approximate input, it automatically calls NArgMin.
  • If the minimum is achieved only infinitesimally outside the region defined by the constraints, or only asymptotically, ArgMin will return the closest specifiable point.
  • Even if the same maximum is achieved at several points, only one is returned.
  • If the constraints cannot be satisfied, ArgMin returns {Indeterminate,Indeterminate,}.
  • N[ArgMin[]] calls NArgMin for optimization problems that cannot be solved symbolically.

Examples

open allclose all

Basic Examples  (5)Summary of the most common use cases

Find a minimizer point for a univariate function:

Out[1]=1

Find a minimizer point for a multivariate function:

Out[1]=1

Find a minimizer point for a function subject to constraints:

Out[1]=1

Find a minimizer point as a function of parameters:

Out[1]=1

Find a minimizer point over a geometric region:

Out[1]=1

Plot it:

Out[2]=2

Scope  (36)Survey of the scope of standard use cases

Basic Uses  (7)

Minimize over the unconstrained reals:

Out[1]=1

If the single variable is not given in a list, the result is a value at which the minimum is attained:

Out[2]=2

Minimize subject to constraints :

Out[1]=1

Constraints may involve arbitrary logical combinations:

Out[1]=1

An unbounded problem:

Out[1]=1

An infeasible problem:

Out[1]=1

The infimum value may not be attained:

Out[1]=1

Use a vector variable and a vector inequality:

Out[1]=1

Univariate Problems  (7)

Unconstrained univariate polynomial minimization:

Out[1]=1

Constrained univariate polynomial minimization:

Out[1]=1

Exp-log functions:

Out[1]=1

Analytic functions over bounded constraints:

Out[1]=1
Out[2]=2
Out[3]=3
Out[4]=4

Periodic functions:

Out[1]=1

Combination of trigonometric functions with commensurable periods:

Out[2]=2

Piecewise functions:

Out[1]=1

Unconstrained problems solvable using function property information:

Out[1]=1
Out[2]=2

Multivariate Problems  (9)

Multivariate linear constrained minimization:

Out[1]=1

Linear-fractional constrained minimization:

Out[1]=1

Unconstrained polynomial minimization:

Out[1]=1

Constrained polynomial optimization can always be solved:

Out[1]=1

The minimum value may not be attained:

Out[2]=2

The objective function may be unbounded:

Out[3]=3

There may be no points satisfying the constraints:

Out[4]=4

Quantified polynomial constraints:

Out[5]=5

Algebraic minimization:

Out[1]=1

Bounded transcendental minimization:

Out[1]=1

Piecewise minimization:

Out[1]=1

Convex minimization:

Out[1]=1

Minimize convex objective function such that is positive semidefinite and :

Out[1]=1

Plot the region and the minimizing point:

Out[2]=2

Parametric Problems  (4)

Parametric linear optimization:

Out[1]=1

Coordinates of the minimizer point are continuous functions of parameters:

Out[2]=2

Parametric quadratic optimization:

Out[1]=1

Coordinates of the minimizer point are continuous functions of parameters:

Out[2]=2

Unconstrained parametric polynomial minimization:

Out[1]=1

Constrained parametric polynomial minimization:

Out[1]=1

Optimization over Integers  (3)

Univariate problems:

Out[1]=1

Integer linear programming:

Out[1]=1

Polynomial minimization over the integers:

Out[1]=1

Optimization over Regions  (6)

Minimize over a region:

Out[2]=2

Plot it:

Out[3]=3

Find the minimum distance between two regions:

Out[2]=2

Plot it:

Out[3]=3

Find the minimum such that the triangle and ellipse still intersect:

Out[2]=2

Plot it:

Out[3]=3

Find the disk of minimum radius that contains the given three points:

Out[2]=2

Plot it:

Out[3]=3

Using Circumsphere gives the same result directly:

Out[4]=4

Use to specify that is a vector in :

Out[2]=2

Find the minimum distance between two regions:

Out[2]=2

Plot it:

Out[3]=3

Options  (1)Common values & functionality for each option

WorkingPrecision  (1)

Finding an exact minimum point can take a long time:

Out[1]=1

With WorkingPrecision->100, you get an approximate minimum point:

Out[2]=2

Applications  (10)Sample problems that can be solved with this function

Basic Applications  (3)

Find the lengths of sides of a unit area rectangle with minimal perimeter:

Out[2]=2

Find the lengths of sides of a unit area triangle with minimal perimeter:

Out[2]=2

The minimal perimeter triangle is equilateral:

Out[3]=3

Find a point on a parabola closest to its axis:

Out[1]=1

Assuming a particular relationship between the and parameters:

Out[2]=2

Geometric Distances  (6)

The point q in a region that is nearest to a given point p is given by ArgMin[Norm[p-q],q]. Find the nearest point in Disk[] to {1,1}:

Out[3]=3

Plot it:

Out[4]=4

Find the nearest point to {1,2} in the standard unit simplex Simplex[2]:

Out[2]=2

Plot it:

Out[3]=3

Find the nearest point to {1,1,1} in the standard unit sphere Sphere[]:

Out[2]=2

Plot it:

Out[3]=3

Find the nearest point to {-1,1,1} in the standard unit simplex Simplex[3]:

Out[2]=2

Plot it:

Out[3]=3

The the nearest points p and q can be found through ArgMin[Norm[p-q],{p,q}]. Find the nearest points in Disk[{0,0}] and Rectangle[{3,3}]:

Out[2]=2

The nearest distance:

Out[3]=3

Plot it:

Out[4]=4

Find the nearest points in Line[{{0,0,0},{1,1,1}}] and Ball[{5,5,0},1]:

Out[2]=2

The nearest distance:

Out[3]=3

Plot it:

Out[4]=4

Geometric Centers  (1)

If n is a region that is full dimensional, then the Chebyshev center is the point p that minimizes SignedRegionDistance[,p], i.e. the negation of the distance to the complement region. Find the Chebyshev center for Disk[]:

Out[2]=2
Out[3]=3

Find the Chebyshev center for Rectangle[]:

Out[5]=5
Out[6]=6

Properties & Relations  (6)Properties of the function, and connections to other functions

Minimize gives both the value of the minimum and the minimizer point:

Out[1]=1

ArgMin gives an exact global minimizer point:

Out[2]=2
Out[3]=3

NArgMin attempts to find a global minimizer point numerically, but may find a local minimizer:

Out[4]=4
Out[5]=5

FindArgMin finds a local minimizer point depending on the starting point:

Out[6]=6
Out[7]=7

The minimum point satisfies the constraints, unless messages say otherwise:

Out[1]=1
Out[2]=2

The given point minimizes the distance from the point {2,}:

Out[3]=3

When the minimum is not attained, ArgMin may give a point on the boundary:

Out[1]=1

Here the objective function tends to the minimum value when y tends to infinity:

Out[2]=2

ArgMin can solve linear optimization problems:

Out[1]=1

LinearOptimization can be used to solve the same problem:

Out[2]=2

Use RegionNearest to compute a nearest point in the given region:

Out[2]=2

It can be computed using ArgMin:

Out[3]=3
Out[4]=4

Possible Issues  (2)Common pitfalls and unexpected behavior

A finite minimum value may not be attained:

Out[1]=1

The objective function may be unbounded:

Out[2]=2

There may be no points satisfying the constraints:

Out[3]=3

ArgMin requires that all functions present in the input be real valued:

Out[1]=1

Values for which the equation is satisfied but the square roots are not real are disallowed:

Out[2]=2
Wolfram Research (2008), ArgMin, Wolfram Language function, https://reference.wolfram.com/language/ref/ArgMin.html (updated 2021).
Wolfram Research (2008), ArgMin, Wolfram Language function, https://reference.wolfram.com/language/ref/ArgMin.html (updated 2021).

Text

Wolfram Research (2008), ArgMin, Wolfram Language function, https://reference.wolfram.com/language/ref/ArgMin.html (updated 2021).

Wolfram Research (2008), ArgMin, Wolfram Language function, https://reference.wolfram.com/language/ref/ArgMin.html (updated 2021).

CMS

Wolfram Language. 2008. "ArgMin." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/ArgMin.html.

Wolfram Language. 2008. "ArgMin." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2021. https://reference.wolfram.com/language/ref/ArgMin.html.

APA

Wolfram Language. (2008). ArgMin. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArgMin.html

Wolfram Language. (2008). ArgMin. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ArgMin.html

BibTeX

@misc{reference.wolfram_2025_argmin, author="Wolfram Research", title="{ArgMin}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/ArgMin.html}", note=[Accessed: 25-March-2025 ]}

@misc{reference.wolfram_2025_argmin, author="Wolfram Research", title="{ArgMin}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/ArgMin.html}", note=[Accessed: 25-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_argmin, organization={Wolfram Research}, title={ArgMin}, year={2021}, url={https://reference.wolfram.com/language/ref/ArgMin.html}, note=[Accessed: 25-March-2025 ]}

@online{reference.wolfram_2025_argmin, organization={Wolfram Research}, title={ArgMin}, year={2021}, url={https://reference.wolfram.com/language/ref/ArgMin.html}, note=[Accessed: 25-March-2025 ]}