枚举优化问题

枚举优化问题

我正在写论文,我想知道如何枚举优化问题的每一行。我已经写好了。谢谢。

\documentclass[11pt,a4paper,fleqn]{epm-bs}

\usepackage{indentfirst}
\usepackage{chicago}
%\usepackage{kmath,kerkis}
\usepackage[greek,english]{babel}
\usepackage[iso-8859-7]{inputenc}
\usepackage[T1]{fontenc} 
\usepackage{graphicx} 
\usepackage{epsfig} 
\usepackage{url}
\usepackage{amssymb,amsfonts,amsmath}
\usepackage{float}
\usepackage{algorithm,algpseudocode}
\usepackage{pgfplots}
\usepackage{optidef}
\usepackage{nccmath}
\overfullrule=0pt
\usepackage[ruled, algo2e]{algorithm2e}
\addto\captionsgreek{
  \def\bibname{\greektext{ΑΝΑΦΟΡΕΣ}}  
  }\begin{document}

      \begin{aligned}
    &\min\quad \mathlarger\sum\limits_{k \in K}\sum\limits_{ij \in A}c^k_{ij}q^kx^k_{ij}\\
    &\textlatin{s.t.}\quad \mathlarger\sum\limits_{k \in K}q^kx^k_{ij}\leq d_{ij}\forall ij \in A \\
    &\quad \mathlarger\sum\limits_{ij \in A}x^k_{ij} - \sum\limits_{ji \in A}x^k_{ji} = b^k_i\forall i \in N, \forall k \in K \\
                                                &\quad x_{ij} \in \{0,1\} \forall ij \in A,\forall k \in K 
        \end{aligned}
\end{document}

epm-bs.cls

    %::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
% Πρότυπα ΕΠΜ για Πτυχιακή Εργασία
% Εισαγωγικές Σελίδες
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

\NeedsTeXFormat{LaTeX2e}
\LoadClass[a4paper,11pt,oneside,draft,openright]{book}

\ProvidesClass{epm-bs}
              [2004/07/16 Ekdoseis PaMak]

%\usepackage[english,greek]{babel}
%\usepackage[iso-8859-7]{inputenc}

\RequirePackage[english,greek]{babel}
\RequirePackage[iso-8859-7]{inputenc}
\RequirePackage{amsmath}

\addtolength{\oddsidemargin}{-0.7cm}    % convert left margin from 1.65in=42mm to 1.3in=35mm
\marginparsep=0pt
\marginparwidth=0pt             % set marginpars to 0
\addtolength{\textwidth}{2.6cm}     % increase text width by 2.6cm to make right margin 30mm

\addtolength{\topmargin}{1.6in}
\addtolength{\headheight}{-12pt}    % should make headheight 0
\addtolength{\headsep}{-20pt}       % should make headsep 0

\addtolength{\footskip}{.4in}   % ayksanei to footskip ara katebainei to page number
\addtolength{\textheight}{2.5cm}


%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Εντολές που ορίζουν τη σελίδα τίτλου
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
\def\title#1{\gdef\@title{#1}}

\def\author#1{\gdef\@author{#1}}

\def\previousdegrees#1{\gdef\@previousdegrees{#1}}

\def\date#1{\gdef\@date{#1}}
  \date{\today}

\def\degree#1{\gdef\@degree{#1}}
  \degree{Doctor of Philosophy \\ Engineering}

\def\degreesubject#1{\gdef\@degreesubject{#1}}
  \degreesubject{Ph.D., Electrical Engineering}

\def\documenttype#1{\gdef\@documenttype{#1}}
  \documenttype{ΠΤΥΧΙΑΚΗ ΕΡΓΑΣΙΑ}

\def\supervisor#1{\gdef\@supervisor{#1}}

\def\testers#1{\gdef\@testers{#1}}

\def\schoolname#1{\gdef\@schoolname{#1}}
  \schoolname{Πανεπιστήμιο Μακεδονίας}

\def\schooladdress#1{\gdef\@schooladdress{#1}}
  \schooladdress{Θεσσαλονίκη}

\newlength\@temptextheight
\setlength\@temptextheight{\textheight}
\newlength\@temptextwidth
\setlength\@temptextwidth{\textwidth}
\newlength\@temptopmargin
\setlength\@temptopmargin{\topmargin}
\newlength\@tempheadheight
\setlength\@tempheadheight{\headheight}
\newlength\@tempheadsep
\setlength\@tempheadsep{\headsep}
\newlength\@tempfootskip
\setlength\@tempfootskip{\footskip}

\newcommand\@resetpagesize{%
  \setlength{\topmargin}{\@temptopmargin}%
  \setlength{\headheight}{\@tempheadheight}%
  \setlength{\headsep}{\@tempheadsep}%
  \setlength{\footskip}{\@tempfootskip}%
  \setlength{\textheight}{\@temptextheight}%
  \setlength{\textwidth}{\@temptextwidth}%
}

\renewcommand\maketitle{%
%   \thisfancypage{}{%
%     \setlength{\fboxsep}{-10pt}%
%     \singlebox
%}
  \@maketitle
   \clearpage%
   \mbox{\@resetpagesize}%
   \if@twoside%
     \thispagestyle{empty}%
     \mbox{}%
     \clearpage%
   \fi
}

\def\@maketitle{%
  \thispagestyle{empty}
%
  \setlength{\textheight}{648pt}
  \setlength{\textwidth}{427.5pt}
  \setlength{\topmargin}{0pt}
  \setlength{\headheight}{9pt}
  \setlength{\headsep}{9pt}

% commented out since causing errors (10/9/04)
%  \if@botnum
%     \setlength{\footskip}{50pt}
%  \else
%     \setlength{\footskip}{20pt}
%  \fi
%

  \let\footnotesize\small
%  \let\footnoterule\relax
  \if@twoside%
    \setcounter{page}{1}%
  \else
    \setcounter{page}{1}%
  \fi
  \null\vfil%
  \begin{center}%
  \renewcommand\baselinestretch{0.75}
    {\Large \bf \MakeUppercase{\@title}}
%    \par\vskip 60pt plus2pt minus30pt
    \par\vskip 12pt
%    {\bf απο}
    \par\vskip 12pt
    {\bf \MakeUppercase{\@author}}
    %\par\vskip 80pt plus6pt minus35pt
    \par\vskip 96pt
    \MakeUppercase{\@documenttype}
    \par\vskip 36pt
    {\it Επιβλέπων Καθηγητής} \@supervisor
    \par\vskip 2pt
    \end{center}

    \par\hspace{98pt}{\it Εξεταστές} \@testers

    \par\vskip 32pt

    %\begin{center}
    %\psfig{file=uom.eps,width=1.2in}
    %\end{center}
    \par\vskip 154pt

    %\begin{figure*}[h]
    %   {\centerline{\psfig{figure=uom.eps,width=1.2in}}}
   %\end{figure*}

   \begin{center}
   \par\vskip 36pt
    %\par\vskip 216pt
    {\bf \@degree}
    \par\vskip 6pt


    \@schoolname
    \\[0pt]
%    \par
    \@schooladdress
    \par\vskip 6pt
    {\bf \@date}
    \par
  \end{center}
  \vfil\null%
  %\setcounter{page}{0}
  \setcounter{footnote}{0}%
%  \if@twoside\begin{titlepage} \setcounter{page}{0}\mbox{} \end{titlepage}\fi
\let\maketitle\relax}%

%\newcount\@Signatures
%\def\Signatures#1{\global\@Signatures=#1\relax}
%  \Signatures{3} % number of signature lines
\renewcommand\baselinestretch{1.45}


%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Εντολές που ορίζουν τη σελίδα copywrite
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
\newcommand\makecopyright{%

  \thispagestyle{plain}
  \begin{center}%
    \vspace{+6.5in}
    %\copyright \thisyear, \hskip 0.5em \@author
    \textlatin{Copyright} \copyright \hskip 0.5em \@author, έτος \thisyear
    \par Με επιφύλαξη παντός δικαιώματος. \textlatin {All rights reserved}.

    \par\vskip 36pt
Η έγκριση της πτυχιακής εργασίας από το Τμήμα Εφαρμοσμένης Πληροφορικής του
Πανεπιστημίου Μακεδονίας δεν υποδηλώνει απαραιτήτως και αποδοχή των απόψεων
του συγγραφέα εκ μέρους του Τμήματος.

  \end{center}%
  \vfil\vfil\null%
%\clearpage%
\let\makecopyright\relax}

%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Εντολές που ορίζουν την περίληψη (abstract)
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
\newenvironment{abstract}{%
   \null%
    \par\vskip 36pt
    \noindent{\huge\bfseries\sffamily\MakeUppercase\abstractname}
%\noindent{\sffamily\abstractname}
  \begin{center}%
    \@endparpenalty\@M
  \end{center}}%
\clearpage%
{\vfill}


%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Ορισμός της διαστημάτωσης (line-spacing) σε 1.5 διάστημα
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

\renewcommand\baselinestretch{1.5}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%page 241, 8.6.2 from The Latex Companion
%\numberwithin{table}{section}  %% so that the numbering resets in each section
%% redefine table numbering using bold (\textbf} and the section number (\thesection)
%% also changed the Pin'akas from file greek.ldf into bold
%\renewcommand{\thetable}{\textbf{\thesection.\arabic{table}}}

\renewcommand{\thefigure}{\textbf{\thesection.\arabic{figure}}}

%\renewcommand{\theequation}{\thesection.\arabic{equation}}     % to display 1.3.1 (section.eqnumber)
%\numberwithin{equation}{section}

\renewcommand{\theequation}{\arabic{equation}}

\numberwithin{table}{chapter}  %% so that the numbering resets in each section
\renewcommand{\thetable}{\textbf{\thechapter.\arabic{table}}}


\renewenvironment{titlepage}
    {%
      \cleardoublepage
      \newpage
      \thispagestyle{empty}%
      \if@compatibility
        \setcounter{page}{0}
      \fi}%


%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Define front/main matter
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

\renewcommand\frontmatter{\clearpage\pagestyle{plain}
           \pagenumbering{arabic}}  % epm-allagi 5/4/2005: arabic instead of latin numbering from the beginning
\renewcommand\mainmatter{\clearpage\pagestyle{plain}}
%       \pagenumbering{arabic}}     % epm-allagi 5/4/2005: so that there is continuous arabic numbering


%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Ορισμός του \thisyear.
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
\newcommand\thisyear{\number\year}
\setlength\columnsep{10\p@}
\setlength\columnseprule{0\p@}
%\pagestyle{mainheadings}
\pagenumbering{arabic}
\onecolumn


%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Ορισμός \thegrmonth - μήνες στα ελληνικά για αυτόματη ημερομηνία
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
\def\thegrmonth{\ifcase\month\or
  \textgreek{Ianou'arios}\or \textgreek{Febrou'arios}\or \testgreek{M'artios}\or \textgreek{Apr'ilios}\or \textgreek{M'a"ios}\or \textgreek{Io'unios}\or
  \textgreek{Io'ulios}\or \textgreek{A'ugoustos}\or \textgreek{Sept'embrios}\or \textgreek{Okt'wbrios}\or \textgreek{No'embrios}\or \textgreek{Dek'embrios}\fi}


%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Ορισμός του tableofcontents
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
% change in the display of Periexomena
\renewcommand\tableofcontents{%
    \if@twocolumn
      \@restonecoltrue\onecolumn
    \else
      \@restonecolfalse
    \fi

    %% changed: huge, bold, caps and sans serif
    \chapter*{\huge\bfseries\sffamily\MakeUppercase\contentsname
        \@mkboth{%
           \sffamily\MakeUppercase\contentsname}{\MakeUppercase\contentsname}}%
   \vskip -13\p@    % epm-addition: in order to vary the distance between "Περιεχόμενα" and the table of contents
    \@starttoc{toc}%
    \if@restonecol\twocolumn\fi
    }


%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Ορισμός του chapter
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%% look in for changes in the display of the Captions of the chapter
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{plain}%
                    \global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \if@mainmatter
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\thechapter.}%
                         \addcontentsline{toc}{chapter}%
                                   {\protect\numberline{\thechapter}#1}%
                       \else
                         \addcontentsline{toc}{chapter}{#1}%
                       \fi
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
\def\@makechapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter

      %% changed: huge, bold, sans serif and caps
        {\huge\bfseries\sffamily\MakeUppercase \@chapapp\space \thechapter}  % huge defines the size of "Kefalaio 1" etc
      %% {\huge\bfseries \@chapapp\space \thechapter}  % before, in book.cls

        \par\nobreak
        \vskip 25\p@    % epm-allagi: changes the distance between "Κεφάλαιο 1" and the Chapter's title. changed it to 25 from 20
      \fi
    \fi
    \interlinepenalty\@M

    %% change: was Huge, made it LARGE
    \LARGE \bfseries #1\par\nobreak  % to Huge kathorizei to megethos poy tha grafei o titlos kefalaioy apo to \include(

}
    \vskip 40\p@
  }
\def\@schapter#1{\if@twocolumn
                   \@topnewpage[\@makeschapterhead{#1}]%
                 \else
                   \@makeschapterhead{#1}%
                   \@afterheading
                 \fi}
\def\@makeschapterhead#1{%
  \vspace*{50\p@}%
  {\parindent \z@ \raggedright
    \normalfont
    \interlinepenalty\@M
    \Huge \bfseries  #1\par\nobreak
    \vskip 40\p@
  }}

%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Εντολές που ξανά-ορίζουν το table
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%% the only change in way showing the Table legend
\renewenvironment{table*}
               {\@dblfloat{table}}
               {\end@dblfloat}
\setlength\abovecaptionskip{10\p@}
\setlength\belowcaptionskip{0\p@}
\long\def\@makecaption#1#2{%
  \vskip\abovecaptionskip

  %% changed: removed the colon. instead of "Table: name" which was before
  %% it will now show "Table name"
  \sbox\@tempboxa{#1 #2}%

  \ifdim \wd\@tempboxa >\hsize
    #1: #2\par
  \else
    \global \@minipagefalse
    \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}%
  \fi
  \vskip\belowcaptionskip}


%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Εντολές που ξανά-ορίζουν το environment της βιβλιογραφίας
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
\renewenvironment{thebibliography}[1]
     {\chapter*{\huge\bfseries\sffamily\MakeUppercase\bibname}%
      \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}%

%\@mkboth{\huge\bfseries\sffamily\MakeUppercase\bibname}{\huge\bfseries\sffamily\MakeUppercase\bibname}%

    \vskip -5\p@    % epm-addition: in order to vary the distance between "Βιβλιογραφία" and the bibliography list

      \list{\@biblabel{\@arabic\c@enumiv}}%
           {\settowidth\labelwidth{\@biblabel{#1}}%
            \leftmargin\labelwidth
            \advance\leftmargin\labelsep
            \@openbib@code
            \usecounter{enumiv}%
            \let\p@enumiv\@empty
            \renewcommand\theenumiv{\@arabic\c@enumiv}}%
      \sloppy
      \clubpenalty4000
      \@clubpenalty \clubpenalty
      \widowpenalty4000%
      \sfcode`\.\@m}
     {\def\@noitemerr
       {\@latex@warning{Empty `thebibliography' environment}}%
      \endlist}


%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Εντολές που ξανά-ορίζουν τα label της βιβλιογραφίας
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

\makeatletter
%\renewcommand{\@biblabel}[1]{[#1]}     % displays bib list with "[1]" in front
\renewcommand{\@biblabel}[1]            % displays bib list with nothing in front
\makeatother



%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
%  Λύση στο πρόβλημα του σ που γίνεται αυτόματα τελικό ς όταν ακολουθείται από τελεία
%  http://www.tug.org/pipermail/pdftex/2004-July/005215.html
%::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

%use \nonfinalsigma explicitly when latex automatically changes σ to ς.

\def\finalsigma{\noboundary c\noboundary}
\def\nonfinalsigma{\noboundary s\noboundary}



\endinput

答案1

以下是我排版您的表情的方式:

\documentclass[11pt,a4paper]{article}
\usepackage[greek,english]{babel}
\usepackage{amssymb,amsfonts,amsmath}
\usepackage{relsize,mathtools}
\begin{document}
    \begin{align}
        &\mathrlap{\min \mathlarger\sum\limits_{k \in K}\sum\limits_{ij \in A}c^k_{ij}q^kx^k_{ij}}\\
        &\textlatin{s.t.}                   & \mathlarger\sum\limits_{k \in K}q^kx^k_{ij}                                   &\leq d_{ij}    &\forall& ij \in A \\
        &                                   & \mathlarger\sum\limits_{ij \in A}x^k_{ij} - \sum\limits_{ji \in A}x^k_{ji}    &= b^k_i        &\forall& i \in N, \forall k \in K \\
        &                                   &   x_{ij}                                                                      &\in \{0,1\}    &\forall& ij \in A,\forall k \in K 
    \end{align}
\end{document}

在此处输入图片描述

相关内容