# CUDA and OpenMp Implementation of Boolean Matrix Product with Applications in Visual SLAM
## 5 Ultrametric-PAM and Ultrametric-FABMAP
The Seeds dataset contains 210 data points and consists of kernels from three different wheat varieties. We discovered that increasing ultrametricity increased the Donn index of the clusters. Also, the Spiral dataset's compactness improves, but for the datasets Jain, Iris, and Seeds, lowering the ultrametric configuration improves compactness. We noticed that sum of squared error decreases with increasing ultrametricity for data sets Iris and Seed, while normalised mutual information improves for datasets Jain and Spiral. Figure 1 shows that the Ultrametric-PAM algorithm correctly identifies clusters in the Jain dataset while increasing the ultrametricity of the dissimilarity space \((X,A)\). Figure 1: Identifying clusters in Jain dataset using PAM clustering algorithm as we apply the transformation discussed in Section 5 repeatedly. Figure 2 shows the three clustering evaluation metrics Compactness, Donn index, and NMI increasing for the Jain dataset as the ultrametricity of the dataset's dissimilarity matrix increases. Figure 2 depicts how these metrics change in general, and Table 1 shows the numerical values of these criteria at each iteration of Algorithm 1. According to Table 1, increasing the ultrametricity of the dissimilarity matrix of the Jain dataset results in clusterings with a better Donn index and higher compactness variation. Figure 3 shows that as the ultrametricity of the dataset's dissimilarity matrix increases, Algorithm 1 correctly identifies clusters in the Spiral dataset. Figure 4 depicts how the evaluation metrics change over time for Algorithm 1. It was found that the criteria NMI and Donn index improve at each stage of Algorithm 1, however, compactness decreases. We believe that the method works by gridding the plane into cells, and if the clusters are present in separate cells, the compactness improves; otherwise, the compactness degenerates. Figure 4 depicts how the Compactness and Donn index change for the Spiral dataset. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **Compactness** & **Compactness** & **Dunn Index** & **Dunn Index** \\  & **Avg.** & **Ratio Avg.** & & **Ratio** \\ \hline \(B^{3}\) & 0.4826358111 & 1.0163461701 & 0.0246030 & 0.7697904 \\ \(B^{4}\) & 0.4663649138 & 0.9820825208 & 0.04667035 & 1.460238898 \\ \(B^{5}\) & 0.4799552411 & 1.0107013609 & 0.0418983 & 1.310931155 \\ \(B^{6}\) & 0.5017430685 & 1.056582695 & 0.047757 & 1.494265365 \\ \(B^{8}\) & 0.5400191638 & 1.1371854226 & 0.1781176 & 5.5730085 \\ \(B^{32}\) & 0.8553148705 & 1.8164010431 & 0.043437224 & 13.5907955 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Measuring compactness and Donn index as increase ultrametricity. Jain data set. Figure 3: As we repeatedly apply the transformation discussed in Section 6, the PAM clustering algorithm correctly identifies clusters in the Spiral dataset. Figure 2: Compactness, Donn index and Normalized mutual information. Jain dataset. Table 2 displays the numerical values of compactness and the Donn index at each stage of Algorithm 1. It demonstrates that they improve for the Spiral dataset as the ultrametricity of the dataset's dissimilarity matrix increases. Figure 5 depicts the correct identification of clusters in the Iris dataset. It also shows that as the dataset's ultrametricity increases, so does its compactness. Figure 6 shows the improvements in the Iris dataset's sum of squared errors (SSE), Donn index, and compactness. Table 3 also shows that increasing the ultrametricity improves the Donn index at each iteration of Algorithm 1. Figure 7, shows that increasing ultrametricity results in clusterings with a higher compactness for the Seeds dataset. Figure 8, shows the improvements in clustering Donn index. It also shows that the sum of squared errors is decreasing for the Seeds dataset as we increase the ultrametricity.