Layout in mathematical model using align

As you observed, align alternates between r (right aligned) and l (left alinged) columns. To just get left aligned columns, you cann add & so "skip" the r columns:

enter image description here

\documentclass[12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}

\begin{document}

\begin{align}
    &\text{min} \qquad && \sum_{e\in \mathcal{E}} \sum_{r\in  \mathcal{R}_e} c^r_e x^r_e + \sum_{d \in \mathcal{D}} c^-_d s_d^- + \sum_{d \in \mathcal{D}} c^+_d s^+_d \label{MP1} \\ 
   & \text{s.t.} \qquad && \sum_{e\in \mathcal{E}} \sum_{r\in  \mathcal{R}_e} a^r_{ed} x^r_e + s_d^- -s_d^+ = b_d && \forall d \in \mathcal{D} \label{MP2} \\
    &&& \sum_{r\in  \mathcal{R}_e} x^r_e = 1 && \forall e \in \mathcal{E} \label{MP3} \\
    &&& x^r_e\in \{ 0,1\} && \forall e \in \mathcal{E}, \forall r \in \mathcal{R}_e \label{MP4} \\
    &&& 0 \leq s_d^- \leq u_d^- && \forall d \in \mathcal{D} \label{MP5} \\
    &&& 0 \leq s_d^+ \leq u_d^+ && \forall d \in \mathcal{D} \label{MP6}
\end{align}


\end{document}

You also can have this layout with the dedicated optidef package. I changed the numbering so that the constraints are subequations of the first line:

\documentclass[12pt]{article}
\usepackage{amsmath}
\usepackage[short]{optidef}

\begin{document}

\begin{mini!}
  {\qquad}{ \sum_{e\in \mathcal{E}} \sum_{r\in \mathcal{R}_e} c^r_e x^r_e + \sum_{d \in \mathcal{D}} c^-_d s_d^- + \sum_{d \in \mathcal{D}} c^+_d s^+_d \tag{1}}{\label{MP1}}{}
%
\addConstraint{}{\sum_{e\in \mathcal{E}} \sum_{r\in \mathcal{R}_e} a^r_{ed} x^r_e + s_d^- -s_d^+ = b_d\qquad }{\forall d \in \mathcal{D} \label{MP2}}
\addConstraint{}{\sum_{r\in \mathcal{R}_e} x^r_e = 1}{\forall e \in \mathcal{E} \label{MP3}}
\addConstraint{}{x^r_e\in \{ 0,1\}}{\forall e \in \mathcal{E}, \forall r \in \mathcal{R}_e \label{MP4}}
\addConstraint{}{0 \leq s_d^- \leq u_d^- }{\forall d \in \mathcal{D} \label{MP5}}
\addConstraint{}{0 \leq s_d^+ \leq u_d^+}{\forall d \in \mathcal{D} \label{MP6}}
\end{mini!}

\end{document} 

enter image description here

Tags:

Align