- %\emph{Initialize the sensor node and determine it's position and subregion} \;
-
-\noindent{\bf If} $RE_k \geq E_{th}$ {\bf then}\\
-\hspace*{0.6cm} \emph{$s_k.status$ = COMMUNICATION;}\\
-\hspace*{0.6cm} \emph{Send $INFO()$ packet to other nodes in subregion;}\\
-\hspace*{0.6cm} \emph{Wait $INFO()$ packet from other nodes in subregion;}\\
-\hspace*{0.6cm} \emph{Update K.CurrentSize;}\\
-\hspace*{0.6cm} \emph{LeaderID = Leader election;}\\
-\hspace*{0.6cm} {\bf If} $ s_k.ID = LeaderID $ {\bf then}\\
-\hspace*{1.2cm} \emph{$s_k.status$ = COMPUTATION;}\\
-\hspace*{1.2cm}{\bf If} \emph{$ s_k.ID $ is Not previously selected as a Leader} {\bf then}\\
-\hspace*{1.8cm} \emph{ Execute the perimeter coverage model;}\\
-\hspace*{1.2cm} {\bf end}\\
-\hspace*{1.2cm}{\bf If} \emph{($s_k.ID $ is the same Previous Leader)~And~(K.CurrentSize = K.PreviousSize)}\\
-\hspace*{1.8cm} \emph{ Use the same previous cover set for current sensing stage;}\\
-\hspace*{1.2cm} {\bf end}\\
-\hspace*{1.2cm} {\bf else}\\
-\hspace*{1.8cm}\emph{Update $a^j_{ik}$; prepare data for IP~Algorithm;}\\
-\hspace*{1.8cm} \emph{$\left\{\left(X_{1},\dots,X_{l},\dots,X_{K}\right)\right\}$ = Execute Integer Program Algorithm($K$);}\\
-\hspace*{1.8cm} \emph{K.PreviousSize = K.CurrentSize;}\\
-\hspace*{1.2cm} {\bf end}\\
-\hspace*{1.2cm}\emph{$s_k.status$ = COMMUNICATION;}\\
-\hspace*{1.2cm}\emph{Send $ActiveSleep()$ to each node $l$ in subregion;}\\
-\hspace*{1.2cm}\emph{Update $RE_k $;}\\
-\hspace*{0.6cm} {\bf end}\\
-\hspace*{0.6cm} {\bf else}\\
-\hspace*{1.2cm}\emph{$s_k.status$ = LISTENING;}\\
-\hspace*{1.2cm}\emph{Wait $ActiveSleep()$ packet from the Leader;}\\
-\hspace*{1.2cm}\emph{Update $RE_k $;}\\
-\hspace*{0.6cm} {\bf end}\\
-{\bf end}\\
-{\bf else}\\
-\hspace*{0.6cm} \emph{Exclude $s_k$ from entering in the current sensing stage;}\\
-{\bf end}\\
-\label{alg:PeCO}
-\end{algorithm}
-
-
-
-In this algorithm, K.CurrentSize and K.PreviousSize respectively represent the
-current number and the previous number of living nodes in the subnetwork of the
-subregion. Initially, the sensor node checks its remaining energy $RE_k$, which
-must be greater than a threshold $E_{th}$ in order to participate in the current
-period. Each sensor node determines its position and its subregion using an
-embedded GPS or a location discovery algorithm. After that, all the sensors
-collect position coordinates, remaining energy, sensor node ID, and the number
-of their one-hop live neighbors during the information exchange. The sensors
-inside a same region cooperate to elect a leader. The selection criteria for the
-leader, in order of priority, are: larger numbers of neighbors, larger remaining
-energy, and then in case of equality, larger index. Once chosen, the leader
-collects information to formulate and solve the integer program which allows to
-construct the set of active sensors in the sensing stage.
-
+ %\emph{Initialize the sensor node and determine it's position and subregion} \;
+ \label{alg:PeCO}
+ \caption{PeCO pseudocode}
+ \eIf{$RE_k \geq E_{th}$}{
+ $s_k.status$ = COMMUNICATION\;
+ Send $INFO()$ packet to other nodes in subregion\;
+ Wait $INFO()$ packet from other nodes in subregion\;
+ Update K.CurrentSize\;
+ LeaderID = Leader election\;
+ \eIf{$s_k.ID = LeaderID$}{
+ $s_k.status$ = COMPUTATION\;
+ \If{$ s_k.ID $ is Not previously selected as a Leader}{
+ Execute the perimeter coverage model\;
+ }
+ \eIf{($s_k.ID $ is the same Previous Leader) {\bf and} \\
+ \indent (K.CurrentSize = K.PreviousSize)}{
+ Use the same previous cover set for current sensing stage\;
+ }{
+ Update $a^j_{ik}$; prepare data for IP~Algorithm\;
+ $\left\{\left(X_{1},\dots,X_{l},\dots,X_{K}\right)\right\}$ = Execute Integer Program Algorithm($K$)\;
+ K.PreviousSize = K.CurrentSize\;
+ }
+ $s_k.status$ = COMMUNICATION\;
+ Send $ActiveSleep()$ to each node $l$ in subregion\;
+ Update $RE_k $\;
+ }{
+ $s_k.status$ = LISTENING\;
+ Wait $ActiveSleep()$ packet from the Leader\;
+ Update $RE_k $\;
+ }
+ }{
+ Exclude $s_k$ from entering in the current sensing stage\;
+ }
+\end{algorithm2e}
+
+%\begin{algorithm}
+%\noindent{\bf If} $RE_k \geq E_{th}$ {\bf then}\\
+%\hspace*{0.6cm} \emph{$s_k.status$ = COMMUNICATION;}\\
+%\hspace*{0.6cm} \emph{Send $INFO()$ packet to other nodes in subregion;}\\
+%\hspace*{0.6cm} \emph{Wait $INFO()$ packet from other nodes in subregion;}\\
+%\hspace*{0.6cm} \emph{Update K.CurrentSize;}\\
+%\hspace*{0.6cm} \emph{LeaderID = Leader election;}\\
+%\hspace*{0.6cm} {\bf If} $ s_k.ID = LeaderID $ {\bf then}\\
+%\hspace*{1.2cm} \emph{$s_k.status$ = COMPUTATION;}\\
+%\hspace*{1.2cm}{\bf If} \emph{$ s_k.ID $ is Not previously selected as a Leader} {\bf then}\\
+%\hspace*{1.8cm} \emph{ Execute the perimeter coverage model;}\\
+%\hspace*{1.2cm} {\bf end}\\
+%\hspace*{1.2cm}{\bf If} \emph{($s_k.ID $ is the same Previous Leader)~And~(K.CurrentSize = K.PreviousSize)}\\
+%\hspace*{1.8cm} \emph{ Use the same previous cover set for current sensing stage;}\\
+%\hspace*{1.2cm} {\bf end}\\
+%\hspace*{1.2cm} {\bf else}\\
+%\hspace*{1.8cm}\emph{Update $a^j_{ik}$; prepare data for IP~Algorithm;}\\
+%\hspace*{1.8cm} \emph{$\left\{\left(X_{1},\dots,X_{l},\dots,X_{K}\right)\right\}$ = Execute Integer Program Algorithm($K$);}\\
+%\hspace*{1.8cm} \emph{K.PreviousSize = K.CurrentSize;}\\
+%\hspace*{1.2cm} {\bf end}\\
+%\hspace*{1.2cm}\emph{$s_k.status$ = COMMUNICATION;}\\
+%\hspace*{1.2cm}\emph{Send $ActiveSleep()$ to each node $l$ in subregion;}\\
+%\hspace*{1.2cm}\emph{Update $RE_k $;}\\
+%\hspace*{0.6cm} {\bf end}\\
+%\hspace*{0.6cm} {\bf else}\\
+%\hspace*{1.2cm}\emph{$s_k.status$ = LISTENING;}\\
+%\hspace*{1.2cm}\emph{Wait $ActiveSleep()$ packet from the Leader;}\\
+%\hspace*{1.2cm}\emph{Update $RE_k $;}\\
+%\hspace*{0.6cm} {\bf end}\\
+%{\bf end}\\
+%{\bf else}\\
+%\hspace*{0.6cm} \emph{Exclude $s_k$ from entering in the current sensing stage;}\\
+%{\bf end}\\
+%\label{alg:PeCO}
+%\end{algorithm}
+
+In this algorithm, $K.CurrentSize$ and $K.PreviousSize$ respectively represent
+the current number and the previous number of living nodes in the subnetwork of
+the subregion. At the beginning of the first period $K.PreviousSize$ is
+initialized to zero. Initially, the sensor node checks its remaining energy
+$RE_k$, which must be greater than a threshold $E_{th}$ in order to participate
+in the current period. Each sensor node determines its position and its
+subregion using an embedded GPS or a location discovery algorithm. After that,
+all the sensors collect position coordinates, remaining energy, sensor node ID,
+and the number of their one-hop live neighbors during the information exchange. \textcolor{blue}{We suppose that both INFO packet and ActiveSleep packet contain two parts: header and data payload. The sensor id is included in the header, where the header size is 8 bits. The data part includes position coordinates (64 bits), remaining energy (32 bits), and the number of their one-hop live neighbors (8 bits). Therefore the size of the INFO packet is 112 bits. The ActiveSleep packet is 16 bits size, 8 bits for the header and 8 bits for data part that includes only sensor status (0 or 1)}
+The sensors inside a same region cooperate to elect a leader. The selection
+criteria for the leader are (in order of priority):
+\begin{enumerate}
+\item larger number of neighbors;
+\item larger remaining energy;
+\item and then, in case of equality, larger indexes.
+\end{enumerate}
+Once chosen, the leader collects information to formulate and solve the integer
+program which allows to build the set of active sensors in the sensing
+stage.