Skip to main content
. 2017 Nov 27;8:1796. doi: 10.1038/s41467-017-01909-2

Table 2.

Algorithm for balancing units per cluster

Require: A set of clusters of stable units, C, and a minimum number of units per cluster, M
Ensure: At least M stable units are assigned per cluster
N ← 0
    for allc ∈ C do
        N ← N + (M − sizeof(c))
    end for
    while N > 0 do
        Identify all available donorClusters with size of (c)>M
        for all c ∈ donorClusters do
              Find the electrode e c that has the most weakly connected stable units
    end for
    Pick a donorCluster ← c such that c ← arg mini∈donorClusters funcon (i, e i)
    Assign all units on e c to a r eceivingCluster ← υ such that υ ← arg maxiC funcon (i, e i)
   N ← 0
    for all c ∈ C do
        NN + (M−size of (c))
    end for
end while