0

我尝试在乳胶中输入一个算法的伪代码,它工作正常,但它只写到中间。其余的保持空白..这是来源

\documentclass{IEEETran}
\usepackage{algpseudocode} 
\usepackage{algorithm}
\begin{document}
\begin{algorithm}
\caption{GPX operator}
\hspace*{\algorithmicindent} \textbf{Input} s1 = $\lbrace V^{1}_{1}; ... ; V^{1}_{k}\rbrace$ and  s2 = $\lbrace V^{2}_{1}; ... ; V^{2}_{k}\rbrace$ - parent solutions. \\
 \hspace*{\algorithmicindent} \textbf{Output} $ s = \lbrace V_{1}; ... ; V_{k}\rbrace$ - offspring solution. \\
\begin{algorithmic}[1]
\For {$l(1\leq l \leq k)$}
\If{($l$ is odd)}
\State A=1

\Else
\State  A=2;
 \EndIf
 \State choose $i$ such that $V^{A}_{i}$  has a maximum cardinality
\State $V_{l}$=$V^{A}_{i}$
\State remove the vertices of  $V_{l}$ from $s1$ and $s2$
\EndFor
\State Assign randomly the vertices of $V - (V_{1} \cup ... \cup V_{k})$
\end{algorithmic}

\end{algorithm}
\end{document}

这就是我得到的:在此处输入图像描述

4

1 回答 1

2

IEEEtran 的默认模式是双列。\documentclass[onecolumn]{IEEEtran}如果它是你想要的,请编译。

于 2019-05-31T14:08:59.387 回答