LASCNN algorithm: Difference between revisions

Content deleted Content added
No edit summary
Pseudocode: format code
Line 4:
 
==Pseudocode==
The LASCNN algorithm establishes {{Var|k}}-hop neighbor list and a duplicate free pair wise connection list based on {{Var|k}}-hop information. If the neighbors are stay connected then the node is non-critical<ref>G. Sugithaetal., International Journal of Advanced Engineering Technology E-ISSN 0976-3945</ref><ref>Mohammed Alnuem, 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>
 
The LASCNN algorithm establishes k hop neighbor list and a duplicate free pair wise connection list based on k hop information. If the neighbors are stay connected then the node is non critical
<ref>G. Sugithaetal., International Journal of Advanced Engineering Technology E-ISSN 0976-3945</ref><ref>Mohammed Alnuem, 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>
 
<pre>
Function LASCNN(MAHSN)
For ∀ A ∈ MAHSN
If (A->ConnList.getSize() == 1) then
A->SetNonCritical() = LEAF
Else
Continue = TRUE
While (Continue == TRUE)
Continue = FALSE
For ∀ ActiveConn ∈ ConnList
If (A∉ActiveConn) then
If (A->ConnNeighbors.getSize() == 0)
A->ConnNeighbors.add(ActiveConn)
Continue = TRUE
else
If (ActiveConn ∩ ConnNeighbors == TRUE)
ActiveConn ∪ ConnNeighbors
Continue = TRUE
Endif
Endif
Endif
End EndifFor
End EndifWhile
End ForEndif
If (A->ConnNeighbors.getSize() < A->Neighbors.getSize())
End While
A->SetCritical() = TRUE
Endif
else
If (A->ConnNeighbors.getSize()< A->Neighbors.getSize())
A->SetCriticalSetNonCritical() =TRUE INTERMEDIATE
Endif
else
End WhileFor
A->SetNonCritical()=INTERMEDIATE
Endif
End For
End Function
</pre>