# Visual Assessment of Cluster Tendency with Variations of Distance Measures
## 2 Materials and Methods  
Consider a set of points where each point is represented as a characteristic vector of dimension \(p\), \(x_{i}\in R^{p}\), \(X\) = {\(x_{1}\),..., \(x_{n}\)} \(\in R^{p}\). The second way to represent the points is the dissimilarity matrix \(D\) = [\(d_{ij}\)] (1), of \(n\times n\) dimension, where \(d_{ij}\) is difference between the points \(I\) and \(j\), calculated using a distance measure. The dissimilarity matrix has several properties:  
1. Symmetry about the diagonal. The dissimilarity matrix is a square symmetrical \(n\times n\) matrix with \(d_{ij}\) element equal to the value of a chosen measure of distinction between the \(i\)th and \(j\)th objects \(d_{ij}\) = \(d_{ji}\). 2. The distance values in the matrix are always non-negative \(d_{ij}\geq 0\). 3. Identity of indiscernibles. In the matrix, the distinction between an object and itself is set to zero (\(d_{ii}\) is diagonal element, where \(d_{ii}\) = 0). 4. The triangle inequality takes the form \(d_{ij}+d_{jk}\geq d_{ik}\)\(\forall\)\(i\)\(j\)\(k\). \[D= \begin{pmatrix}0&\cdots&d_{1j}&\ldots&d_{1n}\\ \vdots&\cdots&\vdots&\cdots&\vdots\\ d_{i1}&\cdots&0&\cdots&d_{in}\\ \vdots&\cdots&\vdots&\cdots&\vdots\\ d_{n1}&&d_{nj}&&0\end{pmatrix} ,\] (1) where \(d_{ij}\) is the difference between the \(i\)th and \(j\)th points. The quality of the cluster solution also depends on the chosen distance measure. In this work, we used some distance measures (the Euclidean distance, the squared Euclidean distance, the Manhattan distance, the Chebyshev distance) based on the Minkowski function (\(l_{p}\)-norm) [39; 40; 41]:  
\[d(x,y)=\left(\sum_{i=1}^{M}\lvert x_{i}-y_{i}\rvert^{p}\right)^{\frac{1}{p}}, \tag{2}\]where \(x\) and \(y\) are input vectors of dimension \(M\). For parameter \(p\), the following statement is true (proof): for \(p\geq 1\) and \(p=\infty\), the distance is a metric; for \(p<1\), the distance is not a metric. For \(p=2\), the function takes the form of Euclidean distance (\(l_{2}\) norm):  
\[d(x,y)=\sqrt{\sum_{i=1}^{M}(x_{i}-y_{i})^{2}}. \tag{3}\]  
The Euclidean distance is the most understandable and interpretable measure of the difference between points represented by feature vectors in multidimensional space. Therefore, the Euclidean distance and squared Euclidean distance are widely used for data analysis. The squared Euclidean distance is defined as:  
\[d(x,y)=\sum_{i=1}^{M}(x_{i}-y_{i})^{2}. \tag{4}\]  
We also used the standardized Euclidean distance, calculated as follows:  
\[d(x,y)=\sqrt{\sum_{i=1}^{M}\left(\frac{x_{i}-y_{i}}{s_{i}}\right)^{2}} \tag{5}\]  
where \(s_{i}\) is standard deviation of the \(i\)th characteristic of the input data vectors. For \(p=1\), we obtained the Manhattan distance (\(l_{1}\) -norm), which is the second most popular distance:  
\[d(x,y)=\sum_{i=1}^{M}|x_{i}-y_{i}|. \tag{6}\]  
For \(p=\infty\), the function calculates the Chebyshev distance [42], also called the chessboard distance:  
\[d(x,y)=max|x_{i}-y_{i}|. \tag{7}\]  
Most modern papers are devoted to problems that use the Euclidean or Manhattan distances. There are other ways to calculate distances that do not depend on the parameter \(p\) and are not determined by the Minkowski function. For example, we used the Mahalanobis distance [43], the correlation-based distance (the correlation distance) [44], the cosine similarity [45], the Bray-Curtis dissimilarity [46], the Canberra distance [42]. Mahalanobis distance is defined as  
\[d(x,y)=\sqrt{\sum_{i=1}^{M}(x_{i}-y_{i})^{T}C^{-1}(x_{i}-y_{i})}, \tag{8}\]  
where \(C\) is the covariance matrix calculated as  
\[C=\text{cov}(x,y)=\mu[(x-\mu(x))(y-\mu(y))], \tag{9}\]  
where \(\mu\) is the mean value.