## 3 New Algorithms
### M-Spheres Dataset Generator  
The novel dataset generator is given in Algorithm 4. Based on the method proposed in ([43], p. 586), Algorithm 5 generates a random point that is on the \(M\)-dimensional sphere centered on \(\mathbf{c}\) with radius of \(d\). The core principle is to draw \(M\) independent values from the standard normal distribution and transform these with corresponding \(M\)-direction cosines. The obtained \(M\)-dimensional vector is then scaled with the radius \(d\) and relocated with the center \(\mathbf{c}\). The generated points are uniformly distributed on the surface of the sphere, because of the known properties of the standard normal distribution (see [43] (p. 587) and articles therein).  
```
Input: #clusters \(K\), #dimensions \(M\), #points per cluster \(N_{K}\), nearest center distance \(d_{c}\), radius of M-sphere \(d_{r}\). Output: Dataset \(\mathbf{X}=\{\mathbf{x}_{1},\mathbf{x}_{2},...,\mathbf{x}_{N}\}\).
1:\(\mathbf{C}\leftarrow\{(0,...,0)\}\).
2:if\(K>1\)then
3:\(\mathbf{c}_{2}\leftarrow\text{randsurfpoint}(\mathbf{c}_{1}d_{c})\).
4:\(\mathbf{C}\leftarrow\mathbf{C}\cup\ \{\mathbf{c}_{2}\}\).
5:\(k\gets 2\).
6:if\(K>2\)then
7:while\(k<K\)do
8:\(i\leftarrow\text{rand}(\{1,2,...,k\})\).
9:\(\mathbf{c}_{cand}\leftarrow\text{randsurfpoint}(\mathbf{c}_{i}d_{c})\)..
10:\(i^{*}\leftarrow\text{argmin}_{j}\parallel\mathbf{c}_{j}-\mathbf{c}_{cand}\parallel\).
11:if\(i^{*}==i\)then
12:\(\mathbf{C}\leftarrow\mathbf{C}\cup\ \{\mathbf{c}_{cand}\}\).
13:\(k\gets k+1\).
14:\(k\gets 1\).
15:\(\mathbf{X}\leftarrow\{\}\).
16:while\(k\leq K\)do
17:\(n\gets 1\)
18:while\(n\leq N_{K}\)do
19:\(d_{r}^{*}\gets rand((0,d_{r}])\)
20:\(\mathbf{x}_{new}\leftarrow\text{randsurfpoint}(\mathbf{c}_{k}d_{r}^{*})\).
21:\(\mathbf{X}\leftarrow\mathbf{X}\cup\ \{\mathbf{x}_{new}\}\).
22:\(n\gets n+1\)
23:\(k\gets k+1\)
```  
**Algorithm 4**\(M\)-spheres dataset generator  
The generator uses Algorithm 5 for generating \(K\) cluster centers so that \(\|\mathbf{c}_{i}-\mathbf{c}_{j}\|=d_{c}\), where \(i\
eq j\), \(d_{c}\) is the given distance between the centers, and both \(\mathbf{c}_{i},\mathbf{c}_{j}\) then belong to the set of centers \(\mathbf{C}\). Finally, \(N_{K}\) data points for each cluster are generated by applying Algorithm 5 with a uniformly random radius from the interval \((0,d_{r}]\). This means, in particular, that points in a cluster are nonuniformly distributed and approximately \(\frac{100a}{d_{r}}\%\) percentages of the points are within a \(M\)-dimensional sphere with radius \(a\) for \(0\leq a\leq d_{r}\). In Algorithm 5, \(N(0,1)\) denotes the standard normal distribution.  
```
Input: Sphere center \(\mathbf{c}\), sphere radius \(d\). Output: New point \(\mathbf{x}^{*}\).
1:\(m\gets 1\).
2:\(S\gets 0\).
3:while\(m\leq M\)do
4:\(x_{m}\gets N(0,1)\).
5:\(S\gets S+x_{m}^{2}\).
6:\(m\gets m+1\).
7:\(\mathbf{x}^{*}\leftarrow\mathbf{c}+dS^{-1/2}\mathbf{x}\)
```  
**Algorithm 5**randsurfpoint(\(\mathbf{c}\),\(d\))  
For simplicity, generation of the cluster centers starts from the origin. When the new centers are randomly located with the fixed distance and then expanded as clusterwise data in \(\mathbb{R}^{M}\), the generator algorithm does not restrict the actual values of the generated data and centers. Hence, depending on the input, data range can be large. However, this can be alleviated with the min-max scaling as part of the clustering process.