# How to write the number of equations in optimization problem?

I am writing to assign numbers to my equations in an optimization problem. However, Latex keeps giving one number for the single problem. How can to write it?

My code is

\begin{aligned} & \underset{\mathbf{x}}{\text{maximize}} & & \sum_{m}^{M} \sum_{k}^{K} \sum_{n}^{N} R_{m,k,n}^{T,UL} x_{m,k,n} \\ & \text{subject to} & & \sum_{m}^{M} \sum_{k}^{K} x_{m,k,n} \leq 1, \; \forall n. \\ & & & \sum_{n}^{N} x_{m,k,n} \leq 1, \; \forall m,k. \end{aligned}

• So, do you want three equation numbers? Please advise. – Mico Oct 7 '17 at 23:05
• @Mico yes, maybe 1, 2 and 3 or 1, 1c and 1d. Thanks a lot – user3727281 Oct 7 '17 at 23:07

Here are two possible solutions. Note that I've reduced the number of alignment points relative to your original code. In the second solution, only the two constraint equations are aligned relative to each other.

\documentclass{article}
\usepackage{amsmath} % for align environment
\usepackage{bm}      % for \bm macro
\begin{document}

First possibility:
\begin{align}
& \sum_{m=1}^{M} \sum_{k=1}^{K} \sum_{n=1}^{N} R_{m,k,n}^{T,\mathit{UL}} x_{m,k,n}  \\
&\sum_{m=1}^{M} \sum_{k=1}^{K} x_{m,k,n} \leq 1 \quad \forall n \\
&\sum_{n=1}^{N} x_{m,k,n} \leq 1 \quad \forall m,k.
\end{align}

Second possibility:
$$\max_{\bm{x}} \quad \sum_{m=1}^{M} \sum_{k=1}^{K} \sum_{n=1}^{N} R_{m,k,n}^{T,\mathit{UL}} x_{m,k,n}$$
\begin{subequations}
\begin{align}