1

I am currently writing an algorithm. I want to write an algorithm given below. Till now I have been able to do this much only.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{mathrsfs}
\usepackage{tabularx,lipsum,environ,amsmath,amssymb}
%\usepackage{algorithm2e}
\usepackage[ruled,linesnumbered]{algorithm2e}
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\usepackage{cleveref}% http://ctan.org/pkg/cleveref
\crefname{Lemma}{Lemma}{Lemmas}
\usepackage{booktabs}
\usepackage{graphicx}
\usepackage[table,xcdraw]{xcolor}
\usepackage{tabularx,lipsum,environ,amsmath,amssymb}
\usepackage{geometry}
\usepackage{amsmath}

\title{rr}
\author{shi }
\date{October 2018}

\begin{document}

\maketitle
\begin{minipage}{1\linewidth}


\begin{algorithm}[H]
\SetAlgoLined
\textbf{Input} : $G^{'}$\;
\textbf{Decide} : Yes or No  \\~\\

 \caption{ \textsc{Algorithm} }
\end{algorithm}
 \end{minipage}

\end{document}

enter image description here

Question: How to close the boundaries from the left side and right side of the algorithm?

1
3

Instead of

\usepackage[ruled,linesnumbered]{algorithm2e}

use

\usepackage[boxruled,linesnumbered]{algorithm2e}

This yields:

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.