LASCNN algorithm: Difference between revisions

Content deleted Content added
Created page with 'LASCNN is a Localized Algorithm for Segregation of Critical/Non-critical Nodes <ref>Imran, Muhammad, Mohamed A. Alnuem, Mahmoud S. Fayed, and Atif Alamri. "Local...'
 
No edit summary
Line 1:
LASCNN is a Localized Algorithm for Segregation of Critical/Non-critical Nodes <ref>Imran, Muhammad, Mohamed A. Alnuem, Mahmoud S. Fayed, and Atif Alamri. "Localized algorithm for segregation of critical/non-critical nodes in mobile ad hoc and sensor networks." Procedia Computer Science 19 (2013): 1167-1172.</ref><ref>Alnuem, Mohammed, Nazir Ahmad Zafar, Muhammad Imran, Sana Ullah, and Mahmoud S. Fayed. "Formal specification and validation of a localized algorithm for segregation of critical/noncritical nodes in MAHSNs." International Journal of Distributed Sensor Networks 10, no. 6 (2014): 140973</ref>
 
==Pseudocode==
 
<pre>
LASCNN (MAHSN)
(1) For∀𝐴∈𝑀𝐴𝐻𝑆𝑁
(2) If (𝐴→𝐶𝑜𝑛𝑛𝐿𝑖𝑠𝑡.getSize()==1)then
(3) 𝐴→SetNonCritical()=LEAF
(4) Else
(5) Continue = TRUE
(6) While (Continue==TRUE)
(7) Continue = FALSE
(8) For∀𝐴𝑐𝑡𝑖V𝑒𝐶𝑜𝑛𝑛∈𝐶𝑜𝑛𝑛𝐿𝑖𝑠𝑡
(9) If (𝐴∉𝐴𝑐𝑡𝑖V𝑒𝐶𝑜𝑛𝑛)then
(10) If (𝐴→𝐶𝑜𝑛𝑛𝑁𝑒𝑖𝑔ℎ𝑏𝑜𝑟𝑠.getSize()==0)
(11) 𝐴→𝐶𝑜𝑛𝑛𝑁𝑒𝑖𝑔ℎ𝑏𝑜𝑟𝑠.add(𝐴𝑐𝑡𝑖V𝑒𝐶𝑜𝑛𝑛)
(12) Continue = TRUE
(13) else
(14) If (𝐴𝑐𝑡𝑖V𝑒𝐶𝑜𝑛𝑛∩𝐶𝑜𝑛𝑛𝑁𝑒𝑖𝑔ℎ𝑏𝑜𝑟𝑠==TRUE)
(15) 𝐴𝑐𝑡𝑖V𝑒𝐶𝑜𝑛𝑛∪𝐶𝑜𝑛𝑛𝑁𝑒𝑖𝑔ℎ𝑏𝑜𝑟𝑠
(16) Continue = TRUE
(17) Endif
(18) Endif
(19) Endif
(20) End For
(21) End While
(22) Endif
(23) If (𝐴→𝐶𝑜𝑛𝑛𝑁𝑒𝑖𝑔ℎ𝑏𝑜𝑟𝑠.getSize()<𝐴→𝑁𝑒𝑖𝑔ℎ𝑏𝑜𝑟𝑠.getSize())
(24) 𝐴→SetCritical()=TRUE
(25) else
(26) 𝐴→SetNonCritical()=INTERMEDIATE
(27) Endif
(28)End For
</pre>
 
==References==