Recommendation Algorithm in Double-Layer Network Based on Vector Dynamic Evolution Clustering and Attention Mechanism

'e purpose of recommendation systems is to help users find effective information quickly and conveniently and also to present the items that users are interested in. While the literature of recommendation algorithms is vast, most collaborative filtering recommendation approaches attain low recommendation accuracies and are also unable to track temporal changes of preferences. Additionally, previous differential clustering evolution processes relied on a single-layer network and used a single scalar quantity to characterise the status values of users and items. To address these limitations, this paper proposes an effective collaborative filtering recommendation algorithm based on a double-layer network. 'is algorithm is capable of fully exploring dynamical changes of user preference over time and integrates the user and item layers via an attention mechanism to build a double-layer network model. Experiments on Movielens, CiaoDVD, and Filmtrust datasets verify the effectiveness of our proposed algorithm. Experimental results show that our proposed algorithm can attain a better performance than other state-of-the-art algorithms.


Introduction
Information overload is a pervasive problem in our era of big data, being a consequence of the rapid development of the Internet and other information technologies. Recommendation algorithms are one of the most widespread approaches to address this problem [1], whose purpose is to help users to find information quickly and conveniently. Additionally, recommendation systems usually suggest new items using information from previous searches, including product or media recommendation [2,3]. Recommendation systems play a key role in the digital economy, as they allow web services to improve user's experience, increase product sales, and help products to realize their commercial value.
While the literature of recommendation systems is vast, most algorithms can be classified in three categories: content-based [4], collaborative filtering [5], and hybrid recommendation systems [6]. Among these methods, collaborative filtering recommendation algorithms are the most popular in both research and industry, as they can exploit social information better. Moreover, collaborative filtering algorithms can be further divided into three categories: memory-based [7], model-based [8], and hybrid filtering [9]. Among model-based recommendation algorithms, matrix factorization models stand out for their superior speed and strong scalability. In this literature, many matrix factorization models were proposed following the seminal work of Billsus and Pazzani [10]. Recent contributions include nonnegative matrix factorization methods for community detection [11] and dynamic networks [12]. Matrix factorization methods are particularly attractive as they can consider the influence of various factors, while bringing good performance and scalability. Unfortunately, conventional collaborative filtering approaches are not wellsuited to deal with various problems related with the explosive development of information technologies, which often involve sparse data, cold start, or multidimensional data. ese issues are likely to become widespread in the near future due to the continuous increase of online users and items, and hence new approaches that can address these challenges are required. Since the community detection method can be applied to the recommendation system to find the interest communities of the target users, it can effectively achieve personalized recommendation.
On the above basis, the aim of this paper is to establish a double-layer network, apply attention mechanism to connect the double-layer network, and use the vector dynamic evolution clustering method to detect the community of users and items. e main challenges are as follows: (i) Constructing the double-layer network: in this paper, the recommender system is modeled as a double-layer network, and they are the user layer and item layer. Similarity between nodes is the weighted edge between nodes in their corresponding layer. (ii) Applying attention mechanism to connect the double-layer network: this paper puts forward a novel approach to carry out real-time recommendations, which is based on an attention mechanism and forgetting function that are used to fit scores and build relationships between users and items. e attention mechanism allows the algorithm to focus on particularly relevant factors while ignoring others, hence surpassing previous approaches based on limited scores. (iii) Evolving the state vectors to detect the community of users and items: as the community detection method that can be used to find users' interest communities, it can be used to effectively achieve personalized recommendation. Hence, this paper proposes a community detection procedure for users and items, which uses an evolutionary clustering method based on vectorial dynamics. is clustering procedure enables a more accurate representation of the state value than other approaches based on scalar quantities. Our approach then leverages the community structure of users and items, finding neighbor sets of target users via a Cosine similarity method. e efficiency of our approach is confirmed via various simulation experimental results, which show that the attained similarity between attribute and rating information is better than that of other state-of-the-art approaches. e rest of the paper is organized as follows. e state of the art and related work is given in Section 2. en, the proposed algorithm is introduced in Section 3. Section 4 presents experimental results, and finally Section 5 summarises our main conclusions. e convergence analysis of dynamical evolution clustering method in the double-layer network is shown in Appendix.

Related Work
Contemporary recommendation algorithms usually have to deal with challenges including sparse data, cold start, or multidimensional data. To deal with these challenges, Ling et al. proposed a recommendation algorithm for solving cold user problems by applying character capture and clustering methods [13]. Also, West et al. [14] illustrate how clustering technology can be combined with collaborative filtering to improve the recommendation performance. Importantly, as the clustering method divides users and items into several categories and then carries out collaborative filtering recommendation within the class, the recommendation time is greatly reduced. Building up on the well-known k-means clustering algorithm [15], Zahra et al. proposed the different kinds of recommendation algorithms for random selection of initial center of improved k-means clustering algorithm [16]. Because the community detection method can cluster the users with similar interest into the same community, push the users with different interest into different communities, and one can then find the nearest neighbor set in the similar interest community carrying out collaborative filtering. By performing recommendations within the community of the target user not only improves the recommendation accuracy but also reduces the complexity of the algorithm. So, community detection methods have been considered, including the community detection algorithm based on the similarity of paths proposed by Wu et al. [17], and the community detection algorithm is based on the simplification of complex network proposed by Bai et al. [18].
Other focus of study has been scenarios where networks are not static but evolve in time. In these cases, dynamic clustering algorithms are needed in order to obtain an adequate clustering effect. Wu et al. proposed a method for clustering based on dynamic synchronization [19,20], and then we developed community detection approaches based on evolutionary clustering [21,22]. Both methods brought similar users together while making dissimilar items distant, which improved the performance of the clustering algorithms. Bu et al. proposed a dynamic clustering strategy based on the attribute clustering graph [23]. One of the main findings of these works is that dynamical clustering methods tend to enable more efficient recommendation algorithms than traditional clustering methods.
Additionally, researchers have proposed different recommendation algorithms for various scenarios, including recommendation algorithm based on graph network models, attention networks, and multilayer networks. ese are reviewed as follows: (i) Graph network models: graph network has a flexible topology and can express complex relationships. is method treats users and items as nodes and represents relationships as edges between them. Edges are usually weighted and might be directed or undirected. To deal with sparse data and cold start, Moradi et al. applied trust information to the collaborative filtering method by graph clustering algorithm [24]. For cases with strong time constraints, such as financial news, Ren et al. proposed a graph embedding recommendation algorithm based on a heterogeneous graph model [25]. e performance 2 Complexity of recommendation can be greatly improved by exploring the graph network to recommend suitable items to users. erefore, the relationship between the user and the item is represented by a graph network in this paper, so as to dig out more information in recommendation. (ii) Attention mechanism: attention mechanisms are crucial in modulating the user experience and have been leveraged in various engineering applications including image processing and natural language processing. Extending previous recommendation algorithms were driven on user preferences but did not consider user attention. It is a good idea to incorporate the attention mechanism into the recommendation algorithm, which can make the recommendation algorithm more practical. Liang et al. proposed a mobile application for feature interaction through an attention mechanism [26]. At the same time, Feng et al. proposed a recommendation algorithm based on an attention network [27]. e abovementioned work has improved the performance to a certain extent by incorporating the attention mechanism into the recommendation system. erefore, this paper uses the attention mechanism to connect the user layer and the item layer, so as to obtain a large double-layer graph network. (iii) Multilayer networks: while most recommendation algorithms do not consider interactions that can take place between users and items, recent works have proposed to encode them in multilayer networks. Shang et al. proposed a video recommendation algorithm based on a hyperlink multilayer graph model [28]. Yasami proposed a new knowledge-based link recommendation approach using a nonparametric multilayer model of dynamic complex networks [29]. And the methods proposed by them all improve the algorithm based on singlelayer network to some extent. At this time, users can look at the items recommended by the recommendation system for users. Recommendation system is an information filtering scheme and it is based on the user's historical behavior data. e main task of the recommendation system is to predict the rating of the items by users and recommend the items to the users. However, given user history evaluation information (evaluation, rating, and timing), user attribute information (gender, age, occupation, zip code, etc.), and item attribute information (comedy, science, war, etc.), it is a problem to recommend appropriate and interested items to users. Suppose there are m users and n items in a recommendation system. Most recommendation methods work in two ways. On the one hand, a recommendation might be made based on the attributes of the items that users like. For example, if a user likes comedies, then the system will recommend her to choose comedies within the available films. On the other hand, the system might look for the users who have similar preferences to a target user and recommend to the target user what similar users have chosen before.

Algorithm Detail Description.
Here, we give the detail demonstration of our proposed method. Among them, Section 3.2.1 presents the construction of the double-layer network, and Section 3.2.2 presents the vector dynamic evolution clustering method and main convergence analysis. Furthermore, the predicted scores are obtained in each cluster, as shown in Section 3.2.3. Finally, the complete pseudocode and flow chart of our proposed algorithm are shown in Section 3.2.4. e notations and their explanations in this paper are summarized in Table 1.

Network Model Construction.
In this paper, all users and items are treated as nodes in networks, and the state of each node is represented as a vector. e user layer is set up by all users in the system, and the item layer is constructed by all items. e similarity between users is regarded as the edge weight of the user layer. e similarity between items is regarded as the edge weight of the item layer. e user and item layers are connected through attention mechanisms and ratings. In this way, the double-layer network model is formed and a simple example is shown in Figure 1.
(1) Constructing the User Layer Network. Everyone observes the same thing in different angles. In the same way, interests of everyone will be various. According to Movielens dataset, from the perspective of gender, male prefers action movies and female prefers romantic movies. Based on this, to a large extent, people who have similar attribute information have similar interests and preferences. We integrate the score information into the calculation of similarity. Firstly, the ages are divided into three stages: younger than 18, 18 to 55, and older than 55. e occupations are divided into three classes: culture class, leisure class, and management class. e sexes are categorized into male and female. If the user has this attribute, it is 1; and if the user does not have this attribute, it is 0. us, the attribute vector of the ith user is 8dimensional 0-1 vector, denoted as U i . en, attribute similarity between users S attribute U is defined as follows: where U i denotes the attribute vector of the ith user. Define rating similarity between users S rating U as follows: Complexity 3 where Ur i and Ur j denote the score vectors of users i and j with sharing scores on items.
In order to get more consistent with the actual user similarity, the final user similarity obtained by associating user attribute similarity and common rating similarity is defined as follows: (3) Here, α ∈ [0, 1] is a mixture parameter, which is the convex combination of two similarity with different angles. So, the adjacent matrix of user layer is obtained, which can represent the coupling relation between users.
(2) Constructing the Item Layer Network. Similar to the construction of the user layer, this paper integrates the score information and item attribute into the calculation of similarity between items. In MovieLens dataset, there are 19 attributes of movies. If movie has this attribute, it is 1; if movie does not have this attribute, it is 0. us, the attribute vector of the ith item can be represented as a 19 dimensional vector, denoted as I i .
Define attribute similarity between items S attribute I is defined as follows: where I i denotes the attribute vector of the ith item. Define rating similarity between items S rating U as follows: where Ir i and Ir j denote the score vectors of items i and j which are evaluated jointly by the users.
In order to get more accurate relation between items, the final item similarity obtained by associating item attribute similarity and common rating similarity is defined as follows: Here, β ∈ [0, 1] is a mixture parameter, which is the convex combination of two similarities with different angles. So, the adjacent matrix of the item layer is obtained, which can represent the coupling relation between items.

(3) Connections between the User Layer and the Item Layer.
In addition, to establish the relationship in the user layer and the item layer, the connection between the two network layers plays a critical role. German psychologist Hermann Ebbinghaus found that the human brain forgetting rule is as follows: the process of forgetting is very fast, and forget quickly at first, and then slowly [30]. Inspired by Ebbinghaus, we believe that interests of people will also change with time.
e closer the score to the current time is, the better it can express current interests of users. According to fitting the Ebbinghaus forgetting curve, we obtain a forgetting curve more in line with interests and hobbies of the people. e forgetting function proposed in this paper is as follows: Moreover, the fitted coefficients are a � 0.6368, b � − 1.947, c � 0.3623, and d � 0.0025. Additionally, exp(·) is the exponential function. f(t ui ) represents the forgetting degree of uth user to the ith item. t ui represents the time of the uth user rating for the ith item. t min u represents the earliest rating time of user u. t max u represents the latest rating time of user u. en, we use the attention mechanism to connect the user layer to the item layer on the processed score. In daily life, everyone pays attention to different things differently. For example, young girls pay more attention to romantic movies than to war movies, and no one can pay attention to everything. Based on this, we define the attention of the user to the item as follows: Original score of user u to item i t ui Rating time of user u to item i S attribute Attribute similarity between users i and j S rating U Rating similarity between users i and j S U Similarity matrix between users S attribute Attribute similarity between items i and j S rating I Rating similarity between items i and j S I Similarity matrix between items A U Attention matrix of user to item A I Attention matrix of item to user State vector of item node i at time t

Complexity
Similarly, every item is not designed for everyone. Some items target different types of users. So, define the attention of the item to the user as follows: In equations (8) and (9), R ui represents the initial score of the ith item rated by the uth user. R T iu is the score that item i was rated by user u. N u represents the neighbor user set of user u. We view the items evaluated by user u as the item neighbor set of user u. N i represents the neighbor set of item i. We treat all users who have evaluated item i as neighbors of item i. A U (u, i) represents the attention of the uth user to the ith item. A I (i, u) represents the attention of the ith item to the uth user. Obviously, A U and A I are not mutually symmetric matrices.
To illustrate the previous definitions, we give a simple example with three users U 1 -U 3 and four items I 1 -I 4 . R represents the original scoring matrix: A U represents the user attention matrix, obtained by equation (8): 0.0140 0.0012 0 0.0003 0.0008 0.0008 0.0057 0.0001 0.0048 0 0.0008 0 In the original score matrix R, we can find that R 12 � 3 and R 14 � 3. ey have the same scores, but they are A U (1, 2) � 0.0012 and A U (1, 4) � 0.0003 in the attention matrix of users.
at means the attention mechanism is meaningful in this paper.
A I represents the item attention matrix, obtained by equation (9): Besides, in the original score matrix R, we can find that R 11 � 5 and R 31 � 5, but by processing, A I (1, 1) � 0.0109 and A I (1, 3) � 0.0016 in the attention matrix of items. e attention values of the users to the items are the directed edges from the user layer to the item layer, and the attention values of the items to the users are the directed edges from the item layer to the user layer. Experiments show that attention mechanism can greatly improve the recommendation performance.

Dynamic Evolution Clustering in Double-Layer
Network. In recent years, due to the explosion of data, clustering methods emerge endlessly. e clustering method can not only greatly reduce the recommendation time but also improve the recommendation performance. Cluster analysis finds different communities, gathers similar things into one cluster, and pushes dissimilar things in different clusters. Among them, dynamic clustering is more in line with the real situation, so it is applied in various scenarios [19,21,22,[31][32][33][34][35].
e phase of the previous dynamic evolution clustering method is only a scalar, which cannot express the interest of users better. In order to grasp the changing rules of interest in different periods, we propose a vector dynamic evolution clustering method.
In this paper, we propose a vector dynamic evolution clustering method in the user layer as follows: Here, x i (t) and x i (t + 1) represent the state vectors of user node i at time t and time t + 1.
represents the average edge weight of user node i, which is the average similarity between user node i and other users.
where h 1 represents the average value of nonzero elements in attention matrix A U . K 1 , K 2 , K 3 , and K 4 are the clustering coefficients. K 1 and K 3 are the positive coupling coefficients, and K 2 and K 4 are the negative coupling coefficients. e matrix M is defined as follows: Here, M ij represents the influence degree of the ith user attribute on the jth item attribute. V j represents the set of users who have evaluated items in the jth category. W i represents the set of users with the ith attribute. e purpose of adding matrix M to the evolution equation is to emphasize the different influences of different user attributes.
In the same way, we propose the vector dynamic clustering method in the item layer as follows: Complexity 5 Among them, y i (t) and y i (t + 1) represent the state vectors of item node i at time t and time t + 1.
where Ave(S I i ) represents the average edge weight of user node i, that is, the average similarity between item node i and other items.
where h 2 represents the average value of nonzero elements in attention matrix A I . K 5 , K 6 , K 7 , and K 8 are the clustering coefficients. K 5 and K 7 are the positive coupling coefficients, and K 6 and K 8 are the negative coupling coefficients. M T is the transpose of the matrix M. e purpose of adding matrix M T to the evolution equation is to emphasize the different influences of different item attributes.
Besides, this community detection evolution process can be stable after some iterations. e convergence results are obtained from the following theorems according to Lyapunov theory. (13) and (15) can be converted into the following forms:

Theorem 1. Vector dynamic evolution process equations
Proof. See it in the Appendix, in the end of this paper. □ Theorem 2. If appropriate parameters K 1 , K 2 , K 3 , K 4 , K 5 , K 6 , K 7 , and K 8 make the θ < 0 and ω < 0, then the fixed points in equations (13) and (15) are uniformly stable.
Proof. See it in the Appendix, in the end of this paper. e convergence analysis shows that our community detection algorithm will be stable after some iterations. Finally, the user nodes with similar state vectors and item nodes with similar state vectors are assigned to the same community, that is, all users and all items with higher similarity are assigned to their community with similar interest.

Score Prediction and Recommendation.
In order to sort the user similarity of the same community and obtain the nearest neighbor set of the target user for collaborative filtering recommendation, Cosine similarity is used in this paper to calculate the community similarity: To compare different similarity indexes, Pearson correlation coefficient and adjusted Cosine similarity [36,37] are adopted: Here, R ui represents the score of the ith item is rated by the uth user, S uv represents the set of items both scored by users u and v, R u represents the average score of user u, and S u represents the set of items scored by user u. rough the above methods, the similarity ranking of target users within the community can be obtained, and the score can be predicted.
Previous prediction methods did not take into account the item community and averaged all item scores, which could not better express the score of target users in the community of target items. In order to better reflect the role of the community, this paper proposes the following methods to predict the score: Here, C i is the community of item i, R uC i is the average score of user u to the ith item community, N u represents the nearest neighbor set of user u, P ui represents the prediction score of target user u for item i, Sim uv represents the similarity value between users u and v, and R u represents the average score of user u.

Algorithm Flowchart.
is paper presents a recommendation algorithm in Double-layer Network based on Vector dynamic evolution Clustering and Attention mechanism (denoted as DN-VCA).
e pseudocode is shown in Algorithm 1.
Firstly, we use node attribute information to construct an undirected network in the layer. Secondly, connect double layers of networks with attention mechanism so that a double-layer network connection is established as directed relationship.
irdly, community detection is carried out according to vector dynamic evolution clustering. Fourthly, according to the new prediction method proposed in this paper, score prediction is carried out. Finally, we give a list of recommendations. e flow chart of the algorithm proposed in this paper is shown in Figure 2

Datasets.
To verify the effectiveness of the model and our proposed algorithm, Movielens-100k, CiaoDVD, and Filmtrust datasets are tested in this paper.
(i) Movielens-100k 1 : MovieLens is a set of movie ratings. e dataset contains 100,000 ratings provided by 943 users for 1682 movies, and scores are 1-5. Each score has its corresponding time. e dataset also has user attribute information and movie category information. Each user has at least 20 score records. e data sparsity is 93.7%. (ii) CiaoDVD 2 : the dataset contains 278,483 ratings provided by 7375 users for 99746 DVDs, and scores are 1-5. As the sparsity of this dataset was 99.97%, we retain the users with more than 20 evaluation DVD and the DVD with more than 20 evaluation values so that the sparsity after 6 Complexity processing is 97.01% and the processed dataset is denoted as CiaoDVD-1. (iii) Filmtrust 3 : the dataset contains 35,497 ratings provided by 1508 users for 2071 movies, and scores are 0.5-4 in intervals of 0.5. e data sparsity is 98.86%. Moreover, most items have not been evaluated by users, so we only keep the items that have been evaluated more than 3 times. At the same time, we delete the users whose evaluation times are less than 3 times. Finally, the data sparsity was slightly reduced to 96.61% and the processed dataset is denoted as Filmtrust-1.
e original dataset is randomly divided into 80% training set and 20% test set to verify the proposed algorithm on three datasets. In addition, all the algorithms in this paper have conducted five cross experiments, and finally, the Predict scores in each community   (6), (8) and (9).

Recommendation list
//Community detection in double-layer network for each node do Apply vector dynamic evolution clustering equations (13) and (15) to find the appropriate community for each node. If ‖x i (t + 1) − x i (t)‖ < ε 1 and ‖y j (t + 1) − y j (t)‖ < ε 2 then all nodes stop iterating end if end for //Calculate the dynamic similarity for each user community and item community do Apply equation (17) to calculate the similarity matrix in the same community. end for //Prediction score for each target user and target item do Find the neighbor set of the target user by similarity sort. Compute the prediction score according to equation (19) Table 2 gives the statistics of three datasets.

Evaluation Indexes.
In order to verify the accuracy of the algorithm proposed in this paper, we use the following five evaluation indicators: Here, MAE is the mean absolute error, RMSE is the root mean squared error, R ui represents the true score of item i by user u in the test set, P ui represents the prediction score generated by the algorithm, and M represents the number of scores be predicted in the test set. Fixing integer processing is conducted on Movielens and CiaoDVD-1 datasets, but the scores on Filmtrust-1 are floating point numbers with 0.5 as the interval, so no integer processing is performed on this dataset.
Since we present recommendations to target users after the prediction, the following three indexes are used to verify the efficiency of recommendations: Here, R u represents the set of items recommended by the algorithm for the target user u and T u represents the set of items that target user u really likes in the test set. Precision indicates the proportion of the items the user really likes in the recommendation list to the total number of recommendations. Recall represents the ratio of the favorite items of users in the recommendation list to the favorite items of the user. F 1 value is a comprehensive indicator of Precision and Recall.

Parameter Analysis.
ere are several parameters in our proposed algorithm and we will discuss their influences in the recommendation performance. As shown in Figure 3(a), when α � 0 and β � 0, that is, user similarity and item similarity only contain score information, MAE � 0.7085. When α � 1 and β � 1, that is, user similarity and item similarity only contain attribute information, MAE � 0.7637. When α � 1 and β � 0, that is, user similarity only contains attribute information and item similarity only contains score information, MAE � 0.7087.
When α � 0 and β � 1, that is, user similarity only contains score information and item similarity only contains attribute information, MAE � 0.7634. From the results, we can see that MAE � 0.7045 is the lowest, as α � 0.3 and β � 0.4, in other words, the experimental results show the best when the similarity includes both score information and attribute information. Similarly, as shown in Figure 3(b), RMSE � 0.9947 is lowest when α � 0.3 and β � 0.4. In summary, α � 0.3 and β � 0.4 on Movielens dataset in the following experiment. Because there is no attribute information in CiaoDVD-1 and Filmtrust-1 datasets, so α � 0 and β � 0. e influence of thresholds ε 1 and ε 2 in termination criteria: in order to obtain stable state vectors of nodes more accurately and faster, we limit the number of iterations of dynamic evolution clustering equations. If the state difference between the front and back vectors is less than the threshold, iteration is terminated. We selected several pairs of user layer threshold ε 1 and item layer threshold ε 2 for experiments.
As shown in Figure 5, on the CiaoDVD-1 dataset, both MAE and RMSE are the lowest when ε 1 � 2.1 and ε 2 � 2.1, except for the prediction when the number of neighbors is 90. So, on the CiaoDVD-1 dataset, we choose ε 1 � 2.1 and ε 2 � 2.1 for following experiments.
As it can be seen from Figure 6, MAE � 0.6164 when ε 1 � 0.01 and ε 2 � 0.01, and the number of neighbors is 60. When ε 1 � 0.001 and ε 2 � 0.001, MAE � 0.6155. When the neighbor number is taken into other values, both MAE and RMSE of ε 1 � 0.01 and ε 2 � 0.01 are the lowest, that is, the prediction effect is the best. As a result, the two threshold values selected in the experiment on Filmtrust-1 dataset in this paper are ε 1 � 0.01 and ε 2 � 0.01.
In this paper, only four pairs of parameters are selected for comparison on each dataset, and finally the threshold values with the best effect are selected. In fact, thresholds other than the above can lead to better predictions.

Comparing Similarity.
In order to get better results, we choose one of Cosine similarity, Pearson correlation coefficient, and adjusted Cosine similarity, so we conducted experiments on the Movielens dataset.
As shown in Figure 7, because MAE and RMSE of Cosine similarity are lower than Pearson correlation coefficient and adjusted Cosine similarity regardless of the number of neighbors, we select Cosine as the measure of dynamic similarity within the community.

Comparing Results of Different Recommendation
Algorithms. In this paper, our proposed algorithm (DN-VCA) is compared with three existing algorithms from Collaborative Filtering recommendation algorithm based on K-means clustering (named as K-CF), Ref. [ Figure 8 shows the clustering results based on our double-layer network evolutionary clustering method. Six communities are formed for Movielens-100k.
As shown in Figure 9, regardless of the number of neighbors, the MAE values and RMSE values of our DN-VCA are lower than the other three compared algorithms. e reason our DN-VCA has a good performance is that double-layer network can better represent the relations between users and items. Moreover, our prediction method is no longer based on the user community, but adds the item community into the prediction method, highlighting the role of the item community.
Next, we present the Top-N recommendation list for the user, and select the set of recommended number as [2,4,6,8,10,12,14,16,18,20]. e comparison results of Precision, Recall, and F 1 are shown in Table 3.

Complexity
As shown in Table 3, as the number of recommendations changes, Recall and F 1 values will increase, while the Precision will decrease. Compared with algorithm DTNM, EHC-CF, and K-CF, our DN-VCA has a slightly higher advantage in Precision, Recall, and F 1 values.

CiaoDVD-1.
To further test the performance of the algorithm, we test many experiments on the CiaoDVD-1 dataset.As shown in Figure 10, because the sparsity of this dataset is very large, the result of the algorithm has a strong oscillation. However, no matter how many neighbors we have, the MAE and RMSE values of our DN-VCA are lower than the other three compared algorithms, except that when the number of neighbors is 20, and the MAE and RMSE values are slightly higher than EHC-CF. Table 4, compared with algorithm DTNM and K-CF, our DN-VCA has a significant advantage, and our DN-VCA is very close with EHC-CF. In general, the DN-VCA algorithm we proposed is higher than the other three algorithms in MAE, RMSE, Precision, Recall, and F 1 values.

FilmTrust-1.
Different from the previous three datasets, the scale of this dataset is 0.5, so in the final prediction results, the experiments in this paper do not conduct rounding processing on the predicted scores.
It can be seen from Figure 11 that the DN-VCA proposed in this paper is slightly lower than EHC-CF when the number of neighbors is 10, and the MAE of EHC-CF is 0.6365, while the MAE of DN-VCA is 0.6371. When the number of neighbors is taken as other values, the accuracy of      As shown in Table 5, each of the four algorithms gives similar results in Precision, Recall, and F 1 values. However, DN-VCA that we proposed has the best results, which are optimal in Precision, Recall, and F 1 values except that when the number of recommendations is 18, the F 1 value of DN-VCA is lower than 0.0068 of K-CF, the Precision of DN-VCA is lower than 0.006 of K-CF, and the Recall of DN-VCA is lower than 0.0077 of K-CF. DN-VCA obtained the best recommendation result when the number of recommendations is 20.
Experimental results on three datasets show that MAE and RMSE of our proposed DN-VCA are lower than the other four comparison algorithms in predicting scores, so our proposed algorithm is effective in predicting scores. In addition, in terms of recommendation, DN-VCA also achieves better results than other algorithms in Precision, Recall, and F 1 values. e K-CF and EHC-CF of the three comparison methods are recommendation algorithms based on clustering algorithms. Our results show that our vector dynamic evolution clustering algorithm outperforms these other clustering algorithms, hence suggesting that our proposed method can also be effective for generating recommendations. So, it proves that the algorithm we proposed is effective in the recommend system. at means our double-layer network construction is meaningful and the dynamic clustering in the double-layer network can gather the similar interest users together to the same community. Neighbor users with high similarity give valuable suggestions in the collaborative filter recommendation process.

Conclusion
In this paper, a novel vector dynamic evolutionary clustering recommendation algorithm DN-VCA based on double-layer network and attention mechanism is proposed. Our algorithm firstly constructs a double-layer network model through node similarity and an attention mechanism. en, the improved vector dynamic evolution clustering equation  is used in the double-layer network to cluster the nodes into the most suitable community. Finally, the similarity between nodes is calculated within the community for enabling collaborative filtering recommendation. We not only verify the validity of the DN-VCA, but also prove the theoretical results of the algorithm. Additionally, we solve the shortcomings of the existing methods. For example, previous algorithms are only based on the single-layer network, and the state of nodes is only a scalar when clustering is dynamically evolving. With the development of big data, the recommendation system faces more and more users and items. It is impossible for us to carry out similar comparison with all users for collaborative filtering based on users, and the vector dynamic evolution clustering proposed in this paper is a good community detection method to solve this problem. Please note that our algorithm has a number of degrees of freedom that are highly nontrivial to optimize. Actually, our results do not use optimal parameters values; if those parameters could be further optimized then the performance of our algorithm would further improve. Finding efficient optimization methods for these parameters constitute an interesting field of future research.

A. Proof of Theorem 1
In order to evolve the double-layer network model, the following matrices are firstly defined: . . , n, j � 1, . . . , n , (A.1) Matrix P + keeps the elements of Att U ij ≥ h 1 , and the rest are all 0. Matrix Q + keeps the elements of Att I ij ≥ h 2 , and the rest elements in Q + are all 0. And similarly, matrix P − keeps the elements of Att U ij < h 1 , and the rests are all 0. Matrix Q − keeps the elements of Att I ij < h 2 , and the rest elements in Q − are all 0. U + and U − contain elements that satisfy S U ij ≥ Ave(S U i ) and S U ij < Ave(S U i ), and the other elements are all 0. Matrix I + contains all elements that are greater than or equal to the mean similarity of each item. Matrix I − contains all elements less than the mean similarity of each item, and all other elements are equal to 0. Theorem A.1. Vector dynamic evolution process equations (13) and (15) can be converted into the following forms:

Complexity 15
And finally, we define the matrix D + as follows: (A.11) e composition of the matrix D − is the same as the composition of the matrix D + , and the element source is the matrix P − . Based on the above definitions, x(t + 1) can be further transformed: (A.13) en, we have (A.14) (ii) Similarly, the item layer vector dynamic evolution quation 15 can also be in a similar form.
Proof. Since any isolated equilibrium state can be moved to the origin of the state space by coordinate transformation, we only discuss the stability of the equilibrium state at the origin of the coordinates. Lyapunov function is defined as follows:

S + S T + S T S x(t) + x(t) T T + S T T y(t) + y(t) T T T + T T S x(t) + y(t) T T T Ty(t) < 0, ω � y(t) T G + G T + G T G y(t) + y(t) T H + G T H x(t) + x(t) T H T + H T G y(t) + x(t) T H T Hx(t) < 0, (B.4)
according to the stability theory of Lyapunov [34], the fixed points in equations (13) and (15) are uniformly stable. In fact, given the proper values of K 1 , K 2 , K 3 , K 4 , K 5 , K 6 , K 7 , and K 8 , the stability condition can be achieved.
e above theoretical analysis shows that the evolution process of the vector dynamic evaluation equations is consistent and stable. As time goes on, the state vectors of the nodes are stable and the clustering results are discovered.
In fact, the condition of θ < 0 and ω < 0 can be easily satisfied and we can find clustering parameters K 1 , . . . , K 8 with a wide value range.

Data Availability
Firstly, the data used to support the findings of this study are all open online and we have listed in the article on page 8. ( https://grouplens.org/datasets/movielens/100k/, http:// www.public.asu.edu/jtang20/datasetcode/truststudy.htm, and https://www.librec.net/datasets/filmtrust.zip) Secondly, the Matlab code used to support the findings of this study are available from the corresponding author upon request.