Hypergraph adaptive sampling method for structural feature reservation
Through the hypergraph adaptive sampling method with multi-dimensional weight calculation and dynamic adjustment mechanism, the problem of balancing the efficiency and quality of hypergraph sampling in the existing technology is solved, efficient sampling in large-scale hypergraphs is achieved, and the accuracy and robustness of the sampling results are significantly improved.
Patent Information
- Application Number
- CN202510823404.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-19
AI Technical Summary
Existing hypergraph sampling methods cannot achieve efficient sampling while maintaining the structural characteristics of the hypergraph. Especially when processing large-scale hypergraphs, it is difficult to strike a balance between sampling quality and computational efficiency.
A structural feature-preserving hypergraph adaptive sampling method is adopted. Through a multi-dimensional weight calculation mechanism, combined with a batch sampling strategy and a dynamic weight adjustment mechanism, the hyperedge size and node degree distribution are comprehensively considered, and the sampling weight is dynamically adjusted to maintain the hypergraph structural characteristics.
At low sampling ratios, the KL divergence of the sampling results is reduced by more than 75% compared with the traditional random sampling method, and the computational efficiency is improved by 40%, while ensuring the sampling quality and robustness, especially showing obvious advantages when processing large-scale heterogeneous hypergraphs.
Smart Images

Figure CN120705361A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of computer models, and in particular relates to a hypergraph adaptive sampling method for preserving structural features. Background Art
[0002] With the advent of the big data era, hypergraphs, as an important data representation method, have been widely used in fields such as social network analysis, recommender systems, and bioinformatics. In particular, in microbial interaction networks, hypergraphs can model complex interactions among multiple microbial species, such as symbiosis, competition, and predation, which are difficult to capture with traditional graph structures. In social network analysis, hypergraphs can represent multidimensional connections between user groups, such as interests and topics, going beyond the simple binary relationships between users in traditional social networks. In protein interaction network analysis, hypergraphs can represent protein complexes, in which multiple proteins participate in a biological process, which better reflects the true biological function than simple pairwise interactions. In genome-scale metabolic networks, hypergraphs can represent the complex reaction relationships between multiple substrates and products, revealing the overall structure and function of intracellular metabolic pathways. Therefore, as a general multi-relational data modeling tool, hypergraphs have important academic research value and broad application prospects.
[0003] Hypergraphs differ from traditional graph structures in that their edges can connect multiple nodes, enabling them to better describe complex multi-party relationships. In practical applications, hypergraphs are often extremely large, and directly processing the entire hypergraph incurs significant computational overhead. To improve processing efficiency, it is necessary to sample the hypergraph to obtain subgraphs that represent the characteristics of the original hypergraph. Currently, major hypergraph sampling methods include random sampling, degree-first sampling, and edge-first sampling. While simple to implement, random sampling ignores the structural characteristics of the hypergraph, resulting in poorly representative sampling results. Degree-first sampling samples based on node degrees but fails to consider the structural information of hyperedges, easily causing the sampling results to deviate from the original distribution. Edge-first sampling focuses on the importance of hyperedges but lacks consideration of node characteristics, making it difficult to maintain the global topological structure. These existing methods share a common technical challenge: they are unable to achieve efficient sampling while preserving the structural characteristics of the hypergraph. This is particularly problematic when processing large-scale hypergraphs, where balancing sampling quality and computational efficiency is difficult. Summary of the Invention
[0004] In view of this, the present invention provides a hypergraph adaptive sampling method for preserving structural features, which can solve the problem that existing technologies cannot achieve efficient sampling while preserving hypergraph structural features.
[0005] The present invention is achieved in that:
[0006] The present invention provides a hypergraph adaptive sampling method for preserving structural features, which includes the following steps:
[0007] S10, initializing a hypergraph and sampling parameters, wherein the hypergraph includes a node set and a hyperedge set, setting a sampling ratio, a batch size, and weight adjustment parameters, and calculating global properties of the hypergraph;
[0008] S20, calculating the initial sampling weight of each hyperedge in the hyperedge set based on the hyperedge size, node degree distribution, and combination ratio;
[0009] S30, randomly selecting a batch of hyperedges from the hyperedge set according to the sampling weights, adding the batch of hyperedges to a sampling sub-hypergraph, and simultaneously adding nodes corresponding to the batch of hyperedges to a node set of the sampling sub-hypergraph;
[0010] S40, calculating the difference between the sampling sub-hypergraph and the hypergraph in global attributes, and adjusting the sampling weight according to the difference;
[0011] S50, comparing the hypergraph average degree and the average hyperedge size of the sampled sub-hypergraph with the hypergraph to obtain an error value;
[0012] S60, updating the sampling weight according to the error value, increasing the hyperedge weight corresponding to the portion with a larger error when the error value is greater than a preset threshold, and decreasing the hyperedge weight corresponding to the portion with a smaller error when the error value is less than the preset threshold;
[0013] S70, normalizing the updated sampling weights so that the sum of all hyperedge weights is 1;
[0014] S80, determining whether the number of hyperedges in the sampled sub-hypergraph reaches the target sampling number, if not, returning to step S30 to continue sampling, if yes, executing step S90;
[0015] S90: Output the sampled sub-hypergraph as the final sampling result.
[0016] The present invention provides a hypergraph adaptive sampling method for preserving structural features, achieving the following technical benefits: The proposed hypergraph adaptive sampling method for preserving structural features effectively addresses the aforementioned technical issues. First, by introducing a multi-dimensional weight calculation mechanism, the method comprehensively considers hyperedge size and node degree distribution, ensuring that the sampling process fully preserves the structural characteristics of the original hypergraph. Second, by employing a batch sampling strategy and a dynamic weight adjustment mechanism, the sampling efficiency is significantly improved, enabling the method to effectively process large-scale hypergraph data. Specifically, at a low sampling ratio (20%), the KL divergence of the sampling results is reduced by over 75% compared to traditional random sampling methods, demonstrating that the sampled subgraphs better preserve the degree distribution characteristics of the original hypergraph. In terms of computational efficiency, the proposed method reduces the runtime by an average of 40% compared to existing methods while ensuring sampling quality. Furthermore, through an adaptive weight update mechanism, the proposed method enables the sampling process to dynamically adjust its strategy based on error, further improving sampling accuracy and robustness. In practical application tests, the proposed method demonstrates excellent performance across multiple datasets, particularly when processing large-scale heterogeneous hypergraphs.
[0017] On the basis of the above technical solution, the hypergraph adaptive sampling method for preserving structural features of the present invention can also be improved as follows:
[0018] Wherein, the step S10 specifically includes:
[0019] Step 101: construct a node set and a hyperedge set of the hypergraph, wherein the node set includes all nodes and the hyperedge set includes all hyperedges;
[0020] Step 102: Setting the sampling ratio to determine the number of hyperedges finally sampled, wherein the sampling ratio is the ratio of the number of sampled hyperedges to the total number of original hyperedges;
[0021] Step 103: Setting the batch size for determining the number of hyperedges to be sampled in each round, wherein the batch size is 0.5% of the total number of original hyperedges;
[0022] Step 104: Set the weight adjustment parameter, where the value range of the weight adjustment parameter is 0.1 to 0.5;
[0023] Step 105: Calculate the global properties of the hypergraph, including the hypergraph average degree and the hyperedge average size, wherein the hypergraph average degree is the average of the degrees of all nodes, and the hyperedge average size is the average of the number of nodes contained in all hyperedges.
[0024] Furthermore, the step S20 specifically includes:
[0025] Step 201: Calculate the size weight of each hyperedge, where the size weight is the ratio of the number of nodes of each hyperedge to the total number of nodes of all hyperedges in the hyperedge set.
[0026] Step 202: Calculate the node degree weight of each hyperedge, where the node degree weight is the ratio of the average degree of the nodes connected by the hyperedge to the average degree of the nodes connected by all hyperedges.
[0027] Step 203: Calculate the combined weight of each hyperedge, where the combined weight is obtained by weighted combination of the size weight and the node degree weight.
[0028] Step 204: performing a power operation on the combined weight to obtain an initial sampling weight, wherein the power parameter of the power operation is used to adjust the weight distribution;
[0029] Step 205: Normalize the initial sampling weights so that the sum of the initial sampling weights of all hyperedges is 1.
[0030] Furthermore, the step S30 specifically includes:
[0031] Step 301: construct a cumulative probability distribution according to the sampling weights, and the cumulative probability distribution is used to randomly select hyperedges;
[0032] Step 302: Generate batch size random numbers, where each random number has a value range of 0 to 1;
[0033] Step 303: Select corresponding hyperedges from the cumulative probability distribution according to the random number to form a batch of hyperedges;
[0034] Step 304: Add the batch of hyperedges to the hyperedge set of the sampled sub-hypergraph;
[0035] Step 305: Identify all nodes included in the batch of hyperedges, and add nodes that are not added to the node set of the sampled sub-hypergraph to the node set of the sampled sub-hypergraph.
[0036] Furthermore, the step S40 specifically includes:
[0037] Step 401: Calculate the degrees of all nodes in the sampled sub-hypergraph to obtain the node degree distribution of the sampled sub-hypergraph;
[0038] Step 402: Calculate the sizes of all hyperedges in the sampled sub-hypergraph to obtain the hyperedge size distribution of the sampled sub-hypergraph;
[0039] Step 403: Calculate the difference between the average degree of the sampled sub-hypergraph and the average degree of the hypergraph;
[0040] Step 404: Calculate the difference between the average hyperedge size of the sampled sub-hypergraph and the average hyperedge size of the hypergraph;
[0041] Step 405: The node degree distribution difference and the hyperedge size distribution difference are integrated to obtain an overall difference value.
[0042] Furthermore, the step S50 specifically includes:
[0043] Step 501: Count the degree of each node in the sampled sub-hypergraph and calculate the average degree of the sampled sub-hypergraph;
[0044] Step 502: Count the number of nodes contained in each hyperedge in the sampled sub-hypergraph, and calculate the average hyperedge size of the sampled sub-hypergraph;
[0045] Step 503: Calculate the relative error between the average degree of the sampled sub-hypergraph and the average degree of the hypergraph;
[0046] Step 504: Calculate the relative error between the average hyperedge size of the sampled sub-hypergraph and the average hyperedge size of the hypergraph;
[0047] Step 505: Compare the relative error with a preset threshold to obtain an error value.
[0048] Furthermore, the step S60 specifically includes:
[0049] Step 601: Identify attribute features with larger errors according to the error values;
[0050] Step 602: identifying hyperedges associated with the attribute feature with a larger error;
[0051] Step 603: When the error value is greater than the preset threshold, increase the weight of the hyperedge corresponding to the larger error portion according to the weight adjustment parameter;
[0052] Step 604: When the error value is less than the preset threshold, reduce the weight of the hyperedge corresponding to the portion with smaller error according to the weight adjustment parameter;
[0053] Step 605: Record the updated sampling weights for the next round of sampling.
[0054] Furthermore, the step S70 specifically includes:
[0055] Step 701: Calculate the updated sum of the sampling weights;
[0056] Step 702: Divide the sampling weight of each hyperedge by the total sampling weight.
[0057] Step 703: Verify whether the sum of the normalized sampling weights is 1;
[0058] Step 704: storing the normalized sampling weights;
[0059] Step 705: Use the normalized sampling weights in the next round of sampling.
[0060] Furthermore, the step S80 specifically includes:
[0061] Step 801: Count the total number of hyperedges in the sampled sub-hypergraph;
[0062] Step 802: Calculate the target sampling quantity according to the sampling ratio;
[0063] Step 803: Determine whether the total number of hyperedges in the sampled sub-hypergraph reaches the target sampling number;
[0064] Step 804: When the target sampling quantity is not reached, the process returns to step S30;
[0065] Step 805: When the target sampling quantity is reached, continue to execute step S90.
[0066] Furthermore, the step S90 specifically includes:
[0067] Step 901: Arrange the node set and hyperedge set of the sampled sub-hypergraph;
[0068] Step 902: Verify the integrity of the sampled sub-hypergraph to ensure that all hyperedge nodes are in the node set;
[0069] Step 903: Calculate characteristic indicators of the sampled sub-hypergraph, including node degree distribution and hyperedge size distribution;
[0070] Step 904: Encapsulate the node set, hyperedge set, and characteristic indexes of the sampled sub-hypergraph;
[0071] Step 905: Output the encapsulated sampling sub-hypergraph as the final sampling result.
[0072] 1. The calculation of the hypergraph global attributes in step S10 is specifically expressed as follows:
[0073] The formula for calculating the average degree of the hypergraph is: Where, d avg is the average degree of the hypergraph; |V| is the total number of nodes; d i is the degree of the i-th node, indicating the number of hyperedges in which the node participates.
[0074] The formula for calculating the average size of hyperedges is: Where s avg is the average size of hyperedges; |E| is the total number of hyperedges; sj is the size of the jth hyperedge, indicating the number of nodes contained in the hyperedge.
[0075] 2. The weight calculation in step S20 is specifically expressed as follows:
[0076] Weight calculation based on hyperedge size: Where w s,j is the size weight of the jth hyperedge; s j is the size of the jth hyperedge; α is the weight adjustment parameter, which ranges from 0.1 to 2.0.
[0077] Weight calculation based on node average degree: Where w d,j is the node degree weight of the jth hyperedge; e j represents the jth hyperedge; d i is the degree of node i.
[0078] Comprehensive weight calculation: w j =βw s,j +(1-β)w d,j Where w j is the comprehensive weight of the jth hyperedge; β is the weight combination coefficient, which ranges from 0 to 1.
[0079] 3. The difference value calculation in step S40 is specifically expressed as follows:
[0080] Node degree distribution difference calculation: Where D d is the node degree distribution difference; and d i are the degrees of node i in the sampled sub-hypergraph and the original hypergraph, respectively; and d max are the maximum node degrees in the sampled sub-hypergraph and the original hypergraph, respectively.
[0081] Hyperedge size distribution difference calculation: Where D s is the difference in the distribution of hyperedge sizes; and s j are the sizes of hyperedge j in the sampled sub-hypergraph and the original hypergraph, respectively; and s max are the maximum hyperedge sizes in the sampled sub-hypergraph and the original hypergraph, respectively.
[0082] 4. The error calculation in step S50 is specifically expressed as follows:
[0083] Calculation of average relative error: Where, E d is the average relative error; and d avg are the average degrees of the sampled sub-hypergraph and the original hypergraph, respectively.
[0084] Calculation of the average hyperedge size relative error: Where, E s is the average hyperedge size relative error; and s avg are the average hyperedge sizes of the sampled sub-hypergraph and the original hypergraph, respectively.
[0085] 5. The weight update in step S60 is specifically expressed as follows:
[0086] Weight adjustment formula: Where, is the updated weight; w j is the current weight; λ is the weight adjustment parameter; E j is the error associated with hyperedge j; θ is the preset threshold; sign() is the sign function.
[0087] The construction principle and significance of the above equations are explained as follows: 1. The reason for adopting the power relationship (α parameter) is to flexibly adjust the degree of inclination of the weight distribution. When α>1, it emphasizes large-value features, and when α<1, it reduces the difference; 2. The reason for adopting relative value calculation is to eliminate the influence of different scales so that various features can be reasonably combined; 3. The reason for introducing the error term is to take into account the random fluctuations in the actual sampling process and improve the robustness of the model; 4. The reason for using the sign function is to realize the dynamic adjustment of the weight, and decide to increase or decrease the weight according to the positive or negative error.
[0088] The advantages of these equations over existing technologies are: 1. They take into account multi-dimensional structural characteristics, including not only node degree but also hyperedge size; 2. They introduce an adaptive adjustment mechanism that can dynamically optimize weights based on sampling effects; 3. They design a normalization process to ensure the stability of the sampling process; 4. Through parametric design, they provide greater flexibility and adaptability.
[0089] The following is a detailed explanation of the derivation process and parameter sources of each equation:
[0090] 1. Derivation of the formula for calculating the average degree of the hypergraph: First, consider the degree calculation of a single node: Where, I ij is an indicator function, which is 1 when node i belongs to hyperedge j and 0 otherwise.
[0091] Then the average of all node degrees is obtained: This formula reflects the connection density of the network, and the parameter |V| is obtained by traversing the node set.
[0092] 2. Derivation process of weight calculation formula:
[0093] As a first step, consider the original ratio of the hyperedge sizes:
[0094] The second step is to introduce nonlinear regulation: The design of the α parameter is based on the following considerations: when α = 1, the original ratio is maintained; when α > 1, the importance of large hyperedges is strengthened; when α < 1, the difference in hyperedge size is weakened.
[0095] The third step is to consider the influence of node degree and design the average degree weight: This formula is optimized by the following steps: 1) first calculate the average degree of nodes within the hyperedge; 2) compare it with the global average degree; 3) apply the same nonlinear adjustment mechanism.
[0096] Step 4: Design comprehensive weight: w j =βw s,j +(1-β)w d,j ; Method for determining the β parameter: 1) Select the optimal value on the training data through cross-validation; 2) It can be dynamically adjusted according to the specific application scenario.
[0097] 3. Derivation of the difference value calculation formula:
[0098] First, consider the basic form of the distribution difference: D basic =∑|P s -P|; where P s and P denote the sampling and original distributions, respectively.
[0099] In order to eliminate the scale effect, normalization processing is introduced:
[0100] Similarly, the difference in hyperedge size is handled similarly:
[0101] 4. Derivation of weight update formula:
[0102] Step 1, basic error response: Δw j =λ·sign(E j -θ);
[0103] The second step is to consider the impact of current weights:
[0104] Merge to get the final form:
[0105] The parameter setting is based on the following: the value range of λ is 0.1 to 0.5, which is obtained through experimental optimization; θ is set to the median of the error distribution; E j Calculated through local structural features.
[0106] Compared with existing technologies, the present invention provides a hypergraph adaptive sampling method for preserving structural features, which has the following advantages: It effectively addresses the aforementioned technical problems. First, by introducing a multi-dimensional weight calculation mechanism, the method comprehensively considers hyperedge size and node degree distribution, ensuring that the sampling process fully preserves the structural characteristics of the original hypergraph. Second, by adopting a batch sampling strategy and a dynamic weight adjustment mechanism, the sampling efficiency is significantly improved, enabling the method to effectively process large-scale hypergraph data. Specifically, at a low sampling ratio (20%), the KL divergence of the sampling results is reduced by more than 75% compared to traditional random sampling methods, indicating that the sampled subgraphs better preserve the degree distribution characteristics of the original hypergraph. In terms of computational efficiency, the present invention reduces the runtime by an average of 40% compared to existing methods while ensuring sampling quality. Furthermore, through an adaptive weight update mechanism, the present invention enables the sampling process to dynamically adjust the strategy based on error, further improving the accuracy and robustness of sampling. In practical application tests, the present invention has demonstrated excellent performance on multiple datasets, showing a significant advantage in processing large-scale heterogeneous hypergraphs. BRIEF DESCRIPTION OF THE DRAWINGS
[0107] Figure 1 Flowchart of a hypergraph adaptive sampling method for preserving structural features;
[0108] Figure 2 This is a third embodiment of a hypergraph adaptive sampling method for preserving structural features. DETAILED DESCRIPTION
[0109] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0110] like Figure 1 FIG. 1 is a flow chart of a hypergraph adaptive sampling method for preserving structural features provided by the present invention. The process includes the following steps:
[0111] S10, initialize the hypergraph and sampling parameters, the hypergraph includes a node set and a hyperedge set, set the sampling ratio, batch size and weight adjustment parameters, and calculate the global properties of the hypergraph;
[0112] S20, calculating the initial sampling weight of each hyperedge in the hyperedge set based on the hyperedge size, node degree distribution, and combination ratio;
[0113] S30, randomly selecting a batch of hyperedges from the hyperedge set according to the sampling weights, adding the batch of hyperedges to the sampling sub-hypergraph, and simultaneously adding the nodes corresponding to the batch of hyperedges to the node set of the sampling sub-hypergraph;
[0114] S40, calculating the difference between the sampled sub-hypergraph and the hypergraph in terms of global attributes, and adjusting the sampling weight according to the difference;
[0115] S50, comparing the hypergraph average degree and the average hyperedge size of the sampled sub-hypergraph with the hypergraph to obtain an error value;
[0116] S60, updating the sampling weight according to the error value, increasing the hyperedge weight corresponding to the part with larger error when the error value is greater than a preset threshold, and decreasing the hyperedge weight corresponding to the part with smaller error when the error value is less than the preset threshold;
[0117] S70, normalizing the updated sampling weights so that the sum of all hyperedge weights is 1;
[0118] S80, determining whether the number of hyperedges in the sampled sub-hypergraph reaches the target sampling number, if not, returning to step S30 to continue sampling, if yes, executing step S90;
[0119] S90: Output the sampled sub-hypergraph as the final sampling result.
[0120] In the above technical solution, step S10 specifically includes:
[0121] Step 101: Construct a node set and a hyperedge set of a hypergraph, wherein the node set includes all nodes and the hyperedge set includes all hyperedges;
[0122] Step 102: Setting a sampling ratio to determine the number of hyperedges to be sampled. The sampling ratio is the ratio of the number of sampled hyperedges to the total number of original hyperedges.
[0123] Step 103: Set the batch size to determine the number of hyperedges to be sampled in each round. The batch size is 0.5% of the total number of original hyperedges.
[0124] Step 104: Set a weight adjustment parameter, where the value range of the weight adjustment parameter is 0.1 to 0.5;
[0125] Step 105: Calculate the global properties of the hypergraph, including the average degree of the hypergraph and the average size of the hyperedges, where the average degree of the hypergraph is the average of the degrees of all nodes, and the average size of the hyperedges is the average of the number of nodes contained in all hyperedges.
[0126] Furthermore, in the above technical solution, step S20 specifically includes:
[0127] Step 201: Calculate the size weight of each hyperedge, where the size weight is the ratio of the number of nodes of each hyperedge to the total number of nodes of all hyperedges in the hyperedge set;
[0128] Step 202: Calculate the node degree weight of each hyperedge, where the node degree weight is the ratio of the average degree of the nodes connected by the hyperedge to the average degree of the nodes connected by all hyperedges;
[0129] Step 203: Calculate the combined weight of each hyperedge, where the combined weight is obtained by weighted combination of the size weight and the node degree weight.
[0130] Step 204: Perform a power operation on the combined weights to obtain initial sampling weights, and the power parameter of the power operation is used to adjust the weight distribution;
[0131] Step 205: Normalize the initial sampling weights so that the sum of the initial sampling weights of all hyperedges is 1.
[0132] Furthermore, in the above technical solution, step S30 specifically includes:
[0133] Step 301: construct a cumulative probability distribution based on the sampling weights, and the cumulative probability distribution is used to randomly select hyperedges;
[0134] Step 302: Generate batch size random numbers, where each random number has a value range of 0 to 1;
[0135] Step 303: Select corresponding hyperedges from the cumulative probability distribution according to the random number to form a batch of hyperedges;
[0136] Step 304: Add a batch of hyperedges to the hyperedge set of the sampled sub-hypergraph;
[0137] Step 305: Identify all nodes included in a batch of hyperedges, and add nodes that have not been added to the node set of the sampled sub-hypergraph to the node set of the sampled sub-hypergraph.
[0138] Furthermore, in the above technical solution, step S40 specifically includes:
[0139] Step 401: Calculate the degrees of all nodes in the sampled sub-hypergraph to obtain the node degree distribution of the sampled sub-hypergraph;
[0140] Step 402: Calculate the sizes of all hyperedges in the sampled sub-hypergraph to obtain the hyperedge size distribution of the sampled sub-hypergraph.
[0141] Step 403: Calculate the difference between the average degree of the sampled sub-hypergraph and the average degree of the hypergraph;
[0142] Step 404: Calculate the difference between the average hyperedge size of the sampled sub-hypergraph and the average hyperedge size of the hypergraph;
[0143] Step 405: Comprehensively calculate the node degree distribution difference and the hyperedge size distribution difference to obtain an overall difference value.
[0144] Furthermore, in the above technical solution, step S50 specifically includes:
[0145] Step 501: Count the degree of each node in the sampled sub-hypergraph and calculate the average degree of the sampled sub-hypergraph;
[0146] Step 502: Count the number of nodes contained in each hyperedge in the sampled sub-hypergraph and calculate the average hyperedge size of the sampled sub-hypergraph;
[0147] Step 503: Calculate the relative error between the average degree of the sampled sub-hypergraph and the average degree of the hypergraph;
[0148] Step 504: Calculate the relative error between the average hyperedge size of the sampled sub-hypergraph and the average hyperedge size of the hypergraph;
[0149] Step 505: Compare the relative error with a preset threshold to obtain an error value.
[0150] Furthermore, in the above technical solution, step S60 specifically includes:
[0151] Step 601: Identify attribute features with larger errors based on the error values;
[0152] Step 602: identifying hyperedges associated with attribute features with larger errors;
[0153] Step 603: When the error value is greater than a preset threshold, the weight of the hyperedge corresponding to the larger error portion is increased according to the weight adjustment parameter;
[0154] Step 604: When the error value is less than a preset threshold, the weight of the hyperedge corresponding to the part with smaller error is reduced according to the weight adjustment parameter;
[0155] Step 605: Record the updated sampling weights for the next round of sampling.
[0156] Furthermore, in the above technical solution, step S70 specifically includes:
[0157] Step 701: Calculate the sum of updated sampling weights;
[0158] Step 702: Divide the sampling weight of each hyperedge by the total sampling weight.
[0159] Step 703: Verify whether the sum of the normalized sampling weights is 1;
[0160] Step 704: store the normalized sampling weights;
[0161] Step 705: Use the normalized sampling weights for the next round of sampling.
[0162] Furthermore, in the above technical solution, step S80 specifically includes:
[0163] Step 801: Count the total number of hyperedges in the sampled sub-hypergraph;
[0164] Step 802: Calculate the target sampling quantity according to the sampling ratio;
[0165] Step 803: Determine whether the total number of hyperedges in the sampled sub-hypergraph reaches the target sampling number;
[0166] Step 804: When the target sampling number is not reached, the process returns to step S30;
[0167] Step 805: When the target sampling quantity is reached, continue to execute step S90.
[0168] Furthermore, in the above technical solution, step S90 specifically includes:
[0169] Step 901: Arrange the node set and hyperedge set of the sampled sub-hypergraph;
[0170] Step 902: Verify the integrity of the sampled sub-hypergraph to ensure that all hyperedge nodes are in the node set;
[0171] Step 903: Calculate characteristic indicators of the sampled sub-hypergraph, including node degree distribution and hyperedge size distribution;
[0172] Step 904: Encapsulate the node set, hyperedge set, and characteristic indexes of the sampled sub-hypergraph;
[0173] Step 905: Output the encapsulated sampling sub-hypergraph as the final sampling result.
[0174] The specific implementation of step S10 is to initialize the hypergraph data structure and sampling parameters. Its core is to build the basic representation of the hypergraph and configure the necessary parameters. First, the hypergraph data structure is constructed, and the adjacency matrix and the association matrix are used to store the topological structure of the hypergraph. The adjacency matrix is used to represent the connection relationship between nodes, and the association matrix is used to record the subordinate relationship between nodes and hyperedges. The basic properties of the hypergraph include indicators such as node degree distribution, hyperedge size distribution and connection density. These indicators are calculated by traversing the hypergraph structure. For the average degree of the hypergraph, the formula is used. Calculate, where d i represents the degree of node i; for the average size of hyperedges, use the formula Calculate, where s jrepresents the number of nodes contained in hyperedge j. The sampling parameters are set using an adaptive adjustment mechanism, dynamically determining the sampling ratio and batch size based on the size of the hypergraph. The sampling ratio is typically set between 10% and 80%, the batch size is set to 0.5% of the total number of original hyperedges, and the weight adjustment parameter ranges from 0.1 to 0.5. This step aims to provide the necessary data structure and parameter support for the subsequent sampling process, ensuring the efficient operation of the sampling algorithm.
[0175] The specific implementation of step S20 is to calculate the initial sampling weight of the hyperedge. This step first calculates the weight based on the structural characteristics of the hyperedge, including the weight calculation based on the size of the hyperedge, using the formula Where α is the weight adjustment parameter; then calculate the weight based on the average degree of the node using the formula Finally, the comprehensive weight w is obtained by combining the two weights j =βw s,j +(1-β)w d,j The weight calculation adopts the power law distribution principle, and the shape of the weight distribution is controlled by adjusting the parameter α, which ranges from 0.1 to 2.0. This step uses normalization to ensure that the sum of the weights is 1, and a stratified sampling strategy is used to ensure that the sampling probability of hyperedges of different sizes is reasonably distributed. The weight calculation process takes into account multiple characteristic dimensions of hyperedges, including size, node degree distribution, and local structural characteristics, and improves the representativeness of the sampling by combining these features.
[0176] The specific implementation of step S30 is to perform a batch sampling process. This step first constructs a cumulative probability distribution function and calculates the cumulative probability distribution based on the hyperedge weight A Monte Carlo sampling method is used to generate a uniformly distributed random number sequence, and the corresponding hyperedge index is determined through binary search. Batch sampling uses a sampling strategy without replacement to ensure that the same hyperedge is not selected repeatedly. During the sampling process, the hyperedge set is dynamically updated, and sampled hyperedges are removed from the candidate set. For each selected hyperedge, its related nodes are added to the node set of the sampled subgraph, and the node degree information is updated. The sampling process uses a hash table to optimize search efficiency and reduce repeated calculations. The core of this step is to achieve efficient random sampling while maintaining the representativeness and balance of the sampling results.
[0177] The specific implementation of step S40 is to evaluate the sampling error. This step first calculates the difference value of the node degree distribution using the formula in and d i Denote the degree of node i in the sampled subgraph and the original hypergraph respectively. Then calculate the difference in the size distribution of the hyperedge using the formula Error assessment uses a comprehensive metric, including the KL divergence of the degree distribution, the statistical distance of the hyperedge size distribution, and a structural similarity index. The evaluation process uses a sliding window technique to calculate the degree of preservation of local structural features. This step aims to quantify the quality of the sampling results and provide a basis for subsequent weight adjustments.
[0178] The specific implementation of step S50 is to compare the structural features of the sampled subgraph and the original hypergraph. This step is achieved by calculating the average relative error and the average relative error of hyperedge size To assess sampling quality, the comparison process uses normalization to eliminate the influence of different scales. Structural feature comparison uses a graph analysis method to calculate the similarity of eigenvalue distributions. This step sets multiple evaluation thresholds, including a degree distribution difference threshold of 0.1, a hyperedge size difference threshold of 0.15, and a comprehensive error threshold of 0.2.
[0179] The specific implementation of step S60 is to update the sampling weight. This step uses the error feedback mechanism. When the error exceeds the preset threshold, the formula Adjust the weights, where λ is the weight adjustment step size and θ is the error threshold. Weight updates are performed using the gradient descent principle, dynamically adjusting the update step size based on the error. An adaptive learning rate is used during the update process to avoid weight oscillations. The core of this step is to achieve dynamic weight optimization and improve sampling convergence.
[0180] Step S70 is implemented by performing weight normalization. This step first calculates the sum of the updated weights and then normalizes each weight to ensure that the sum is 1. The normalization process uses numerical stability optimization to avoid overflow and loss of precision. This step uses a fast normalization algorithm to improve computational efficiency.
[0181] The specific implementation of step S80 involves determining the sampling termination condition. This step determines whether to continue sampling by comparing the number of hyperedges currently sampled with the target number of samples. This determination process uses a dynamic threshold strategy to dynamically adjust the termination condition based on the sampling quality. The purpose of this step is to ensure the convergence and efficiency of the sampling process.
[0182] The specific implementation of step S90 is to generate the final sampled subgraph. This step first organizes the sampled node set and hyperedge set to construct a complete subgraph structure. The output process includes the subgraph's topological structure and statistical features, using a compressed storage format to reduce memory usage. The core of this step is to ensure the integrity and usability of the sampling results.
[0183] Description of the parameters involved in all steps: α is the weight adjustment parameter, which is used to control the shape of the weight distribution, with a value range of 0.1 to 2.0; β is the weight combination coefficient, which is used to balance the importance of different features, with a value range of 0 to 1; λ is the weight update step size, which controls the amplitude of weight adjustment, with a value range of 0.1 to 0.5; θ is the error threshold, which is used to determine whether the weight needs to be adjusted and is determined based on experimental data.
[0184] Special Function Descriptions: sign(x) is the sign function, which takes the value 1 when x is greater than 0, -1 when x is less than 0, and 0 when x is equal to 0; |x| represents the absolute value; Σ represents the summation operation; and max represents the maximum value. These functions play an important role in the algorithm implementation, ensuring the stability and accuracy of the calculation process.
[0185] Example 1: Structural feature-preserving sampling applied to microbial interaction networks
[0186] This example uses microbial interaction network data obtained from a soil microbial community research project for validation. This dataset contains 1258 species nodes and 2436 hyperedges, each representing a group of closely co-occurring or interacting microbial species. The raw data was obtained using 16S rRNA sequencing and constructed into a hypergraph structure after correlation analysis and significance testing. Specific data characteristics are shown in Table 1.
[0187] Table 1: Basic characteristics of microbial interaction network data
[0188]
[0189]
[0190] First, a hypergraph data structure was initialized, with microbial species as nodes and co-occurrence groups as hyperedges. Sampling parameters were set as follows: the sampling ratio was set to 30%, resulting in a target number of 731 hyperedges; the batch size was set to 12, meaning 12 hyperedges were sampled per round; and the weight adjustment parameter λ was set to 0.2. Global properties calculated from the original hypergraph included: an average hypergraph degree of 5.8, indicating that each microbial species participated in an average of 5.8 interactions; and an average hyperedge size of 3.2, indicating that each interaction group contained an average of 3.2 species.
[0191] During the weight calculation phase, special treatment was applied to hyperedge size and node degree weights, taking into account the characteristics of microbial interaction networks. For hyperedge size weights, more emphasis was placed on medium-sized interaction groups, as groups that are too small may represent random co-occurrences, while groups that are too large may contain excessive noise. Therefore, the weight adjustment parameter α was set to 1.5 to bias the weight distribution towards hyperedges with a size of 3 to 7 species. For node degree weights, emphasis was placed on key species involved in multiple interactions, as these species often play important roles in the community. Table 2 shows the initial weight calculation results for some hyperedges.
[0192] Table 2: Typical hyperedge weight calculation results (partial)
[0193] Hyperedge ID Number of species included Average Size Weight Degree Weight Comprehensive weight E001 3 4.2 0.023 0.018 0.021 E002 5 6.8 0.042 0.056 0.048 E003 2 3.1 0.012 0.015 0.013 E004 7 8.2 0.068 0.082 0.074 E005 4 5.5 0.035 0.042 0.038
[0194] During the sampling process, 12 hyperedges were selected each round and added to the sampling subgraph. The sampling process paid special attention to preserving the modular structure of the microbial community, a key characteristic of microbial interaction networks. After 61 rounds of sampling, a sampling subgraph containing 731 hyperedges was obtained. The change in error during the sampling process is shown in Table 3.
[0195] Table 3: Variation of sampling process error
[0196] Sampling rounds KL divergence of degree distribution Hyperedge size KL divergence Comprehensive error 10 0.425 0.386 0.406 20 0.312 0.298 0.305 30 0.245 0.232 0.239 40 0.183 0.175 0.179 50 0.142 0.138 0.140 61 0.108 0.112 0.110
[0197] The main features of the final sampling results are shown in Table 4. It can be seen that the sampled subgraph well preserves the key features of the original hypergraph.
[0198] Table 4: Comparison of sampling results characteristics
[0199] characteristic indicators Original hypergraph Sampling subgraph Relative error Average node degree 5.8 5.6 3.4% Average hyperedge size 3.2 3.1 3.1% Connectivity 0.023 0.022 4.3% Modularity coefficient 0.42 0.40 4.8%
[0200] Further analysis of the sampling results revealed that the sampled subgraphs successfully preserved important ecological patterns found in the original network. For example, dominant bacterial communities found in the original network maintained high connectivity in the sampled subgraphs, indicating that the ecological status of these key species was accurately reflected. Furthermore, the interaction patterns of some important functional groups, such as nitrifying bacteria and phosphate-solubilizing bacteria, in the sampled subgraphs remained highly consistent with those in the original network. This demonstrates that this method not only excels in statistical analysis but also in preserving biological significance.
[0201] In terms of computational performance, processing this microbial interaction network dataset containing 1258 nodes required a traditional random sampling method of approximately 15.6 seconds, while our method completed the sampling process in just 9.2 seconds. In terms of sampling quality, our method also significantly outperformed random sampling in preserving network characteristics. Table 5 provides a performance comparison of different sampling methods.
[0202] Table 5: Performance comparison of different sampling methods
[0203] method Run time (seconds) KL divergence of degree distribution Hyperedge size KL divergence Modularity retention rate Random Sampling 15.6 0.386 0.412 82% Degree-priority sampling 12.8 0.245 0.328 87% This method 9.2 0.108 0.112 95%
[0204] This example demonstrates that this sampling method can efficiently obtain representative subgraphs when processing hypergraph data with complex structural characteristics, such as microbial interaction networks. The sampling results not only maintain the statistical characteristics of the network but also well preserve the biological significance, providing an effective data simplification tool for microbial community research. In particular, when large-scale microbial interaction data needs to be analyzed, this method can significantly reduce the computing resource requirements while ensuring the reliability of the analysis results. This has important practical significance for understanding the complex structure and function of microbial communities.
[0205] Example 2: Structural Feature Preserving Sampling Applied to Metabolic Network Data
[0206] This example uses metabolite interaction network data obtained from a metabolomics research project for validation. This dataset contains 2865 metabolite nodes and 4328 hyperedges, each representing a set of metabolites participating in the same metabolic pathway or sharing similar chemical properties. The raw data were obtained using liquid chromatography-mass spectrometry (LC-MS / MS) and then constructed into a hypergraph structure after correlation analysis and metabolic pathway annotation. Specific data characteristics are shown in Table 6 below.
[0207] Table 6: Data characteristics
[0208] characteristic indicators Numerical Total number of nodes 2865 Total number of hyperedges 4328 Average node degree 8.4 Average hyperedge size 5.6 Maximum hyperedge size 18 Minimum hyperedge size 2 Connectivity 0.012
[0209] During the initialization phase, the sampling parameters were set as follows: a sampling ratio of 35%, meaning the target number of sampled hyperedges was 1515; and a batch size of 22, meaning 22 hyperedges were sampled per round. For metabolic networks, particular attention was paid to highly connected metabolite nodes, which often represent key metabolic intermediates. Therefore, a modified formula was used to calculate node weights:
[0210]
[0211] Among them, d v is the degree of node v, c v is the betweenness centrality of node v, α is set to 1.8, and γ is set to 0.3. The results of the hyperedge weight calculation are shown in Table 7:
[0212] Table 7: Partial display of hyperedge weight calculation results
[0213] Hyperedge ID Number of nodes Average betweenness Size Weight Degree Weight Comprehensive weight M001 6 0.185 0.032 0.045 0.038 M002 8 0.256 0.056 0.082 0.067 M003 4 0.142 0.024 0.028 0.026 M004 12 0.324 0.086 0.112 0.097 M005 7 0.218 0.042 0.058 0.049
[0214] The error change record of the sampling process is shown in Table 8:
[0215] Table 8: Error change record during sampling process
[0216]
[0217]
[0218] In order to evaluate the sampling quality, metabolic pathway integrity indicators were introduced:
[0219]
[0220] Where P is the set of all metabolic pathways, and p i The number of nodes in the sampled subgraph and the original hypergraph respectively represents the number of nodes contained in metabolic pathway i. The feature comparison of the final sampling results is shown in Table 9:
[0221] Table 9: Feature comparison of final sampling results
[0222] Evaluation Metrics Original Network Sampling subnetwork Relative error Average node degree 8.4 8.1 3.6% Average hyperedge size 5.6 5.4 3.8% Connectivity 0.012 0.011 4.2% Pathway integrity 1.000 0.965 3.5% Centrality retention rate 1.000 0.942 5.8%
[0223] This example records the sampling efficiency in detail as shown in Table 10:
[0224] Table 10: Sampling efficiency
[0225] Performance indicators Random Sampling Degree-priority sampling This method Run time (seconds) 28.5 22.6 16.8 Memory usage (MB) 486 512 428 KL divergence of degree distribution 0.425 0.285 0.125 Pathway integrity 0.856 0.892 0.965
[0226] Experimental results demonstrate that this method offers significant advantages when processing metabolic networks. In particular, the sampled subgraphs preserve the integrity of metabolic pathways, effectively retaining key metabolic pathway structures. For example, in the glycolysis pathway, all key enzymatic reaction nodes are preserved, and their interactions are accurately reflected. Furthermore, this method demonstrates excellent computational efficiency, reducing runtime by approximately 40% compared to traditional methods.
[0227] It should be noted that the variables involved in the present invention are explained in detail as shown in Table 11:
[0228] Table 11: Explanation of variables
[0229]
[0230]
[0231] Example 3:
[0232] like Figure 2 As shown in the figure, this paper proposes a hypergraph adaptive sampling method for preserving structural features. This method achieves efficient sampling of large-scale hypergraphs by dynamically adjusting sampling probabilities and optimizing error feedback strategies. The method mainly consists of two parts: the first part is the calculation of hyperedge weights; the second part is the adaptive sampling process.
[0233] Part 1:
[0234] Based on the topological properties of the hypergraph, the present invention calculates the weight of each hyperedge to guide the priority selection during the sampling process. The weight calculation method includes the following steps:
[0235] 1. Initialize the hypergraph H, the hyperedge set E, and the node set V.
[0236] 2. Calculate the hyperedge weight according to one of the following methods:
[0237] (1) Weight based on hyperedge size: Calculate the ratio of each hyperedge size to the total hyperedge size, and use the value of its power parameter α as the weight;
[0238] (2) Weight based on the average degree of nodes: Calculate the ratio of the average degree of the nodes connected by the hyperedge to the average degree of the nodes connected by all hyperedges, and use the value of the power parameter α as the weight;
[0239] (3) Comprehensive weight: The combined ratio of hyperedge size and node degree is introduced into the weight calculation to further optimize the weight distribution.
[0240] By adjusting the weight parameter α, the sampling weight distribution can be flexibly controlled to ensure that the sampling results are diverse and representative.
[0241] Part II:
[0242] S201. Initialization: Initialize the sampled sub-hypergraph Hs = (Vs, Es), where Vs and Es are initially empty. Set the sampling ratio r and batch size b. Calculate the global properties of the original hypergraph H (e.g., average node degree, average hyperedge size, etc.).
[0243] S202, Sampling Hyperedges: Based on the current weights, randomly select a batch of hyperedges Ebatch from E and add them to the sampling sub-hypergraph Es. At the same time, add the nodes of the selected hyperedges to Vs.
[0244] S203, evaluation error: Calculate the difference in global attributes between the sampled sub-hypergraph Hs and the original hypergraph H.
[0245] S204. Adjust weights: If the error exceeds a preset threshold, adjust the sampling weights of the hyperedges: For high-error attributes, prioritize increasing the weights of the hyperedges associated with them; for low-error attributes, reduce their impact on the sampling weights. The adjusted weights are used for the next round of sampling.
[0246] S205. Check sampling completion: Determine whether the number of hyperedges currently sampled reaches the target ratio r·|E|. If not, return to step S202; if so, jump to S206.
[0247] S206. Output sub-hypergraph: After sampling is completed, output the final sampling sub-hypergraph Hs=(Vs, Es).
[0248] Specifically, the core principle of the present invention, which enables it to resolve the aforementioned technical problems, lies in its innovative weight calculation and adaptive adjustment mechanism. Regarding weight calculation, the present invention simultaneously considers the characteristics of both hyperedge size and node degree, applying the power-law distribution principle to perform nonlinear mapping of these characteristics, resulting in a more rational weight distribution. Specifically, the hyperedge size weight reflects the coverage of the hyperedge; larger hyperedges tend to contain more structural information; the node degree weight reflects the connectivity characteristics of nodes; high-degree nodes play an important bridging role in the network. The combination of these two weights considers both local and global structural features, ensuring comprehensive sampling. Regarding the adaptive adjustment mechanism, the present invention constructs a weight update strategy based on error feedback by calculating the structural differences between the sampled subgraph and the original hypergraph in real time. When significant deviations in certain structural features are detected, the system automatically increases the sampling weights of the relevant hyperedges, and decreases them otherwise. This dynamic adjustment mechanism continuously optimizes the sampling process, gradually approaching the ideal sampling result. Furthermore, the present invention utilizes batch processing and normalization techniques to ensure both computational efficiency and numerical stability. Theoretically, the effectiveness of this approach is based on the following logic: First, a multi-dimensional weighting design ensures that the sampling process captures the key structural features of the hypergraph; second, an adaptive adjustment mechanism provides a way to optimize the sampling strategy; and finally, a batch processing strategy improves sampling stability by accumulating information from multiple samples while ensuring efficiency. The entire design adheres to the fundamentals of graph theory and statistics, and is fully feasible both theoretically and practically.
[0249] The above description is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A hypergraph adaptive sampling method for preserving structural features, characterized in that: The following steps are involved: S10, initializing a hypergraph and sampling parameters, wherein the hypergraph includes a node set and a hyperedge set, setting a sampling ratio, a batch size, and weight adjustment parameters, and calculating global properties of the hypergraph; S20, calculating the initial sampling weight of each hyperedge in the hyperedge set based on the hyperedge size, node degree distribution, and combination ratio; S30, randomly selecting a batch of hyperedges from the hyperedge set according to the sampling weights, adding the batch of hyperedges to a sampling sub-hypergraph, and simultaneously adding nodes corresponding to the batch of hyperedges to a node set of the sampling sub-hypergraph; S40, calculating the difference between the sampling sub-hypergraph and the hypergraph in global attributes, and adjusting the sampling weight according to the difference; S50, comparing the hypergraph average degree and the average hyperedge size of the sampled sub-hypergraph with the hypergraph to obtain an error value; S60, updating the sampling weight according to the error value, increasing the hyperedge weight corresponding to the portion with a larger error when the error value is greater than a preset threshold, and decreasing the hyperedge weight corresponding to the portion with a smaller error when the error value is less than the preset threshold; S70, normalizing the updated sampling weights so that the sum of all hyperedge weights is 1; S80, determining whether the number of hyperedges in the sampled sub-hypergraph reaches the target sampling number, if not, returning to step S30 to continue sampling, if yes, executing step S90; S90: Output the sampled sub-hypergraph as the final sampling result.
2. A hypergraph adaptive sampling method for preserving structural features according to claim 1, characterized in that: The step S10 specifically includes: Step 101: construct a node set and a hyperedge set of the hypergraph, wherein the node set includes all nodes and the hyperedge set includes all hyperedges; Step 102: Setting the sampling ratio to determine the number of hyperedges finally sampled, wherein the sampling ratio is the ratio of the number of sampled hyperedges to the total number of original hyperedges; Step 103: Setting the batch size for determining the number of hyperedges to be sampled in each round, wherein the batch size is 0.5% of the total number of original hyperedges; Step 104: Set the weight adjustment parameter, where the value range of the weight adjustment parameter is 0.1 to 0.5; Step 105: Calculate the global properties of the hypergraph, including the hypergraph average degree and the hyperedge average size, wherein the hypergraph average degree is the average of the degrees of all nodes, and the hyperedge average size is the average of the number of nodes contained in all hyperedges.
3. The hypergraph adaptive sampling method for preserving structural features according to claim 2, characterized in that: The step S20 specifically includes: Step 201: Calculate the size weight of each hyperedge, where the size weight is the ratio of the number of nodes of each hyperedge to the total number of nodes of all hyperedges in the hyperedge set. Step 202: Calculate the node degree weight of each hyperedge, where the node degree weight is the ratio of the average degree of the nodes connected by the hyperedge to the average degree of the nodes connected by all hyperedges. Step 203: Calculate the combined weight of each hyperedge, where the combined weight is obtained by weighted combination of the size weight and the node degree weight. Step 204: performing a power operation on the combined weight to obtain an initial sampling weight, wherein the power parameter of the power operation is used to adjust the weight distribution; Step 205: Normalize the initial sampling weights so that the sum of the initial sampling weights of all hyperedges is 1.
4. The hypergraph adaptive sampling method for preserving structural features according to claim 3, characterized in that: The step S30 specifically includes: Step 301: construct a cumulative probability distribution according to the sampling weights, and the cumulative probability distribution is used to randomly select hyperedges; Step 302: Generate batch size random numbers, where each random number has a value range of 0 to 1; Step 303: Select corresponding hyperedges from the cumulative probability distribution according to the random number to form a batch of hyperedges; Step 304: Add the batch of hyperedges to the hyperedge set of the sampled sub-hypergraph; Step 305: Identify all nodes included in the batch of hyperedges, and add nodes that are not added to the node set of the sampled sub-hypergraph to the node set of the sampled sub-hypergraph.
5. The hypergraph adaptive sampling method for preserving structural features according to claim 4, characterized in that: The step S40 specifically includes: Step 401: Calculate the degrees of all nodes in the sampled sub-hypergraph to obtain the node degree distribution of the sampled sub-hypergraph; Step 402: Calculate the sizes of all hyperedges in the sampled sub-hypergraph to obtain the hyperedge size distribution of the sampled sub-hypergraph; Step 403: Calculate the difference between the average degree of the sampled sub-hypergraph and the average degree of the hypergraph; Step 404: Calculate the difference between the average hyperedge size of the sampled sub-hypergraph and the average hyperedge size of the hypergraph; Step 405: The node degree distribution difference and the hyperedge size distribution difference are integrated to obtain an overall difference value.
6. The hypergraph adaptive sampling method for preserving structural features according to claim 5, characterized in that: The step S50 specifically includes: Step 501: Count the degree of each node in the sampled sub-hypergraph and calculate the average degree of the sampled sub-hypergraph; Step 502: Count the number of nodes contained in each hyperedge in the sampled sub-hypergraph, and calculate the average hyperedge size of the sampled sub-hypergraph; Step 503: Calculate the relative error between the average degree of the sampled sub-hypergraph and the average degree of the hypergraph; Step 504: Calculate the relative error between the average hyperedge size of the sampled sub-hypergraph and the average hyperedge size of the hypergraph; Step 505: Compare the relative error with a preset threshold to obtain an error value.
7. The hypergraph adaptive sampling method for preserving structural features according to claim 6, characterized in that: The step S60 specifically includes: Step 601: Identify attribute features with larger errors according to the error values; Step 602: identifying hyperedges associated with the attribute feature with a larger error; Step 603: When the error value is greater than the preset threshold, increase the weight of the hyperedge corresponding to the larger error portion according to the weight adjustment parameter; Step 604: When the error value is less than the preset threshold, reduce the weight of the hyperedge corresponding to the portion with smaller error according to the weight adjustment parameter; Step 605: Record the updated sampling weights for the next round of sampling.
8. The hypergraph adaptive sampling method for preserving structural features according to claim 7, characterized in that: The step S70 specifically includes: Step 701: Calculate the updated sum of the sampling weights; Step 702: Divide the sampling weight of each hyperedge by the total sampling weight. Step 703: Verify whether the sum of the normalized sampling weights is 1; Step 704: storing the normalized sampling weights; Step 705: Use the normalized sampling weights in the next round of sampling.
9. The hypergraph adaptive sampling method for preserving structural features according to claim 8, characterized in that: The step S80 specifically includes: Step 801: Count the total number of hyperedges in the sampled sub-hypergraph; Step 802: Calculate the target sampling quantity according to the sampling ratio; Step 803: Determine whether the total number of hyperedges in the sampled sub-hypergraph reaches the target sampling number; Step 804: When the target sampling quantity is not reached, the process returns to step S30; Step 805: When the target sampling quantity is reached, continue to execute step S90.
10. The hypergraph adaptive sampling method for preserving structural features according to claim 9, characterized in that: The step S90 specifically includes: Step 901: Arrange the node set and hyperedge set of the sampled sub-hypergraph; Step 902: Verify the integrity of the sampled sub-hypergraph to ensure that all hyperedge nodes are in the node set; Step 903: Calculate characteristic indicators of the sampled sub-hypergraph, including node degree distribution and hyperedge size distribution; Step 904: Encapsulate the node set, hyperedge set, and characteristic indexes of the sampled sub-hypergraph; Step 905: Output the encapsulated sampling sub-hypergraph as the final sampling result.
Citation Information
Patent Citations
Key node set discovery method based on hypergraph neural network
CN114154023A
Social network multivariate relation and event prediction method based on supermotif embedding
CN116932925A
Reasoning method based on structural attention mechanism for knowledge-based question answering and computing apparatus for performing the same
US20240070492A1