Skip to main content
. 2022 Nov 10;24(11):1627. doi: 10.3390/e24111627
Algorithm A2 Sorting links
  • Require:Cij correlation matrix

  • Ensure: a correlation matrix Cij that contains in the secondary diagonal the pairs of nodes that always share the same opinion in the steady state, regardless of the initial set of opinions. Rows and columns are sorted in such way that the structure of the network can be inferred from its visual representation

  •  set pivot=Cij dimension

  •  sort from lowest to highest correlation value Cpivot,node all nodes from 1 to pivot

  • repeat
    •   set the new pivot
    •   for all iCpivot,i do
    •     if Cpivot,i=1 then
    •      pivoti1
    •     end if
    •   end for
    • untilpivot=1
    • returnCij sorted correlation matrix