# An Algorithm for Finding Optimal \(k\)-Core in Attribute Networks
## 1 Introduction  
Graphs are often used to represent complex network structures containing large-scale entities, where vertices denote entities and edges illustrate relationships between entities. Common ones include co-authorship relationships in scholar networks [1], friend relationships in social networks [2; 3], and protein reaction relationships in biological networks [4; 5]. Dense subgraph search has attracted widespread attention from scholars, especially community search based on personalized query conditions such as query vertices and structural indicators. Unlike traditional community detection, community search can complete personalized search tasks, making the target subgraph easier to interpret. As an important community search model, \(k\)-core requires each node in the subgraph to have at least \(k\) neighbors. Compared with clique, quasi-clique, densest subgraph, \(k\)-truss, etc., \(k\)-core has become the basis of many dense subgraph algorithm models and has been widely used in industry and academia due to its simple structure and efficient calculation. Even though the \(k\)-core has a lot of advantages, we find that many algorithm models are overly idealized when attempting to determine the \(k\) value during query execution. Sometake the median as \(k\) for queries based on empirical analysis of the dataset, while others are manually specified by the user. It should be noted that different datasets show differences in terms of their characteristics. When employing different structural evaluation indicators such as independence, maximum density, and conductivity, the scoring trend may not necessarily be positively (or negatively) associated with \(k\). As for manual assignment, its uncertainty is greater, and once users are not familiar with the network, the performance of the model will be greatly reduced. Therefore, this article aims to globally search for the optimal \(k\)-core containing the specified query vertices. In addition, with the continuous improvement of sensor devices, entities' semantic features have become richer, and attribute networks [6; 7; 8; 9] have emerged. People are no longer satisfied with utilizing only structural features to characterize entity relationships in the target network. To improve the semantic interpretability of queries, many models have added attribute correlation evaluation indicators to compensate for semantic deficiencies in simple graphs. However, there is no unified attribute scoring function to evaluate the attribute correlation of subgraphs. Different algorithm models design different attribute rating functions for diverse networks and objectives. To adapt to more application scenarios, we extract the primary keys from different attribute scoring functions in order to grasp their essence. Given the attribute graph, an attribute scoring function, a query vertex set, and a query attribute set, the goal of this article is to find a \(k\)-core that contains query vertices and has the highest attribute rating. This can directly solve the problem of missing the optimal solution due to improper \(k\) value selection and can also serve as the basis for other algorithm models. A basic algorithm is to find all \(k\)-cores containing query vertices, calculate scores one by one, and return the optimal solution. However, the large computational cost makes it unsuitable for large attribute graphs. Hence, this article proposes an algorithm for searching for the optimal \(k\)-core on the attribute networks, integrating structural and attribute indicators, and constructing an index forest, which can improve adaptability and speed. Our main contributions are as follows:  
1. Propose the idea of an attribute-optimal \(k\)-core. Since it is possible to miss the optimal solution by determining \(k\) through empirical analysis or manual selection, this article searches for the optimal \(k\)-core on an attribute graph as the target community to find the optimal solution to the problem. 2. Propose the advanced query algorithm.