Skip to main content
. 2024 Mar 14;10:e1839. doi: 10.7717/peerj-cs.1839
Algorithm 2 Outline of AP’s main procedure
Input: DATA: points to be clustered, Gmax: maximum iterative generations
Output: cluster which each data point belongs
Step 1. Initialization: generation counter t = 0; reference degree p(k); similarity matrix S;
Step 2. main loop:
2.1 Calculate matrix A = [a(i, k)]N×N and R = [r(i, k)]N×N
2.2 Update the matrix A and R according to the formula:
rt(ik) = (1 − λ)∗rt(ik) + λrt−1(ik)
at(ik) = (1 − λ)∗at(ik) + λat−1(ik)
2.3 Determine the center of the points
2.4 Distribution of each point
2.5 t = t + 1
Step 3. Stop iteration: if t > Gmax, print out the result , otherwise turn to Step 2.