Glowworm Swarm Optimization Algorithm- and K-Prototypes Algorithm-Based Metadata Tree Clustering

,emain objective of this paper is to present a new clustering algorithm for metadata trees based on K-prototypes algorithm, GSO (glowworm swarm optimization) algorithm, and maximal frequent path (MFP). Metadata tree clustering includes computing the feature vector of the metadata tree and the feature vector clustering.,erefore, traditional data clustering methods are not suitable directly for metadata trees. As the main method to calculate eigenvectors, the MFP method also faces the difficulties of high computational complexity and loss of key information. Generally, the K-prototypes algorithm is suitable for clustering of mixedattribute data such as feature vectors, but the K-prototypes algorithm is sensitive to the initial clustering center. Compared with other swarm intelligence algorithms, the GSO algorithm has more efficient global search advantages, which are suitable for solving multimodal problems and also useful to optimize the K-prototypes algorithm. To address the clustering ofmetadata tree structures in terms of clustering accuracy and high data dimension, this paper combines the GSO algorithm, K-prototypes algorithm, and MFP together to study and design a new metadata structure clustering method. Firstly, MFP is used to describe metadata tree features, and the key parameter of categorical data is introduced into the feature vector of MFP to improve the accuracy of the feature vector to describe the metadata tree; secondly, GSO is combined with K-prototypes to design GSOKP for clustering the feature vector that contains numeric data and categorical data so as to improve the clustering accuracy; finally, tests are conducted with a set of metadata trees. ,e experimental results show that the designed metadata tree clustering method GSOKP-FP has certain advantages in respect to clustering accuracy and time complexity.


Introduction
As an important tool for data management, metadata play a very important role in data integration, sharing, retrieval, and the construction of data warehouses. e research and application of metadata is extensive, in which metadata-based data integration and data clustering have been widely and deeply studied, while the clustering study of the metadata itself is rare [1]. FIHC (Frequent Itemset based Hierarchical Clustering) is an agglomerative hierarchical clustering algorithm first proposed by Benjamin [2]. First, frequent word sets are mined, and then the texts are used with the same frequent word sets as an initial cluster to classify the texts. From this, Feng and Chen designed a metadata clustering method based on MFP [3]. is method measures the similarity between metadata trees by the characteristics of MFP. However, the MFP method reduces the computational complexity at the cost of losing part of metadata information, which will have a negative impact on the subsequent feature vector clustering. In addition, the test process shows that the above method is not suitable for large-scale metadata tree clustering.
In order to solve the clustering problem of mixedattribute data more effectively, K-prototypes algorithm [4], EKP algorithm, and SBAC algorithm have been proposed [5]. Compared with other algorithms, the K-prototypes algorithm has the advantages of simple and efficient, but the K-prototypes algorithm is more sensitive to the initial clustering center, which also has a negative impact on the clustering accuracy. Since metadata usually appear in the form of JSON, XML, etc. in web engineering, metadata clustering research is mainly embodied in clustering research of XML documents [6]. Typical methods for describing the structure of a document include both trees and vectors. erefore, research to document clustering is usually methodologically translated into trees and vectors to carry out clustering analysis. Feng et al. put forward a new clustering based on K-medoids clustering and the genetic algorithm to enhance the accuracy of the XML document clustering in 2015 [7]. Wang et al. propose a document clustering based on the CFP algorithm (Clustering with Feature Order Preference) in 2016 [8]. Based on the tree structure, Costa and Ortale projected XML documents onto the path from root nodes to leaf nodes and proposed a new clustering method combining XML features with mixing lengths [9]. Since then, with the increasing application of swarm intelligence algorithms, swarm intelligence optimization algorithms have been introduced into the application of clustering algorithms [10]. A new clustering algorithm called K-MWO has been proposed by Kang et al. in 2016. e K-MWO algorithm makes full use of global optimization ability of MWO and local search ability of K-means [11]. A novel clusterability assessment method called Density-based Cluster ability Measure (DBCM) has been proposed by Jokinen in 2019 [12]. e above methods design the corresponding clustering method for the clustering problem of mixed-attribute data and further study the clustering problem of XML documents with structural features. However, due to the structural characteristics of the metadata tree, these clustering algorithms which are mainly suitable for metadata records cannot be directly applied to the clustering of metadata trees. In addition, clustering accuracy of these clustering algorithms, such as the typical K-prototypes algorithm, is not satisfactory. e main objective of this paper is to present a new clustering algorithm for metadata trees. At the same time, improving the accuracy of the K-prototypes clustering algorithm and the loss of critical information in the MFP method is also important contents of this research. e GSO algorithm, brought up by Krishnanand and Ghose, is a new swarm intelligence optimization algorithm [13]. Compared with other swarm intelligence algorithms, the GSO algorithm has more efficient global search advantages and simpler algorithm flow, which is suitable for solving multimodal problems [14]. e clustering accuracy of the K-prototypes algorithm can be improved by the GSO algorithm [15]. In this document, the author combines the improved GSO algorithm and K-prototypes algorithm with the idea of MFP [16] to design a new metadata tree clustering schemes to realize the clustering of metadata tree sets. is paper mainly contains four aspects: first, mine MFPs in the metadata tree set and calculate the feature vectors of these MFPs using the "term frequency and inverted document frequency (TF/IDF)" method [17]; second, combine GSO with K-prototypes to design a metadata tree-oriented clustering method GSOKP; third, employ MFP's feature vector to describe the features of the metadata tree and perform clustering on the feature vector via GSOKP to achieve the clustering of the metadata tree set; finally, establish metadata tree sets as experimental data to test the validity of text algorithms. To sum up, the contributions of this paper mainly include the design of an improved K-prototypes algorithm by the GSO algorithm, an optimization strategy of feature vector calculation of metadata tree, and finally propose a new clustering method for metadata tree sets.

Clustering of Metadata Trees
2.1. Description of the Metadata Tree. Metadata are special data that describe data. Metadata clustering includes the judgment about the similarity of metadata structures and metadata records. Metadata structures are often described using metadata trees. So, clustering for metadata structure similarity can be described as clustering for metadata trees.
To make MD � md 1 , md 2 , . . . , md n , meaning that metadata MD are composed of n metadata elements, wherein md i � d t , d t+1 , . . . , d t+p meaning that metadata elements md i are composed of p subattributes. Each metadata element and subattribute correspond to a node of the metadata tree, and the tree structure shown in Figure 1 is an example of a metadata tree MD.
In a metadata tree, a set of metadata element sequences where the nodes do not recur from the root node to the leaf node is called a metadata path. In Figure 1, for example, 〈MD, md 1 , d 1 〉 is a metadata path.
Definition 3. Similarity between metadata trees. e similarity of metadata trees is primarily measured by the similarity of path sets. Assume that there is a metadata example as shown in Table 1. e metadata example is described as metadata tree Mete, as shown in Figure 2.
Frequent item is a metadata element that occurs frequently in a set of metadata trees. Its frequency is measured by the occurrence rate ρ of the elements in the metadata tree.
at is, the rate of occurrences of the metadata element md i or d j in each metadata tree of metadata tree set T � MD 1 , MD 2 , . . . , MD s }. Set the frequency threshold to be θ. If ρ ≥ θ, md i or d j is a frequent term.
Based on the structure of the data example given in Table 1, the metadata tree SURF shown in Figure 3 can be constructed.
In the metadata set of Mete and SURF, if θ � 100%, the elements contained in both Mete and SURF are frequent items. Assume that the set of frequent items is S. en, S � mdID, mdChar, refData, Title, dsID, Contact, Email,/ { }. (1) Definition 5. Frequent path.

Feature Vectors of Metadata
Trees. e similarity between metadata trees can be measured using the feature vector of the metadata tree to improve computational efficiency. erefore, the TF/IDF method can be used to calculate the weight of each MFP and the feature vector of the metadata tree [17].
If W ij denotes the weight of the jth MFP in metadata tree i, TF ij and IDF j denote the importance of the jth MFP in metadata tree i and in the whole metadata tree set, respectively. en, From the perspective of metadata tree similarity, tree nodes at different levels have different weights in similarity calculation. e root nodes have significantly higher weights than the leaf nodes. So, frequent path node level parameter r ij is introduced in the calculation of TF ij . r ij represents the level of the jth MFP in metadata tree i, i.e., the highest level of the node, and the level of the root node is 1. n ij means the number of occurrences of the jth MFP in metadata tree i. e importance of the j MFP in the metadata tree set is primarily identified by the frequency at which the path appears in the set: where N denotes the total number of trees in the metadata tree set whereas DF j refers to the total number of metadata trees that contain the jth MFP. Take the Mete and SURF metadata set for example. When j � 1, set max R 1 � < /mdID >, and then n 11 � n 21 � 1, r ij � (2, 2), DF 1 � 2, and N � 2. e result is as follows:

Mathematical Problems in Engineering
If there are m MFPs in set max R, metadata tree set T � MD 1 , MD 2 , . . . , MD s contains a total of s metadata trees. en, W ij is an m × s dimensional matrix. e feature vector of metadata tree T i is denoted as TW i � (W i1 , W i2 , . . . , W im ).

Introduction of Key Feature Parameters.
Using the importance of MFP in the metadata to measure the key features of the metadata tree excludes the key features such as root node and metadata tree depth from MFP and its feature vector. is means that introducing the identification information d i of the root node and the depth h i of the metadata tree will allow more accurate identification of the features of metadata tree T i . at is,

Similarity Calculation for Heterogeneous Metadata
Trees.
e similarity between TW i and TW j is computed to identify the similarity between T i and T j in the metadata tree. W ij has numerical characteristics in TW i and TW j , while d i and h i have categorical features. us, the similarity (or integrated distance) of feature vectors TW i and TW j is mainly a combination of dis d(TW i , TW j ) and dis c(TW i , TW j ).
For the calculation of numerical values, Euclidean distance is adopted: For categorical values, the calculation is performed through dissimilarity: Due to different computing methods, there are also significant differences in value ranges. As TW i is a predominantly numerical value, a weighted proportion μ is hence introduced to calculate the integrated distance:

Design of Metadata Tree
Clustering Algorithms

GSO Algorithm.
e GSO algorithm is mainly used to realize optimization by simulating the characteristics of glowworms in terms of luminescence and aggregation [14], and the attraction and aggregation between individual glowworms are primarily achieved by their own brightness (fluorescein value). e steps of this algorithm are described as follows: (i) Step 1: initialize glowworm position Z � z 1 , z 2 , . . . , z n }, and initialize and assign a value to glowworm number n, moving step length s, fluorescein initial value l 0 , and other related parameters. (ii) Step 2: calculate the fitness of the glowworm based on the objective function, i.e., fluorescein value l i (t): In the above, J(x i (t)) denotes the conversion of positions to fluorescein values, ρ means volatility of fluorescein, and c stands for the enhancement ratio of fluorescein. (iii) Step 3: calculate the probability p ij (t) that glowworm z i moves toward the direction of glowworm z j in the field: N i (t) represents the set of glowworms in the field. (iv) Step 4: update the position of each glowworm z i : (v) Step 5: update the radius of the glowworm's decision domain, control the number of glowworms in the field, avoid excessive aggregation of glowworms, and improve the global optimization effect: r i d (t) denotes the perceptual realm of glowworm z i at time t; n t means the threshold of the number of glowworms in the field; r s refers to the radius of the perceptual realm. (vi) Step 6: determine whether the algorithm ends and decides whether to proceed to the next round of iterations until the end of the algorithm.

Flow of the K-Prototypes
Algorithm. K-means is a classic clustering algorithm based on division. e algorithm is mainly suitable for clustering numerical datasets. Based on the K-means algorithm, Huang proposed the K-modes algorithm aimed at categorical datasets. ese algorithms use different methods to calculate the distance between data objects. To realize the clustering of mixture datasets, the K-prototypes algorithm combines the basic methods of the K-means and K-modes algorithm [18]. e flow of K-means, K-modes, and K-prototypes is very similar, but they are suitable for different types of datasets. e K-prototypes clustering algorithm directed at data objects with mixed attributes such as numeric and categorical data. e steps of the K-prototypes algorithm can be described as follows: (i) Step 1: Initialization. Input the category number k of clustering and randomly select k data points in the dataset as the initial cluster center. (ii) Step 2: Clustering. Traverse the whole dataset, calculate the distance between each data point X i and the initial cluster center, take the minimum distance, and assign X i to the corresponding cluster center. us, the dataset can be divided into k nonintersecting cluster sets C � C 1 , C 2 , . . . , C k . there is no change after the original cluster center is updated or the maximum number of iterations is reached, the algorithm terminates; otherwise, it will go to Step 2 and enter the next round of iteration.

GSOKP-FP Design.
GSO, K-prototypes, and MFP are combined to design the GSOKP-FP algorithm to realize the clustering of metadata trees. e framework of this algorithm is shown in Figure 4. GSOKP-FP flow description is as follows: (i) Step 1: identify the MFP in the metadata tree set. According to Section 2.1, filter out the MFPs in the metadata tree set to form an MFP set.
(ii) Step 2: calculate the feature vectors of the metadata tree. According to Section 2.2, calculate the feature vectors of the metadata tree and form a feature vector set. (iii) Step 3: optimize the initial cluster center. Perform GSO algorithm on the feature vector set to solve multiple extreme points in the point set. In the meantime, adopt the GSO algorithm based on the optimization of the good point set to improve the global optimization effect [15]. (iv) Step 4: K-prototypes clustering. Select k extreme points as the initial cluster centers of K-prototypes to carry out the K-prototypes algorithm. (v) Step 5: output the metadata tree clustering results.
According to the K-prototypes algorithm, output k clusters, mark the category of metadata trees, and output the clustering results.
In addition, the part of GSOKP-FP flow for dataset clustering can be named the GSOKP algorithm.

Selection of Datasets.
e experiments in this paper are based on the metadata structure shown in Table 1 to construct a metadata set consisting of metadata trees. e metadata tree nodes are presented in Table 2.
Since the set of leaf nodes can uniquely identify a metadata tree, it is possible to uniquely identify a metadata tree by numbering the leaf nodes. For example, a metadata tree with Root1 can have up to 9 leaf nodes. In other words, it can yield 511 metadata trees (2 9 − 1). In 511 metadata trees with Root1 as the root node, 511 binary numbers can be represented as 000000001 to 111111111 according to the position of leaf nodes. When the number of leaf nodes (without individual root node) is d, and d � 1, there are 9 corresponding binary numbers in 511 binary numbers: 000000001,000000010,000000100, 000001000,000010000, 000100000, 001000000, 010000000, and 100000000. at is, Similarly, the number of binary numbers (metadata trees) under different d values can be calculated with C d 9 . e number of metadata trees with Root1 (or Root2 and Root3) as the root node is shown in Table 3. Also, the number of metadata trees with Root2 and Root3 as root nodes is 511, respectively. e metadata tree for the experiment is selected among a total of 1,533 metadata trees.
Because of the mutual inclusion of metadata trees with different numbers of leaf nodes, two types of datasets are experimentally designed: one is the set of metadata trees with the same number of leaf nodes (no inclusion) and the other is the set of random metadata trees (inclusion).
When d � 7, 108 metadata trees with Root1, Root2, and Root3 as root nodes are recorded as Tset_1, which is taken as the experimental object in the first experiment.
When the number of leaf nodes is random, 1,000 metadata trees with Root1, Root2, and Root3 as the root node are randomly selected and recorded as Tset_2, which is taken as the experimental object of the second experiment.     e larger the value of θ, the fewer frequent paths and the shorter the execution time, but more information of the metadata tree will be lost. e smaller the value of θ, the greater the number of frequent paths, and the less information loss, the longer execution time. erefore, 50% is a median value, which also conforms to the experience of reference [3] on the value of parameter θ.
In Tset_1, the feature vectors of the metadata tree are shown in Table 4.

Experiment 2.
Take metadata tree set Tset_2 as the experimental object.

Analysis of Experimental Results.
e root node information and depths of metadata trees are added to the feature vectors, and the feature vector sets are clustered. Next, the GSOKP-FP algorithm is run to obtain the corresponding experimental results, as displayed in Tables 6 and 7. According to practical results, we focused on comparing the algorithm covered in this paper with other clustering algorithms, such as K-means, K-modes, K-prototypes, KL-FCM-GM, SBAC, EKP, DC-MDACC, and the metadata tree clustering algorithm mentioned in the literature [3] in terms of clustering accuracy, and time complexity. Clustering accuracy refers to the proportion of accurately classified samples to total samples. First, from the perspective of classification accuracy, the comparison information of the algorithm designed in this paper with other intelligent algorithms on some UCI datasets and the K-means, K-modes, and K-prototypes algorithms on metadata tree sets in respect to clustering accuracy is indicated in Tables 8 and 9. e clustering accuracy of other algorithms can be got from the literature [19]. e test given in reference [3] is to cluster four metadata trees by pairwise comparison of their similarity. erefore, the clustering algorithm given in reference [3] can be recorded as MCM-FP is not suitable for large-scale metadata tree set clustering, such as the metadata tree set Tset_1 and Tset_2 in this paper. Compared with other typical clustering algorithms, the test results show that the GSOKP algorithm has higher clustering accuracy, and the algorithm is more suitable for clustering of mixed-attribute data. e advantages of GSOKP in clustering accuracy are mainly due to the following reasons: firstly, the GSO algorithm provides a better initial clustering center for the K-prototypes algorithm, which improves the clustering effect of the K-prototypes algorithm significantly; secondly, a new calculation method of the distance between mixed-attribute data has been designed in the GSOKP algorithm. e calculation method can better describe the distance or similarity between mixed-attribute data. In addition, the test results show that the DC-MDACC algorithm is also excellent. e test results of DC-MDACC are better than the GSOKP algorithm in the test of the dataset Acute and Statlog Heart. e main reason is that a swarm intelligence optimization algorithm is also used in the DC-MDACC algorithm and more preprocessing is performed on the test data. erefore, the time complexity of the DC-MDACC algorithm is higher.
rough the GSOKP-FP algorithm, it is able to achieve better classification accuracy than the conventional K-means Mathematical Problems in Engineering and K-modes methods in both the conditional and random selection of metadata trees to form metadata tree sets. e algorithm designed in this paper is more suitable for the clustering of bigger metadata tree sets, while the method described in the literature [3] is more suitable for the clustering of smaller metadata tree sets.  Next, the algorithm mentioned in this chapter mainly consists of three parts in terms of time complexity: swarm intelligence algorithm for selecting initial cluster centers, K-prototypes algorithm to solve the clustering results, and maximum frequent path mining for constructing the metadata tree dataset. Set the number of glowworms as m, the number of metadata trees as n, and the number of iterations as t. en, the time complexity of the GSO algorithm for solving the initial cluster center can be denoted as O(t × m × n) for convenience. Set t as the number of iterations, n as the number of metadata trees, and k as the number of clusters. en, the time complexity of the K-prototypes algorithm for solving clusters is like this: O(t × k × n), whereby the combined time complexity O(t × (m + k) × n) is obtained. e comparison of time complexity is shown in Table 10, and time complexity of other algorithm can be got from the literature [3,19].
Compared to K-means, K-modes, and K-prototypes, the algorithm covered in this chapter has higher time complexity. e time complexity of the algorithm in this chapter is lower compared to that of the agglomerative hierarchical clustering algorithm stated in the literature [3]. e time complexity of this method mainly consists of two iterative clustering algorithms: creating metadata tree similarity matrices and scanning metadata tree similarity matrices, of which the combined time complexity is about O(n 3 ).

Conclusions
e GSOKP-FP algorithm designed in this paper introduces the GSO algorithm and K-prototypes algorithm into the solution of metadata tree clustering, which enables the clustering of the metadata tree sets by clustering the feature vectors of metadata trees. MFP can better describe the key features of a metadata tree and effectively reduce the dimension of numerical computation and the time complexity. However, since MFP extracts more common information between metadata trees, through which some key information is lost while reducing the numerical dimension. In this paper, information such as root node and tree depth are added to the feature vector described by MFP to improve the computing accuracy of metadata tree similarity and the clustering precision. e experiments show that the GSOKP-FP algorithm designed in this paper is able to achieve a better metadata tree clustering effect.
Data Availability e experimental object (metadata tree sets) used to support the findings of this study has been constructed in this paper. e datasets (Iris, Soybean, Acute, and Statlog Heart) used to support the findings of this study have been deposited in the UCI repository (http://archive.ics.uci.edu/ml/datasets. html).

Conflicts of Interest
e author declares that there are no conflicts of interest regarding the publication of this manuscript.