Skip to main content
. 2024 Mar 29;10:e1929. doi: 10.7717/peerj-cs.1929

Algorithm 1. SNN index.

1: Input: Data matrix P=[p1,p2,,pn]TR×
2: Compute μ:=mean({pj})
3: Compute the mean-centered matrix X with rows xi:=piμ
4: Compute the singular value decomposition of X=UΣVT
5: Compute the sorting keys αi=xiTv1 for i=1,2,,n
6: Sort data points X such that α1α2αn
7: Compute xi¯=(xiTxi)/2 for i=1,2,,n
8: Return: μ, X, v1, [αi], [xi¯]