Research Article
On the Use of Graphs for Node Connectivity in Wireless Sensor Networks for Hostile Environments
Algorithm 3
Check if a list of integers L is a graphical potentially connected degree sequence.
Input: A list of integers L | Output: True if the L is potentially connected, False | otherwise | 1 begin | 2 n ⟵ | 3 Sort L in non-increasing order | 4 if then | 5 return False | 6 end | 7 if then | 8 return False | 9 end | 10 if then | 11 continue ⟵ True | 12 end | 13 else | 14 continue ⟵ False | 15 end | 16 integrity ⟵ False | 17 while continue do | 18 actualValue = | 19 Delete from L | 20 for i=1 : i≤actualValue do | 21 | 22 if then | 23 continue ⟵ False | 24 break | 25 end | 26 else | 27 continue ⟵ True | 28 end | 29 end | 30 if There’s some then | 31 Sort L in non-increasing order | 32 end | 33 else | 34 continue ⟵ False | 35 break | 36 end | 37 end | 38 if integrity then | 39 for : do | 40 if then | 41 result ⟵ True | 42 end | 43 else | 44 result ⟵ False | 45 break | 46 end | 47 end | 48 end | 49 if result then | 50 return True | 51 end | 52 else | 53 return False | 54 end | 55 end |
|