Histogram-based K-core method, device, equipment and storage medium

Through the histogram-based K-core algorithm, the contradiction between the calculation speed and scalability of the K-core decomposition algorithm in the existing technology in large-scale graph data processing is solved, and efficient calculation and scalability are achieved. By reducing the need for adjacency Point traversal improves algorithm efficiency and supports parallel computing.

CN114756822BActive Publication Date: 2024-09-17WUHAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210368301.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-02
Publication Date
2024-09-17
Estimated Expiration
2042-04-02

AI Technical Summary

Technical Problem

When existing K-core decomposition algorithms process large-scale graph data, there is a contradiction between computing speed and scalability, and they cannot achieve efficient computing and scalability at the same time.

Method used

The K-core algorithm based on histogram is used to establish the histogram of each node and perform forward convergence and reverse broadcast iteration until the histogram of all nodes does not change, thereby determining the steady-state core number and reducing the number of adjacencies. Point traversal improves algorithm efficiency.

Benefits of technology

It is possible to improve the calculation speed of the K-core algorithm while maintaining scalability, reduce the number of adjacent point traversals, improve the algorithm efficiency, have the calculation speed of the approximate stripping algorithm, and support parallel computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114756822B
    Figure CN114756822B
Patent Text Reader

Abstract

The present invention discloses a K-core algorithm, device, equipment and storage medium based on histogram, and relates to the technical field of K-core decomposition algorithm, the method comprising: establishing a histogram of a corresponding node according to the degree distribution of the neighboring points of each node; based on the current histogram, forward convergence and reverse broadcasting are performed on the nodes involved to complete one iteration, and the histogram of the node whose core number changes during the forward convergence and reverse broadcasting is modified; the iterative process is repeated, and the length of the histogram of all nodes when it does not change is used as the steady-state core number of each node. The algorithm in the present invention can ensure the calculation speed while having scalability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of K-core decomposition algorithms, and in particular to a histogram-based K-core algorithm, device, equipment and storage medium. Background Art

[0002] With the explosion of data in the era of the Internet of Everything, the scale of network data has become extremely large, and the graph structure has become increasingly complex. There are already mature distributed algorithms and external memory algorithms to solve the problem of excessive data volume. The large amount of communication between nodes is also the bottleneck of the algorithm. Although it can solve the computational problems of very large graphs, it cannot accelerate the calculation. For the problem of parallel acceleration, there are some algorithms based on multi-core CPUs and shared memory, and a small number of algorithms based on GPUs. Due to the limitations of the number of CPU cores and memory bandwidth, high-performance computing requirements cannot be met.

[0003] K-core decomposition algorithm is one of the basic operators of graph mining, which is used to find closely related subgraph structures that meet the specified coreness in the graph, where each node in the subgraph has at least K neighbors. K-core decomposition is the most basic method to measure the importance of nodes. This problem and its related variants, such as core number, K-shell, and degenerate sorting, are widely used in scenarios such as user analysis and visualization of social networks, and analysis of network origins and evolution processes.

[0004] The K-core algorithm has two main strategies:

[0005] (1) Layer-by-layer peeling strategy. This strategy iteratively deletes the point set with the smallest degree and the corresponding edge from the bottom up, and sets its core number to its current degree until the core number of all points is determined.

[0006] (2) Local convergence strategy. This strategy estimates the number of cores of a node from top to bottom based on the number of cores of its neighboring points, then performs back propagation to re-estimate the neighboring points, and iterates the process until the number of cores of all nodes no longer changes.

[0007] Layer-by-layer peeling is a strategy to directly solve the K-core that meets the conditions. The iterative process requires traversing the entire graph, accessing all node degrees, finding nodes that meet the conditions, and then reducing the degrees of adjacent points by one.

[0008] When calculating the number of cores, the local convergence strategy first traverses the adjacent points for forward convergence to obtain a new coreness value, named coreness new , and then traverse coreness again new ≠coreness oldThe local convergence strategy performs back propagation on the neighboring points. Compared with the stripping strategy, which needs to traverse the entire graph, the calculation process only needs to visit the neighboring points, and does not need to visit the entire graph. Therefore, the local convergence strategy has good scalability and is suitable for distributed environments or external memory computing to solve ultra-large-scale K-core problems.

[0009] In contrast, the layer-by-layer peeling algorithm traverses the adjacent points less frequently, is faster, has poor scalability, and is suitable for memory-based K-core problems. It can be seen that both the layer-by-layer peeling strategy and the local convergence strategy have their own problems. Summary of the invention

[0010] In view of the defects existing in the prior art, the first aspect of the present invention provides a histogram-based K-core algorithm, which has scalability and can ensure calculation speed at the same time.

[0011] In order to achieve the above purpose, the technical solution adopted by the present invention is:

[0012] A K-core algorithm based on a histogram, the method comprising the following steps:

[0013] Establish a histogram of the corresponding node according to the degree distribution of the neighboring points of each node;

[0014] Based on the current histogram, forward convergence and reverse broadcast are performed on the involved nodes to complete one iteration, and the histogram of the node whose core number changes during the forward convergence and reverse broadcast process is modified;

[0015] The iterative process is repeated, and the length of the histogram of all nodes when it does not change is taken as the steady-state core number of each node.

[0016] In some embodiments, the step of establishing a histogram of the corresponding node according to the degree distribution of the neighboring points of each node includes:

[0017] Initialize the number of cores of each node to the degree, and the degree of each node is the number of neighboring nodes of the node;

[0018] According to the degree of a node, determine the degree value type of the degree distribution of the neighboring points of the node, and count the number of the degree of the neighboring points of the node under each degree value;

[0019] The degree value type is used as the histogram length, and the number of nodes under each degree value is used as the histogram data to establish the histogram of the corresponding node.

[0020] In some embodiments, determining the degree value type of the degree distribution of the neighboring points of a node according to the degree of the node includes:

[0021] When the degree of a node is N, the degree value types of the degree distribution of the neighboring points of the node are determined to be N, where N is a natural number.

[0022] In some embodiments, based on the current histogram, forward convergence and reverse broadcasting are performed on the involved nodes to complete one iteration, and the histogram of the node whose number of cores changes during the forward convergence and reverse broadcasting is modified, including:

[0023] Taking the current histogram length as the current core number of each node, determine the set of active nodes that cannot maintain the current core number due to insufficient support;

[0024] Update the number of cores of the nodes in the active node set so that the updated number of cores is as large as possible while having sufficient support, and modify the length and data of the histogram of the nodes in the active node set based on the updated number of cores to complete the forward convergence of the nodes;

[0025] Determine the neighboring point sets for which the nodes in the active node set cannot provide support for their neighboring points;

[0026] The core number of the nodes in the neighbor point set is updated so that the nodes in the active node set can provide support for the nodes in the neighbor point set, and the length and data of the histogram of the nodes in the neighbor point set are modified based on the updated core number to complete the reverse broadcast of the nodes.

[0027] A second aspect of the present invention provides a device for implementing a histogram-based K-core algorithm, which has scalability and can ensure calculation speed.

[0028] In order to achieve the above purpose, the technical solution adopted by the present invention is:

[0029] A device for implementing a histogram-based K-core algorithm, comprising:

[0030] A generation module, which builds a histogram of each node based on the degree distribution of its neighbors;

[0031] The iteration module performs forward convergence and reverse broadcast on the involved nodes based on the current histogram to complete one iteration, and modifies the histogram of the nodes whose core numbers change during the forward convergence and reverse broadcast process;

[0032] The iteration module is also used to repeat the iteration process, taking the length of the histogram of all nodes when it does not change as the steady-state core number of each node.

[0033] In some embodiments, the generating module establishes a histogram of the corresponding node according to the degree distribution of the neighboring points of each node, including:

[0034] Initialize the number of cores of each node to the degree, and the degree of each node is the number of neighboring nodes of the node;

[0035] According to the degree of a node, determine the degree value type of the degree distribution of the neighboring points of the node, and count the number of the degree of the neighboring points of the node under each degree value;

[0036] The degree value type is used as the histogram length, and the number of nodes under each degree value is used as the histogram data to establish the histogram of the corresponding node.

[0037] In some embodiments, the generation module determines the degree value type of the degree distribution of the neighboring points of a node according to the degree of the node, including:

[0038] When the degree of a node is N, the degree value types of the degree distribution of the neighboring points of the node are determined to be N, where N is a natural number.

[0039] In some embodiments, the iteration module performs forward convergence and reverse broadcast on the involved nodes based on the current histogram to complete one iteration, and modifies the histogram of the node whose core number changes during the forward convergence and reverse broadcast process, including:

[0040] Taking the current histogram length as the current core number of each node, determine the set of active nodes that cannot maintain the current core number due to insufficient support;

[0041] Update the number of cores of the nodes in the active node set so that the updated number of cores is as large as possible while having sufficient support, and modify the length and data of the histogram of the nodes in the active node set based on the updated number of cores to complete the forward convergence of the nodes;

[0042] Determine the neighboring point sets for which the nodes in the active node set cannot provide support for their neighboring points;

[0043] The core number of the nodes in the neighbor point set is updated so that the nodes in the active node set can provide support for the nodes in the neighbor point set, and the length and data of the histogram of the nodes in the neighbor point set are modified based on the updated core number to complete the reverse broadcast of the nodes.

[0044] A third aspect of the present invention provides a device which, when implementing a histogram-based K-core algorithm, has scalability while ensuring calculation speed.

[0045] In order to achieve the above purpose, the technical solution adopted by the present invention is:

[0046] A device comprises a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the above-mentioned histogram-based K-core algorithm are implemented.

[0047] A fourth aspect of the present invention provides a computer-readable storage medium, which, when implementing a histogram-based K-core algorithm, has scalability while ensuring calculation speed.

[0048] In order to achieve the above purpose, the technical solution adopted by the present invention is:

[0049] A computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the above-mentioned histogram-based K-core algorithm are implemented.

[0050] Compared with the prior art, the advantages of the present invention are:

[0051] The histogram-based K-core algorithm in the present invention converts the temporary distribution array obtained by the convergence operation of the convergence algorithm into a global array, and there is no need to repeatedly traverse the adjacent points to obtain the distribution array. The algorithm iteration process records the coreness distribution of the adjacent points for each node as a global array, and obtains the coreness according to this array. new , and then modify the global distribution array of the neighboring points. The nodes whose global distribution arrays have changed are used as the active nodes for the next round, until the coreness of all nodes no longer changes and the algorithm converges. The difference is that the cnt of the node becomes a statistical distribution array. This reduces the traversal of the neighboring points and converts it into a statistical distribution array for accessing the node.

[0052] The algorithm in the present invention uses the method of replacing time with space to improve the efficiency of the algorithm, and still uses a node-centric calculation method, which inherits the scalability of local convergence. By accessing the global histogram array of the node, the traversal of the adjacent points is reduced once, and it has a calculation speed similar to that of the stripping algorithm. At the same time, the algorithm can be designed as a node-centric parallel algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 A flow chart of a layer-by-layer peeling strategy and a local convergence strategy in the prior art;

[0054] Figure 2 is an example graph of nodes;

[0055] Figure 3 is a flow chart of a histogram-based K-core algorithm in an embodiment of the present invention;

[0056] Figure 4 for Figure 3 Flow chart of step S1 in FIG.

[0057] Figure 5 for Figure 3 Flow chart of step S2;

[0058] Figure 6 Schematic diagram of the first stage of the iterative algorithm in an embodiment of the present invention;

[0059] Figure 7 is a schematic diagram of the second stage of the iterative algorithm in an embodiment of the present invention;

[0060] Figure 8 is a schematic diagram of the third stage of the iterative algorithm in an embodiment of the present invention;

[0061] Fig. 9 is a schematic diagram of the fourth stage of the iterative algorithm in an embodiment of the present invention;

[0062] Fig.10 is a schematic diagram of the fifth stage of the iterative algorithm in an embodiment of the present invention;

[0063] Fig.11 Schematic diagram of the final stage of the iterative algorithm in an embodiment of the present invention. DETAILED DESCRIPTION

[0064] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0065] It should be noted that, in order to facilitate understanding of the content of the present invention, the two strategies of the K-core algorithm are first explained as follows:

[0066] The concept of K-core is that each node has at least K neighboring points. If an undirected graph is a complete graph with five nodes, and the degree of each node is 4, then this is a 4-core, and also a 3-core, 2-core, and 1-core. A node may be in multiple K-cores, and the K value of the largest K-core is recorded as the core number or steady-state coreness. The support is for the K-core in which it is located. For an undirected graph with five nodes, each node is in a 4-core, and each node's neighboring points can provide it with a support that can make it a 4-core.

[0067] The upper bound of the coreness value of a node is its degree, and the core number represents the steady-state coreness of the node. However, the coreness of these nodes is uncertain whether it is in a stable state. When it is in an unstable state, it is called transient coreness. Transient coreness is just an intermediate value between the degree and the steady-state coreness, which is the value that appears during the algorithm iteration. When the algorithm iterates until the coreness of all nodes remains unchanged, it can be judged that the coreness of all nodes is in a steady state, that is, the steady-state coreness value or core number of all nodes is calculated.

[0068] The local convergence strategy actually uses the concept of H-index. The degree is the zero-order value of the H-index, the core number or the steady-state coreness is the infinite-order value of the H-index, and the transient or unstable coreness must be a value in between the two, that is, less than or equal to the degree and greater than or equal to the core number. In the following text, coreness mostly refers to unstable coreness, that is, coreness during the iteration process, or the upper bound of coreness. The core number is only called after the algorithm ends.

[0069] The main memory-based K-core algorithm is the BZ algorithm. This algorithm adopts a layer-by-layer peeling strategy. Its main calculation steps are to initialize K as the value with the lowest node degree in the graph, delete all nodes with node degrees less than or equal to this value and their corresponding edges in the graph and mark them as core number K, and iterate the process until the remaining node degrees are greater than this value. Repeat this process until all nodes are deleted, and the core number of all nodes is calculated. For the specific process, see Figure 1 The layer-by-layer peeling process on the left. The first iteration iterates the degrees of all nodes, deletes the points with degrees less than 1, sets their coreness to 1, deletes the corresponding edge (5,1), and reduces the degree of node 1 by one. At this time, the degrees of all nodes are greater than 1. The second iteration traverses all node degrees, deletes nodes and edges with degrees less than or equal to 2, that is, deletes node 4, sets its coreness to 2, and reduces the degrees of nodes 1 and 7 by one. Repeat this process until all nodes are deleted, at which point the core numbers of all nodes have been determined.

[0070] The external memory-based K-core algorithm mainly includes semiCore. The locality theorem of K-core is as follows: A necessary and sufficient condition for a node to have a corenumber of k is that at least k adjacent nodes have a core number greater than or equal to k and at most k adjacent nodes have a core number greater than or equal to k + 1. This algorithm is centered around nodes. Initially, the coreness value of each node is set to its degree. First, forward propagation is performed. According to the locality theorem, the coreness values of adjacent nodes are traversed to calculate its coreness value, and a cnt value is recorded to represent the support degree of adjacent nodes for this node. If the coreness value of a node changes, backward propagation is carried out to update the cnt values of adjacent nodes. Iteratively calculate these nodes where cnt < coreness until all nodes converge, then the core number of all nodes is obtained.

[0071] The following combines Figure 2 to elaborate on the locality theorem:

[0072] First, take node 1 as the analysis object for analysis. The adjacent nodes and corresponding degrees of node 1 are {0:4, 2:4, 3:5, 4:2, 5:1, 7:4}. In the first iteration, the node degree is its coreness value. At this time, node 1 has a 5-core support degree of 1 (node 3), a 4-core support degree of 4 (nodes 0, 2, 3, 7), a 3-core support degree of 4, a 2-core support degree of 5, and a 1-core support degree of 6 (all nodes). The K-core value is the largest K-core structure where the node is located. Only the 4-core support degree is sufficient and the largest. Therefore, the coreness new of node 1 = 4, and its cnt is also 4 (the coreness of 4 adjacent nodes >= 4). At this time, the coreness old of node 1 ≠ coreness new (coreness old = 6), because the cnt of node 1 has decreased, which may affect the support degree of its adjacent nodes, so backward propagation is carried out.

[0073] After understanding the relevant iterative process through Node 1, it can be understood that for the local convergence strategy, first, the coreness values of all nodes are initialized to their degrees. In the first iteration, all nodes traverse the coreness values of their adjacent nodes to calculate the coreness value and support degree of the node. Among them, only the coreness values of Nodes 1, 3, and 7 change. In the second iteration, the coreness of Nodes 1, 3, and 7 decreases, so the support degrees of their adjacent nodes need to be modified, and the support degrees of Nodes 1, 3, and 6 decrease. In the third iteration, because the support degree of the node has changed, it is necessary to traverse the adjacent nodes to recalculate the coreness. Repeat this process until all support degrees are greater than or equal to the coreness value, and at this time, all corenumbers are obtained.

[0074] As can be seen from the above description, the peeling algorithm needs to load the entire graph into memory to delete nodes and edges until the entire graph is deleted. The iterative process is to find the point with the smallest degree less than or equal to, delete the corresponding edges. The iterative process only needs to traverse the adjacent nodes once, so it is fast, but it is difficult to design as a distributed or external memory-based method. The parallel algorithm also has a large number of atomic subtraction operations, and the parallelism is not high.

[0075] For the local convergence strategy, its calculation process can be summarized as:

[0076] 1. Forward convergence operation.

[0077] Each active node (either the initial node or the node with its cnt < coreness) traverses its adjacent nodes to obtain the statistical distribution array num of the node in this iteration round. This array is a temporary array, and the new coreness is calculated based on this array.

[0078] Among them, the value of cnt[u] is a natural number t, which means that node u has t adjacent nodes with coreness >= k.

[0079] 2. Reverse broadcast operation.

[0080] The nodes that change during the convergence operation traverse their adjacent nodes again, and decrement the cnt of the adjacent nodes that meet the condition coreness_new < coreness_nbr <= coreness_old. coreness_nbr is the coreness value of one of the adjacent nodes, and nbr represents neighbour.

[0081] Then re-traverse the adjacent points of the nodes whose cnt is less than coreness to obtain the adjacent point coreness statistical distribution array again, calculate the coreness again, and then traverse the adjacent points for broadcasting operations. This method adopts a node-centric algorithm strategy. The calculation of the coreness of a node only requires two traversals of the adjacent points, and the upper bound is constantly sought until convergence. Therefore, when the memory is insufficient, only the adjacent points of the active nodes can be loaded, or the graph can be split for local convergence and then global convergence. It is widely used in algorithms based on external memory and distributed algorithms, but it requires two traversals of the adjacent points and the iteration speed is slow.

[0082] Based on the problems of the above algorithms, see Figure 3 As shown, an embodiment of the present invention provides a histogram-based K-core algorithm, the method comprising the following steps:

[0083] S1. Establish a histogram of the corresponding node according to the degree distribution of the neighboring points of each node.

[0084] In the specific implementation, see Figure 4 As shown, step S1 specifically includes:

[0085] S11. Initialize the number of cores of each node to the degree, and the degree of each node is the number of neighboring nodes of the node.

[0086] S12. According to the degree of a node, determine the degree value type of the degree distribution of the neighboring points of the node, and count the number of the degrees of the neighboring points of the node under each degree value.

[0087] That is, when the degree of a node is N, the degree value types that determine the degree distribution of the node's neighboring points are N, where N is a natural number.

[0088] S13. Using the degree value type as the histogram length and the number of nodes included in each degree value as the histogram data, a histogram of the corresponding node is established.

[0089] S2. Based on the current histogram, forward convergence and reverse broadcast are performed on the involved nodes to complete one iteration, and the histogram of the node whose core number changes during the forward convergence and reverse broadcast is modified.

[0090] In the specific implementation, see Figure 5 As shown, step S2 specifically includes:

[0091] S21. Using the current histogram length as the current core number of each node, determine the set of active nodes that cannot maintain the current core number due to insufficient support.

[0092] S22. Update the core number of the nodes in the active node set so that the updated core number is as large as possible while having sufficient support, and modify the length and data of the histogram of the nodes in the active node set based on the updated core number to complete the forward convergence of the nodes.

[0093] S23. Determine the neighboring point sets for which the nodes in the active node set cannot provide support for their neighboring points.

[0094] S24. Update the core number of the nodes in the neighbor point set so that the nodes in the active node set can provide support for the nodes in the neighbor point set, and modify the length and data of the histogram of the nodes in the neighbor point set based on the updated core number to complete the reverse broadcast of the nodes.

[0095] S3. Repeat the iterative process, and take the length of the histogram of all nodes when it does not change as the steady-state core number of each node.

[0096] In summary, in combination with the above steps, the histogram-based K-core algorithm in this embodiment mainly includes three steps: 1. Initializing a global histogram Bin; 2. Updating coreness; 3. Updating Bin.

[0097] It is worth noting that the global histogram is a global two-dimensional array Bin[i][j] (Bin[i][j] represents the number of nodes whose coreness (initialized to degree) value of the neighboring points of node i is equal to j+1). This array records the degree distribution of the neighboring points of each node. Each node has a global histogram as the object of iterative operation to prepare for iteration. During the iteration process, the current coreness value can be found by simply adding up the calculations in reverse order, which reduces the traversal of the neighboring points once. The coreness array records the result of the iteration process of the node as the core number. old [u] represents the value of node u before calculation, coreness new [u] represents the calculated value of node u, which also reflects the current length of the histogram of the node.

[0098] If the coreness[v] value of node v changes, backpropagation is required to modify the histogram of neighboring point u that meets the coreness[u]>coreness[v]. When backpropagating to node v, only when the coreness[u] of neighboring point u is less than coreness[v], node v can no longer provide support for its neighboring point u, so Bin[u][coreness old ] minus one, can only be coreness old-core provides support, so Bin[u][coreness new ] plus one.

[0099] For the three steps summarized above, the set R can be used to represent the set of nodes that need to be converged in the second step. The coreness of all nodes needs to be calculated for the first time, that is, R is all nodes. The set H represents the set of nodes whose coreness changes in the second step. T represents the set of nodes whose histogram changes during the reverse broadcast in the third step. The algorithm first initializes a global histogram, iterates the second and third steps, and ends the algorithm until the required convergence conditions are met.

[0100] The following is a specific example to further illustrate:

[0101] Or Figure 2 Take the example graph G in the figure as an example. Figure 2 Node represents the adjacent point of each node, degree is the degree, and core number is the final steady-state coreness, which is also the steady-state core number calculated by the last iteration of the node.

[0102] Step 1: Initialize the global histogram. Each node has a histogram array.

[0103] Taking node 1 as an example, its adjacent nodes and corresponding degrees are {0:4,2:4,3:5,4:2,5:1,7:4}. The initial length of the node Bin[1] is 6.

[0104] According to the above definition of Bin[i][j], we can know

[0105] Bin[1][0] is the number of neighboring nodes of node 1 whose coreness is 1;

[0106] Bin[1][1] is the number of nodes 1's neighbors whose coreness is 2;

[0107] Bin[1][2] is the number of neighboring nodes of node 1 whose coreness is 3;

[0108] …

[0109] Based on the above definition and according to the coreness of node 1's neighboring points {0:4,2:4,3:5,4:2,5:1,7:4}, we can know that:

[0110] Bin[1][0] indicates the number of nodes 1's neighbors whose coreness value is equal to 1. NUM({5}) indicates that node 5 meets the condition, so Bin[1][0] = 1.

[0111] Bin[1][1] indicates the number of nodes 1's neighbors whose coreness value is equal to 2. NUM({4}) indicates that node 4 meets the condition, so Bin[1][1] = 1.

[0112] Bin[1][2] indicates the number of nodes 1 whose coreness value is equal to 3, and if no node meets the condition, it is 0;

[0113] Bin[1][3] indicates the number of nodes 1 whose coreness value is equal to 4. NUM({0, 2, 7}) indicates that nodes 0, 2, and 7 meet the condition, so Bin[1][3] = 3.

[0114] Bin[1][4] indicates the number of nodes 1's neighbors whose coreness value is equal to 5. NUM({3}) indicates that node 3 meets the condition, so Bin[1][4] = 1.

[0115] Bin[1][5] indicates that the coreness value of node 1's neighbors is equal to 6, and no node meets the condition and is 0.

[0116] Therefore, the initialization value of Bin[1] is Bin[1]=[1,1,0,3,1,0]. This operation is actually a histogram of the coreness values ​​of the neighboring points of node 1. It traverses the coreness of the neighboring points and adds 1 to the corresponding position of Bin[1].

[0117] See also Figure 6 As shown, Bin[1]=[1,1,0,3,1,0] is filled in as the data of the histogram of node 1, and the arrows along node 1 point to 1, 1, 0, 3, 1, 0 in sequence. The histograms of the remaining nodes are similar, and this embodiment will not be described in detail again. The initial histograms of all nodes can be obtained by calculation according to the above method.

[0118] Step 2: Update the coreness value of the node.

[0119] Taking node 1 as an example, the initial coreness of node 1 is degree = 6, and the initial coreness values ​​of other nodes are also their degrees. Using the generalization of its definition that each node has at least K neighboring points, the condition for the coreness of a node to be K is that at least K neighboring points have coreness greater than or equal to K. Verify whether node 1 can be in 6-core.

[0120] The {neighborhood:coreness} values ​​of node 1 are {0:4,2:4,3:5,4:2,5:1,7:4}, there are 0 coreness=6, 1 coreness=5, 3 coreness=4, 1 coreness=2, and 1 coreness=1, so we get a statistical distribution array (histogram), represented by [index, value] as the statistical value [0:0, 1:1, 2:1, 3:0, 4:3, 5:1, 6:0] (here 0:0 means there are 0 degrees of 0, which can be omitted, and the subsequent algorithm omits this value).

[0121] Then according to this array, we can know that node 1 has 0 neighboring points with coreness greater than 6, and the support (cnt) that the neighboring points can provide is 0. Therefore, node 1 cannot be in 6-core, and its coreness cannot be 6. Then verify whether the coreness of node 1 can be in 5-core. From its statistical array, we can know that there are 1<5 neighboring points with coreness greater than or equal to 5, and the support in 5-core is 1. Therefore, node 1 cannot be in 5-core, so we continue to judge whether it can be in 4-core, because there are 4 neighboring points with coreness greater than or equal to 4 (3 with coreness of 4 and 1 with coreness of 5), and the support in 4-core is greater than or equal to 4. Therefore, in the current iteration round, the upper bound of the coreness of node 1 is 4, that is, the transient coreness of node 1 in the current round is 4, that is, coreness new =4, coreness old It is the previous value of 6, and the support of node 1 cnt[node=1] is recorded as 4, which means that node 1 currently has 4 neighboring points with coreness greater than or equal to 4. cnt[node=1] is a global variable, recorded in a global array cnt. In the initial state, each node must verify this process to find the upper bound of the steady-state coreness or transient coreness of each node in the current round. This is also called the forward (collection) convergence operation within the iteration.

[0122] According to the above analysis, we can know coreness new =4, so coreness[1]=4, see Figure 7As shown, the length of the histogram of node 1 is shortened to 4, and Bin[1][3] is set to have a support of 4. At this stage, the coreness of node 1 becomes 4 with a support of 4, the coreness of node 7 becomes 3 with a support of 3, and the coreness of node 3 becomes 4 with a support of 5. Therefore, the next step is to update the histogram array of the neighboring points of node {1, 3, 7}.

[0123] Step 3: Update the global histogram array:

[0124] There is a problem in the above steps. If the CPU is used alone, the order of calculation within the iteration is 0, 1, 2, etc. Node 0 verifies the coreness calculation before node 1, and after verification, it is found that 1 is also an adjacent point of 0. When node 0 verifies its own coreness upper bound, the coreness collection of 1 is 6. The distribution of node 0's neighboring points is (node ​​2, 6) with a coreness of 4, one with a coreness of 5 (node ​​3), and one with a coreness of 6 (node ​​1). Therefore, there are 4 coreness points greater than or equal to 4, so the coreness upper bound of node 0 in the current iteration round is 4.

[0125] However, when verifying node 1, the coreness upper bound of node 1 is reduced, but node 0 does not know it. Therefore, when node 1 is reduced from 6 to 4, it needs to broadcast to notify node 0 that the coreness of node 1 is reduced from 6 to 4.

[0126] Temporarily mark node 1 as needing reverse broadcast operation, and continue to calculate node 2. The coreness remains unchanged and cnt is 4. The coreness of node 3 drops from 5 to 4 and cnt is 5. Continue to calculate nodes 4, 5 and 6. Their coreness remains unchanged and their cnts are recorded. Calculate node 7 and find that its coreness drops from 4 to 3 and cnt is 3.

[0127] After a forward convergence, the coreness of three nodes {1 3 7} has changed. Perform a reverse broadcast operation on these three nodes to inform the neighboring points of {1 3 7} that their coreness has decreased, to see if they can continue to provide support for the coreness of the neighboring points. The coreness of the neighboring points of node 1 (coreness = 4) are {0:4, 2:4, 3:4, 4:2, 5:1, 7:3}, and it is found that the coreness of the neighboring points are all less than or equal to the coreness of node 1, so they can still provide support for the current coreness of the neighboring points. The same is true for node 3. However, the coreness of node 7 has dropped from 4 to 3. However, the neighboring points and coreness are {1:4, 3:4, 4:2, 6:4}, and the coreness of node 7 has become 3, so it can no longer provide support for the coreness = 4 of node 1. Therefore, cnt[1] is reduced by 1 to 3. Therefore, the support of node 1 is less than its coreness, so node 1 cannot maintain a coreness of 4, see Figure 8 As shown, Bin[1][3] is reduced by 1 and Bin[1][2] is increased by 1, so further calculation is needed and we temporarily mark them. Node 3 also has cnt[3] changed from 5 to 4, and its coreness is equal to its support, so we do not need to recalculate. cnt[6] changes from 4 to 3, which is also less than its coreness, so we also mark it.

[0128] At this point, a forward convergence and backpropagation operation is completed, which is called an iteration.

[0129] See also Figures 9 to 11 As shown, the coreness values ​​of nodes 1 and 6 are then iterated and verified, and the process is repeated until the cnt of all nodes is greater than or equal to its coreness, and the algorithm converges.

[0130] In summary, the histogram-based K-core algorithm in the present invention converts the temporary distribution array obtained by the convergence operation of the convergence algorithm into a global array, and there is no need to repeatedly traverse the adjacent points to obtain the distribution array. The algorithm iteration process records the coreness distribution of the adjacent points for each node as a global array, and obtains the coreness according to this array. new , and then modify the global distribution array of the neighboring points. The nodes whose global distribution arrays have changed are used as the active nodes for the next round, until the coreness of all nodes no longer changes and the algorithm converges. The difference is that the cnt of the node becomes a statistical distribution array. This reduces the traversal of the neighboring points and converts it into a statistical distribution array for accessing the node.

[0131] The algorithm in the present invention uses the method of replacing time with space to improve the efficiency of the algorithm, and still uses a node-centric calculation method, thus inheriting its scalability. By accessing the global histogram array of the node, the traversal of the adjacent points is reduced once, and the calculation speed is similar to that of the stripping algorithm. At the same time, the algorithm can be designed as a node-centric parallel algorithm.

[0132] At the same time, an embodiment of the present invention also provides a device for implementing a histogram-based K-core algorithm, which includes a generation module and an iteration module.

[0133] Among them, the generation module establishes the histogram of the corresponding node according to the degree distribution of the neighboring points of each node; the iteration module performs forward convergence and reverse broadcast on the nodes involved based on the current histogram to complete an iteration, and modifies the histogram of the node whose core number changes during the forward convergence and reverse broadcast process. The iteration module is also used to repeat the iteration process, and the length of the histogram of all nodes when it does not change is used as the steady-state core number of each node.

[0134] Furthermore, the generation module establishes a histogram of the corresponding node according to the degree distribution of the neighboring points of each node, including:

[0135] Initialize the number of cores of each node to the degree, and the degree of each node is the number of neighboring nodes of the node;

[0136] According to the degree of a node, determine the degree value type of the degree distribution of the neighboring points of the node, and count the number of the degree of the neighboring points of the node under each degree value;

[0137] The degree value type is used as the histogram length, and the number of nodes under each degree value is used as the histogram data to establish the histogram of the corresponding node.

[0138] Furthermore, the generation module determines the degree value type of the degree distribution of the neighboring points of a node according to the degree of the node, including:

[0139] When the degree of a node is N, the degree value types of the degree distribution of the neighboring points of the node are determined to be N, where N is a natural number.

[0140] Furthermore, the iteration module performs forward convergence and reverse broadcasting on the involved nodes based on the current histogram to complete one iteration, and modifies the histogram of the nodes whose core numbers change during the forward convergence and reverse broadcasting process, including:

[0141] Taking the current histogram length as the current number of cores for each node, determine the set of active nodes that cannot maintain the current number of cores due to insufficient support;

[0142] Update the number of cores of the nodes in the active node set so that the updated number of cores is as large as possible while having sufficient support, and modify the length and data of the histogram of the nodes in the active node set based on the updated number of cores to complete the forward convergence of the nodes;

[0143] Determine the neighboring point sets for which the nodes in the active node set cannot provide support for their neighboring points;

[0144] The core number of the nodes in the neighbor point set is updated so that the nodes in the active node set can provide support for the nodes in the neighbor point set, and the length and data of the histogram of the nodes in the neighbor point set are modified based on the updated core number to complete the reverse broadcast of the nodes.

[0145] An embodiment of the present invention also provides a device, comprising a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the above-mentioned histogram-based K-core algorithm are implemented.

[0146] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0147] In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:

[0148] Establish a histogram of the corresponding node according to the degree distribution of the neighboring points of each node;

[0149] Based on the current histogram, forward convergence and reverse broadcast are performed on the involved nodes to complete one iteration, and the histogram of the node whose core number changes during the forward convergence and reverse broadcast process is modified;

[0150] The iterative process is repeated, and the length of the histogram of all nodes when it does not change is taken as the steady-state core number of each node.

[0151] In one embodiment, the histogram of the corresponding node is established according to the degree distribution of the neighboring points of each node, so as to achieve:

[0152] Initialize the number of cores of each node to the degree, and the degree of each node is the number of neighboring nodes of the node;

[0153] According to the degree of a node, determine the degree value type of the degree distribution of the neighboring points of the node, and count the number of the degree of the neighboring points of the node under each degree value;

[0154] The degree value type is used as the histogram length, and the number of nodes under each degree value is used as the histogram data to establish the histogram of the corresponding node.

[0155] In one embodiment, based on the current histogram, forward convergence and reverse broadcast are performed on the nodes involved to complete one iteration, and the histogram of the node whose core number changes during the forward convergence and reverse broadcast is modified to achieve:

[0156] Taking the current histogram length as the current core number of each node, determine the set of active nodes that cannot maintain the current core number due to insufficient support;

[0157] Update the number of cores of the nodes in the active node set so that the updated number of cores is as large as possible while having sufficient support, and modify the length and data of the histogram of the nodes in the active node set based on the updated number of cores to complete the forward convergence of the nodes;

[0158] Determine the neighboring point sets for which the nodes in the active node set cannot provide support for their neighboring points;

[0159] The core number of the nodes in the neighbor point set is updated so that the nodes in the active node set can provide support for the nodes in the neighbor point set, and the length and data of the histogram of the nodes in the neighbor point set are modified based on the updated core number to complete the reverse broadcast of the nodes.

[0160] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the above-mentioned histogram-based K-core algorithm are implemented.

[0161] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In a hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or may be implemented as hardware, or may be implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable storage medium, which may include a computer-readable storage medium (or a non-transitory medium) and a communication medium (or a temporary medium).

[0162] As is known to those of ordinary skill in the art, the term computer-readable storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer-readable storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transmission mechanism, and may include any information delivery medium.

[0163] Exemplarily, the computer-readable storage medium may be an internal storage unit of the electronic device of the aforementioned embodiment, such as a hard disk or memory of the electronic device. The computer-readable storage medium may also be an external storage device of the electronic device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device.

[0164] The above are only specific implementations of the embodiments of the present invention, but the protection scope of the embodiments of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the embodiments of the present invention, and these modifications or replacements should be included in the protection scope of the embodiments of the present invention. Therefore, the protection scope of the embodiments of the present invention shall be based on the protection scope of the claims.

Claims

1. A histogram-based K-core method, applied to the network origin and evolution process scenario, characterized in that: The method comprises the following steps: Establish a histogram of the corresponding node according to the degree distribution of the neighboring points of each node; Based on the current histogram, forward convergence and reverse broadcast are performed on the involved nodes to complete one iteration, and the histogram of the node whose core number changes during the forward convergence and reverse broadcast process is modified; Repeat the iterative process, and take the length of the histogram of all nodes when it does not change as the steady-state core number of each node; The process of performing forward convergence and reverse broadcasting on the involved nodes based on the current histogram to complete one iteration and modifying the histogram of the nodes whose core numbers change during the forward convergence and reverse broadcasting includes: Taking the current histogram length as the current number of cores for each node, determine the set of active nodes that cannot maintain the current number of cores due to insufficient support; Update the number of cores of the nodes in the active node set so that the updated number of cores is as large as possible while having sufficient support, and modify the length and data of the histogram of the nodes in the active node set based on the updated number of cores to complete the forward convergence of the nodes; Determine the neighboring point sets for which the nodes in the active node set cannot provide support for their neighboring points; The core number of the nodes in the neighbor point set is updated so that the nodes in the active node set can provide support for the nodes in the neighbor point set, and the length and data of the histogram of the nodes in the neighbor point set are modified based on the updated core number to complete the reverse broadcast of the nodes.

2. The histogram-based K-core method according to claim 1, characterized in that: The step of establishing a histogram of a corresponding node according to the degree distribution of the neighboring points of each node comprises: Initialize the number of cores of each node to the degree, and the degree of each node is the number of neighboring nodes of the node; According to the degree of a node, determine the degree value type of the degree distribution of the neighboring points of the node, and count the number of the degree of the neighboring points of the node under each degree value; The degree value type is used as the histogram length, and the number of nodes under each degree value is used as the histogram data to establish the histogram of the corresponding node.

3. A histogram-based K-core method as claimed in claim 2, characterized in that: The step of determining the degree value type of the degree distribution of the neighboring points of a node according to the degree of the node includes: When the degree of a node is N, the degree value types of the degree distribution of the neighboring points of the node are determined to be N, where N is a natural number.

4. A device for implementing a histogram-based K-core method, characterized in that: include: A generation module, which builds a histogram of each node based on the degree distribution of its neighbors; The iteration module performs forward convergence and reverse broadcast on the involved nodes based on the current histogram to complete one iteration, and modifies the histogram of the nodes whose core numbers change during the forward convergence and reverse broadcast process; The iteration module is also used to repeat the iteration process, taking the length of the histogram of all nodes when it does not change as the steady-state core number of each node; The iteration module performs forward convergence and reverse broadcast on the involved nodes based on the current histogram to complete one iteration, and modifies the histogram of the node whose core number changes during the forward convergence and reverse broadcast process, including: Taking the current histogram length as the current number of cores for each node, determine the set of active nodes that cannot maintain the current number of cores due to insufficient support; Update the number of cores of the nodes in the active node set so that the updated number of cores is as large as possible while having sufficient support, and modify the length and data of the histogram of the nodes in the active node set based on the updated number of cores to complete the forward convergence of the nodes; Determine the neighboring point sets for which the nodes in the active node set cannot provide support for their neighboring points; The core number of the nodes in the neighbor point set is updated so that the nodes in the active node set can provide support for the nodes in the neighbor point set, and the length and data of the histogram of the nodes in the neighbor point set are modified based on the updated core number to complete the reverse broadcast of the nodes.

5. A device as claimed in claim 4, characterized in that The generation module establishes a histogram of the corresponding node according to the degree distribution of the neighboring points of each node, including: Initialize the number of cores of each node to the degree, and the degree of each node is the number of neighboring nodes of the node; According to the degree of a node, determine the degree value type of the degree distribution of the neighboring points of the node, and count the number of the degree of the neighboring points of the node under each degree value; The degree value type is used as the histogram length, and the number of nodes under each degree value is used as the histogram data to establish the histogram of the corresponding node.

6. A device as claimed in claim 5, characterized in that The generation module determines the degree value type of the degree distribution of the neighboring points of a node according to the degree of the node, including: When the degree of a node is N, the degree value types of the degree distribution of the neighboring points of the node are determined to be N, where N is a natural number.

7. A device, characterized in that: The device comprises a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the histogram-based K-core method according to any one of claims 1 to 3 are implemented.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the histogram-based K-core method according to any one of claims 1 to 3 are implemented.