[Tex/LaTex] Add Caption below algorithm environment

algorithmserrorsfloatsieeetran

I want to add a caption below algorithm environment that spans over two column page in \documentclass[10pt, conference, compsocconf]{IEEEtran}. I use the following:

\usepackage[Algorithm,ruled]{algorithm}
\usepackage{float}

\begin{figure*}
    \begin{algorithm*}[H]
            This is algorithm
    \end{algorithm*}
\caption{Caption here}
\end{figure*}

But I get error ./main.tex:164: LaTeX Error: Float(s) lost. How can I fix that?

Thank you very much.

Best Answer

You can have a caption below an algorithm using the algorithm2e package

\documentclass{article}
\usepackage[]{algorithm2e}

\begin{document}
    \begin{algorithm}
            This is algorithm
            \caption{Algorithm caption}
    \end{algorithm}
\end{document}