# [Tex/LaTex] package for specifying optimization problems

packages

Is there a package for specifying optimization problems, such as in linear programming, quadratic programming, convex programming, etc.?

Or do I have to write my own code with align, constraints and so on? I thought that there might be a very elegant way to specify a min/max problem with some constraints below it.

I am talking about something like Example 2.2 in http://people.ucsc.edu/~rgil/Optimization.pdf.

EDIT: Following a request below, I add an illustrating example of a problem I had with align.

\begin{alignat}{3}
\min && n \\
\mathrm{s.t.} && xxxxxxx \\
&& yyyyyyyyyyyyyyyyyyy \\
&& zzzzzzzzzzzzzzzzzzz
\end{alignat}


What happens is that n is aligned to the far left. I want all of the left columns to be centered below each other.
This is my way of formulating a constrained optimization problem, if someone has a better idea I will be glad to hear about it.

If I use only two columns, there is almost no space between $\min$ and $n$. I am almost tempted to use eqnarray 🙂

A bit late but it might help other people looking for the same answer. The package optidef was intended as the easy way to define optimization problems.

\usepackage{optidef}
\begin{mini}|l|
{w,u}{f(w)+ R(w+6x)}{}{}
\end{mini}


The package has several more options. Below some examples are provided. To have a completely overview of the features and options check the documentation.

## Using a shorter description of minimize/subject to.

\usepackage[short]{optidef}
\begin{mini}
{w,u}{f(w)+ R(w+6x)}{}{}
\end{mini}


## Breaking the objective accross several lines.

\usepackage[long]{optidef}
\begin{mini}
{w,u}{f(w)+ R(w+6x)+ H(100w-x*w/500)}{}{}
\breakObjective{-g(w^3-x^2*200+10000*w^5)}
\end{mini}


## Multilabeling/no labeling:

\begin{mini*}
{w}{f(w)+ R(w+6x)}
{}{}
\end{mini*}


\begin{mini!}
{w}{f(w)+ R(w+6x)}
{}{}
\end{mini!}


## Alignment position of constraints with respect to the objective:

Alternative 1

\begin{mini}[2]
{w}{f(w)+ R(w+6x)}
{\label{eq:Ex1}}{}
\end{mini}


Alternative 2

\begin{mini}[3]
{w}{f(w)+ R(w+6x)}
{\label{eq:Ex1}}{}
\end{mini}


Alternative 3

\begin{mini}[4]
{w}{f(w)+ R(w+6x)}
{\label{eq:Ex1}}{}
\end{mini}


## Other optimization environments

argmini

\begin{argmini}
{w}{f(w)+ R(w+6x)}
{}{}
\end{argmini}


maxi

\begin{maxi}
{w}{f(w)+ R(w+6x)}
{}{}
\end{maxi}


argmaxi

\begin{argmaxi}
{w}{f(w)+ R(w+6x)}
{}{}