Can anybody help me stating a linear program in latex with the following requirements?
The LP itself shall be numbered on the left-hand side (although in the remaining document the equations' labels are on the rhs), with a certain tag, e.g. "(P)" which should be associated with an equation label.
The LP part consists of 5 columns:
- for "max" and for "subject to"
- for the lhs of the constraints
- for the relations $\leq$, etc.
- for the rhs of the constraints
- for quantification (e.g. $\forall v \in V$)
The objective function (which does not have a lhs/rhs) may be wide and should span over the three middle columns.
Every row should itself have an equation label which is right-justified.
So far I used an equation environment together with the array environment and the multicolumn command to get the layout right. But the constraint labels don't work here. On the other hand, using align doesn't seem to help since even the wide objective didn't work very nicely (I used \mathclap).
The following picture shows how it should look like
this http://www.math.uni-magdeburg.de/~walter/downloads/latex-lp-labels.png
Here is a MWE rendering the centered part - but I have no clue how to add the single equation labels nor the left-aligned equation label given that other equations are right-aligned.
\documentclass{article}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
\begin{array}{lrcll}
\max
& \multicolumn{4}{l}{\sum\limits_{v \in V} x_v + \sum\limits_{e \in E} y_e + 10000\gamma } \\
\text{s.t.}
& x_v + x_w & \geq & 0 & \forall \{v,w\} \in E \\
& y_e & \geq & 0 & \forall e \in E \\
& y(\delta(U)) & \geq & \frac{1}{2}(|U|-1) & \forall U \subseteq V
\end{array}
\end{equation*}
\end{document}
\documentclass
and the appropriate packages that sets up the problem. While solving problems is fun, setting them up is not. Then those trying to help can simply cut and paste your MWE and get started on solving problem.(1)
,(2)
,(3)
, or they should use the continuing numbering of equations in the whole document?