A hypergraph adaptive sampling method for structure feature preservation
The hypergraph adaptive sampling method, which employs multi-dimensional weight calculation and dynamic adjustment mechanisms, solves the problem of balancing efficiency and quality in existing hypergraph sampling techniques. It achieves efficient and accurate hypergraph sampling and is suitable for large-scale hypergraph data.
Patent Information
- Application Number
- CN202510823404.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-19
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-06-19
AI Technical Summary
Existing hypergraph sampling methods cannot achieve efficient sampling while preserving the structural features of the hypergraph, especially when dealing with large-scale hypergraphs, where it is difficult to balance sampling quality and computational efficiency.
An adaptive sampling method for hypergraphs that preserves structural features is adopted. This method utilizes a multi-dimensional weight calculation mechanism, combined with batch sampling and dynamic weight adjustment, to ensure that the sampling process fully preserves the structural features of the original hypergraph. The method includes initializing the hypergraph and sampling parameters, calculating the initial weights of hyperedges and nodes, adjusting the sampling weights to reduce errors, and outputting the final sampled subgraph when the target number of samples is reached.
At low sampling ratios, the KL divergence of the sampling results is reduced by more than 75% compared with traditional random sampling methods, and the computational efficiency is improved by 40%, while ensuring sampling quality and robustness, especially showing significant advantages when dealing with large-scale heterogeneous hypergraphs.
Smart Images

Figure CN120705361B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer modeling technology, and more specifically, relates to a hypergraph adaptive sampling method for preserving structural features. Background Technology
[0002] With the advent of the big data era, hypergraphs, as an important data representation method, have been widely applied in fields such as social network analysis, recommender systems, and bioinformatics. In particular, in microbial interaction networks, hypergraphs can model complex interactions between multiple microbial species, such as symbiosis, competition, and predation, which traditional graph structures struggle to capture. In social network analysis, hypergraphs can represent multidimensional associations such as interests and topics among user groups, surpassing the simple binary relationships between users in traditional social networks. In protein interaction network analysis, hypergraphs can represent protein complexes where multiple proteins jointly participate in a biological process, reflecting real biological functions more accurately than simple pairwise interactions. In genome-scale metabolic networks, hypergraphs can represent complex reaction relationships between multiple substrates and products, revealing the overall structure and function of intracellular metabolic pathways. Therefore, hypergraphs, as a general-purpose multi-relationship data modeling tool, have significant academic research value and broad application prospects.
[0003] Hypergraphs differ from traditional graph structures in that their edges can connect multiple nodes, better describing complex multi-party relationships. In practical applications, hypergraphs are often very large, and directly processing the entire hypergraph incurs enormous 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, the main hypergraph sampling methods include random sampling, degree-first sampling, and edge-first sampling. While random sampling is simple to implement, it ignores the structural features of the hypergraph, resulting in poor representativeness of the sampling results. Degree-first sampling samples based on the degree of nodes but does not 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 features, making it difficult to maintain the global topology. These existing methods generally suffer from a technical problem: they cannot achieve efficient sampling while maintaining the structural features of the hypergraph, especially when processing large-scale hypergraphs, where sampling quality and computational efficiency are difficult to balance. Summary of the Invention
[0004] In view of this, the present invention provides a hypergraph adaptive sampling method for structural feature preservation, which can solve the problem that existing technologies cannot achieve efficient sampling while preserving the structural features of the hypergraph.
[0005] This invention is implemented as follows:
[0006] This invention provides a hypergraph adaptive sampling method for structural feature preservation, comprising the following steps:
[0007] S10. Initialize the hypergraph and sampling parameters. The hypergraph contains a node set and a hyperedge set. Set the sampling ratio, batch size, and weight adjustment parameters. Calculate the global attributes of the hypergraph.
[0008] S20. Calculate 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 select a batch of superedges from the set of superedges according to the sampling weights, add the batch of superedges to the sampling sub-hypergraph, and add the nodes corresponding to the batch of superedges to the node set of the sampling sub-hypergraph.
[0010] S40. Calculate the difference value between the sampled sub-hypergraph and the hypergraph in terms of global attributes, and adjust the sampling weight according to the difference value;
[0011] S50. Compare the average degree of the sampled sub-hypergraph with the average size of the hyperedge of the hypergraph to obtain the error value;
[0012] S60. Update the sampling weights according to the error value. When the error value is greater than a preset threshold, increase the weight of the super-edge corresponding to the larger error portion. When the error value is less than the preset threshold, decrease the weight of the super-edge corresponding to the smaller error portion.
[0013] S70. Normalize the updated sampling weights so that the sum of all hyperedge weights is 1.
[0014] S80. Determine whether the number of hyperedges in the sampled sub-hypergraph has reached the target sampling number. If not, return to step S30 to continue sampling. If it has reached the target, execute step S90.
[0015] S90. Output the sampled sub-hypergraph as the final sampling result.
[0016] The technical effects of the adaptive sampling method for hypergraphs with structural feature preservation provided by this invention are as follows: The adaptive sampling method for hypergraphs with structural feature preservation proposed in this invention effectively solves the aforementioned technical problems. First, by introducing a multi-dimensional weight calculation mechanism, this method comprehensively considers the size of hyperedges and the degree distribution of nodes, ensuring that the sampling process can fully preserve the structural features of the original hypergraph. Second, by adopting a batch sampling strategy and a dynamic weight adjustment mechanism, the sampling efficiency is significantly improved, enabling this method to effectively handle large-scale hypergraph data. Specifically, under 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 subgraph better preserves the degree distribution characteristics of the original hypergraph. In terms of computational efficiency, the running time of this invention is reduced by an average of 40% compared to existing methods, while ensuring sampling quality. Furthermore, through an adaptive weight update mechanism, this invention enables the sampling process to dynamically adjust the strategy according to the error, further improving the accuracy and robustness of sampling. In practical application tests, this invention demonstrates excellent performance on multiple datasets, especially showing significant advantages when processing large-scale heterogeneous hypergraphs.
[0017] Based on the above technical solution, the hypergraph adaptive sampling method for structural feature preservation of the present invention can be further improved as follows:
[0018] Specifically, step S10 includes:
[0019] Step 101: Construct the node set and the hyperedge set of the hypergraph, wherein the node set contains all nodes and the hyperedge set contains all hyperedges;
[0020] Step 102: Set the sampling ratio to determine the final number of superedges sampled. The sampling ratio is the ratio of the number of sampled superedges to the total number of original superedges.
[0021] Step 103: Set the batch size to determine the number of superedges in each round of sampling. The batch size is 0.5% of the original total number of superedges.
[0022] Step 104: Set the weight adjustment parameter, wherein 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 average degree of the hypergraph and the average size of the hyperedge, wherein the average degree of the hypergraph is the average degree of all nodes, and the average size of the hyperedge is the average number of nodes contained in all hyperedges.
[0024] Furthermore, 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 in each hyperedge to the total number of nodes in 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 all nodes connected by the hyperedge.
[0027] Step 203: Calculate the combined weight of each hyperedge, which is obtained by weighting the size weight and the node degree weight.
[0028] Step 204: Perform a power operation on the combined weights to obtain the initial sampling weights. 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, step S30 specifically includes:
[0031] Step 301: Construct a cumulative probability distribution based on the sampling weights, wherein the cumulative probability distribution is used to randomly select superedges;
[0032] Step 302: Generate the specified number of random numbers in the batch, with each random number ranging from 0 to 1;
[0033] Step 303: Select corresponding superedges from the cumulative probability distribution according to the random number to form the batch of superedges;
[0034] Step 304: Add the batch of superedges to the superedge set of the sampled sub-hypergraph;
[0035] Step 305: Identify all nodes contained in the batch of hyperedges, and add the nodes that have not been added to the node set of the sampled sub-hypergraph to the node set of the sampled sub-hypergraph.
[0036] Furthermore, step S40 specifically includes:
[0037] Step 401: Calculate the degree of all nodes in the sampled sub-hypergraph to obtain the node degree distribution of the sampled sub-hypergraph;
[0038] Step 402: Calculate the size 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: Combine the differences in node degree distribution and the differences in hyperedge size distribution to obtain the overall difference value.
[0042] Furthermore, 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 of 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 the error value.
[0048] Furthermore, step S60 specifically includes:
[0049] Step 601: Identify the attribute features with larger errors based on the error values;
[0050] Step 602: Identify the hyperedges associated with the attribute features that have larger errors;
[0051] Step 603: When the error value is greater than the preset threshold, increase the weight of the superedge corresponding to the larger part of the error according to the weight adjustment parameter;
[0052] Step 604: When the error value is less than the preset threshold, reduce the weight of the superedge corresponding to the smaller error portion according to the weight adjustment parameter;
[0053] Step 605: Record the updated sampling weights for the next round of sampling.
[0054] Furthermore, step S70 specifically includes:
[0055] Step 701: Calculate the sum of the updated sampling weights;
[0056] Step 702: Divide the sampling weight of each hyperedge by the sum of the sampling weights;
[0057] Step 703: Verify whether the sum of the normalized sampling weights is 1;
[0058] Step 704: Store the normalized sampling weights;
[0059] Step 705: Use the normalized sampling weights for the next round of sampling.
[0060] Furthermore, 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 based on 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: If the target sampling number is not reached, return to step S30.
[0065] Step 805: When the target sampling number is reached, continue to execute step S90.
[0066] Furthermore, step S90 specifically includes:
[0067] Step 901: Organize 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 nodes of the hyperedges are in the node set;
[0069] Step 903: Calculate the feature indices of the sampled sub-hypergraph, including node degree distribution and hyperedge size distribution;
[0070] Step 904: Encapsulate the node set, hyperedge set, and feature index 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's global attributes in step S10 is specifically represented as follows:
[0073] Formula for calculating the average degree of a hypermap: In the formula, d avg The average degree of the hypergraph; |V| is the total number of nodes; d i Let be the degree of the i-th node, representing the number of hyperedges that the node participates in.
[0074] Formula for calculating the average size of the superedge: In the formula, s avg is the average size of the hyperedges; |E| is the total number of hyperedges; sj Let be the size of the j-th superedge, representing the number of nodes contained in the superedge.
[0075] 2. The weight calculation in step S20 is specifically represented as follows:
[0076] Weight calculation based on hyperedge size: In the formula, w s,j Let s be the size weight of the j-th superedge; j Let be the size of the j-th hyperedge; α is the weight adjustment parameter, with a value ranging from 0.1 to 2.0.
[0077] Weight calculation based on average node degree: In the formula, w d,j Let e be the node degree weight of the j-th superedge; j Denotes the j-th superedge; d i Let i be the degree of node i.
[0078] Overall weight calculation: w j =βw s,j +(1-β)w d,j In the formula, w j β is the comprehensive weight of the j-th hyperedge; β is the weight combination coefficient, with a value ranging from 0 to 1.
[0079] 3. The calculation of the difference value in step S40 is specifically expressed as follows:
[0080] Calculation of node degree distribution differences: In the formula, D d Differences in node degree distribution; and d i , respectively, are the degrees of node i in the sampled sub-hypergraph and the original hypergraph; and d max These are the maximum node degrees in the sampled sub-hypergraph and the original hypergraph, respectively.
[0081] Calculation of differences in hyperedge size distribution: In the formula, D s The difference lies in the distribution of hyperedge size; and s j These represent the sizes of hyperedge j in the sampled sub-hypergraph and the original hypergraph, respectively; and s max These represent the maximum hyperedge size 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 degree relative error: In the formula, E d This represents the average relative error. and d avg These represent the average degree of the sampled sub-hypergraph and the original hypergraph, respectively.
[0084] Calculation of relative error of average super-edge size: In the formula, E s This represents the relative error of the average super-edge size; and s avg These represent the average hyperedge size of the sampled sub-hypergraph and the original hypergraph, respectively.
[0085] 5. The weight update in step S60 is specifically represented as follows:
[0086] Weighting adjustment formula: In the formula, The updated weights; w j λ is the current weight; E is the weight adjustment parameter; j The error is related to the hyperedge j; θ is the preset threshold; sign() is the sign function.
[0087] The principles and significance of constructing the above equations are explained as follows: 1. The reason for using a power relationship (α parameter) is to flexibly adjust the skewness of the weight distribution. When α>1, it emphasizes large-value features, and when α<1, it reduces differences. 2. The reason for using relative value calculation is to eliminate the influence of different scales, so that various features can be reasonably combined. 3. The reason for introducing an 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 a sign function is to realize the dynamic adjustment of weights, and to determine whether to increase or decrease weights based on the sign of the error.
[0088] These equations have the following advantages over existing technologies: 1. They consider multi-dimensional structural features, including not only node degree but also hyperedge size; 2. They introduce an adaptive adjustment mechanism that can dynamically optimize weights based on sampling results; 3. They incorporate normalization to ensure the stability of the sampling process; 4. Through parameterized design, they provide greater flexibility and adaptability.
[0089] The derivation process and parameter sources for each equation are explained in detail below:
[0090] 1. Derivation of the formula for calculating the average degree of a hypergraph: First, consider the degree calculation of a single node: In the formula, I ij This is an indicator function, which is 1 when node i belongs to hyperedge j, and 0 otherwise.
[0091] Then, the average of the degrees of all nodes is obtained: This formula reflects the network's connection density, and the parameter |V| is obtained by traversing the node set.
[0092] 2. Derivation of the weight calculation formula:
[0093] First, consider the original proportions of the superedge size:
[0094] The second step involves introducing nonlinear adjustment: 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 impact of node degree and design the average degree weight: This formula is optimized through the following steps: 1) First, calculate the average degree of the nodes inside the hyperedge; 2) Compare it with the global average degree; 3) Apply the same nonlinear adjustment mechanism.
[0096] Step 4: Design the overall weighting: w j =βw s,j +(1-β)w d,j Methods 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 formula for calculating the difference value:
[0098] First, consider the basic form of distributional differences: D basic =∑|P s -P|; where P s P and P represent the sampling and the original distribution, respectively.
[0099] To eliminate the scale effect, normalization is introduced:
[0100] Similarly, differences in the size of the hyperedge are handled in a similar manner:
[0101] 4. Derivation of the weight update formula:
[0102] Step 1, Basic Error Response: Δw j =λ·sign(E j -θ);
[0103] The second step is to consider the impact of the current weights:
[0104] The final form is obtained by merging:
[0105] The parameter settings are based on the following: λ ranges from 0.1 to 0.5, obtained through experimental optimization; θ is set as the median of the error distribution; E j It is obtained through calculation of local structural features.
[0106] Compared with existing technologies, the beneficial effects of the adaptive sampling method for hypergraphs with structural feature preservation provided by this invention are as follows: This method effectively solves the aforementioned technical problems. First, by introducing a multi-dimensional weight calculation mechanism, it comprehensively considers the size of hyperedges and the degree distribution of nodes, ensuring that the sampling process fully preserves the structural features 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 handle large-scale hypergraph data. Specifically, with 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 subgraph better preserves the degree distribution characteristics of the original hypergraph. In terms of computational efficiency, the running time of this invention is reduced by an average of 40% compared to existing methods, while ensuring sampling quality. Furthermore, through an adaptive weight update mechanism, this invention enables the sampling process to dynamically adjust the strategy according to errors, further improving the accuracy and robustness of sampling. In practical application tests, this invention demonstrates excellent performance on multiple datasets, especially showing significant advantages when processing large-scale heterogeneous hypergraphs. Attached Figure Description
[0107] Figure 1 A flowchart of a hypergraph adaptive sampling method for structural feature preservation;
[0108] Figure 2 This is a third embodiment of a hypergraph adaptive sampling method for preserving structural features. Detailed Implementation
[0109] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings.
[0110] like Figure 1 The diagram shown is a flowchart of a hypergraph adaptive sampling method for structural feature preservation provided by the present invention. This process includes the following steps:
[0111] S10. Initialize the hypergraph and sampling parameters. The hypergraph contains a node set and a hyperedge set. Set the sampling ratio, batch size and weight adjustment parameters, and calculate the global attributes of the hypergraph.
[0112] S20. Calculate 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 select a batch of superedges from the superedge set according to the sampling weight, add the batch of superedges to the sampling sub-hypergraph, and add the nodes corresponding to the batch of superedges to the node set of the sampling sub-hypergraph.
[0114] S40. Calculate the difference between the sampled sub-hypergraph and the hypergraph in terms of global attributes, and adjust the sampling weights according to the difference values;
[0115] S50. Compare the average degree of the sampled sub-hypergraph with the average size of the hyperedge to obtain the error value;
[0116] S60. Update the sampling weights according to the error value. When the error value is greater than the preset threshold, increase the weight of the super-edge corresponding to the larger part of the error. When the error value is less than the preset threshold, decrease the weight of the super-edge corresponding to the smaller part of the error.
[0117] S70. Normalize the updated sampling weights so that the sum of all super-edge weights is 1.
[0118] S80. Determine whether the number of hyperedges in the sampled sub-hypergraph has reached the target sampling number. If not, return to step S30 to continue sampling. If it has reached the target, execute step S90.
[0119] S90, output the sampling sub-hypergraph as the final sampling result.
[0120] In the above technical solution, step S10 specifically includes:
[0121] Step 101: Construct the node set and hyperedge set of the hypergraph, where the node set contains all nodes and the hyperedge set contains all hyperedges;
[0122] Step 102: Set the sampling ratio to determine the final number of sampled hyperedges. 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 superedges in each round of sampling. The batch size is 0.5% of the original total number of superedges.
[0124] Step 104: Set the weight adjustment parameters. The value range of the weight adjustment parameters 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. The average degree of the hypergraph is the average degree of all nodes, and the average size of the hyperedges is the average 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. The size weight is the ratio of the number of nodes in each hyperedge to the total number of nodes in all hyperedges in the hyperedge set.
[0128] Step 202: Calculate the node degree weight of each hyperedge. The node degree weight is the ratio of the average degree of the nodes connected by the hyperedge to the average degree of all nodes connected by the hyperedge.
[0129] Step 203: Calculate the combined weight of each hyperedge. The combined weight is obtained by weighting the size weight and the node degree weight.
[0130] Step 204: Perform a power operation on the combined weights to obtain the initial sampling weights. 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. The cumulative probability distribution is used to randomly select superedges.
[0134] Step 302: Generate a batch of random numbers, each of which has a value ranging from 0 to 1;
[0135] Step 303: Select corresponding superedges from the cumulative probability distribution based on random numbers to form a batch of superedges;
[0136] Step 304: Add a batch of superedges to the superedge set of the sampled sub-hypergraph;
[0137] Step 305: Identify all nodes contained 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 degree of all nodes in the sampled sub-hypergraph to obtain the node degree distribution of the sampled sub-hypergraph;
[0140] Step 402: Calculate the size of all hyperedges in the sampled sub-hypergraph to obtain the distribution of hyperedge sizes in 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: Combine the differences in node degree distribution and the differences in hyperedge size distribution to obtain the 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 of 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-supermap and the average degree of the supermap;
[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 the preset threshold to obtain the 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: Identify the hyperedges associated with the attribute features that have large errors;
[0153] Step 603: When the error value is greater than the preset threshold, adjust the parameters according to the weight to increase the weight of the superedge corresponding to the larger part of the error.
[0154] Step 604: When the error value is less than the preset threshold, adjust the parameters according to the weight to reduce the weight of the superedge corresponding to the smaller error.
[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 the updated sampling weights;
[0158] Step 702: Divide the sampling weight of each hyperedge by the sum of the sampling weights;
[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 based on the sampling ratio;
[0165] Step 803: Determine whether the total number of hyperedges in the sampled sub-hypergraph has reached the target sampling number;
[0166] Step 804: If the target number of samples has not been reached, return to step S30.
[0167] Step 805: When the target number of samples is reached, continue to execute step S90.
[0168] Furthermore, in the above technical solution, step S90 specifically includes:
[0169] Step 901: Organize 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 nodes of the hyperedges are in the node set;
[0171] Step 903: Calculate the feature indices of the sampled sub-hypergraph, including node degree distribution and hyperedge size distribution;
[0172] Step 904: Encapsulate the node set, hyperedge set, and feature index of the sampled sub-hypergraph;
[0173] Step 905: Output the encapsulated sampled sub-hypergraph as the final sampling result.
[0174] The specific implementation of step S10 involves initializing the hypergraph data structure and sampling parameters. Its core is constructing the basic representation of the hypergraph and configuring the necessary parameters. First, the hypergraph data structure is constructed, using an adjacency matrix and an incidence matrix to store the hypergraph's topology. The adjacency matrix represents the connection relationships between nodes, and the incidence matrix records the dependency relationships between nodes and hyperedges. The basic attributes of the hypergraph include node degree distribution, hyperedge size distribution, and connection density, which are calculated by traversing the hypergraph structure. The average degree of the hypergraph is calculated using the formula... Perform the calculation, where d i This represents the degree of node i; for the average size of the hyperedge, use the formula... Perform the calculation, where s jThis represents 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 hypergraph size. The sampling ratio is typically set between 10% and 80%, the batch size is set to 0.5% of the original total number of hyperedges, and the weight adjustment parameter ranges from 0.1 to 0.5. The purpose of this step is to provide the necessary data structures and parameter support for subsequent sampling processes, ensuring the efficient operation of the sampling algorithm.
[0175] The specific implementation of step S20 involves calculating the initial sampling weights of the hyperedge. This step first calculates the weights based on the structural features of the hyperedge, including weight calculations based on the hyperedge size, using the formula... Where α is the weight adjustment parameter; then the weights based on the average degree of nodes are calculated using the formula. Finally, the combined weights are obtained by combining the two weights. j =βw s,j +(1-β)w d,j The weight calculation employs a power-law distribution principle, controlling the shape of the weight distribution by adjusting the parameter α, which ranges from 0.1 to 2.0. This step uses normalization to ensure the weights sum to 1, and a hierarchical sampling strategy guarantees a reasonable allocation of sampling probabilities for hyperedges of different sizes. The weight calculation process considers multiple feature dimensions of the hyperedge, including size, node degree distribution, and local structural features, combining these features to improve the representativeness of the sampling.
[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 weights. A Monte Carlo sampling method is employed to generate a uniformly distributed sequence of random numbers, and the corresponding hyperedge indices are determined using binary search. Batch sampling utilizes a sampling-without-replacement strategy to ensure that the same hyperedge is not selected repeatedly. During sampling, the hyperedge set is dynamically updated, and sampled hyperedges are removed from the candidate set. For each selected hyperedge, its associated nodes are added to the node set of the sampled subgraph, and the degree information of the nodes is updated. A hash table is used to optimize search efficiency and reduce redundant computations during the sampling process. 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 involves evaluating the sampling error. This step first calculates the difference in the node degree distribution using the formula... in and d i Let represent the degree of node i in the sampled subgraph and the original hypergraph, respectively. Then, calculate the difference in hyperedge size distribution using the formula... Error assessment employs a comprehensive metric, including the KL divergence of the degree distribution, the statistical distance of the hyperedge size distribution, and structural similarity indices. The assessment process utilizes 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, providing a basis for subsequent weight adjustments.
[0178] The specific implementation of step S50 involves comparing the structural features of the sampled subgraph and the original hypergraph. This step is achieved by calculating the average degree relative error. Relative error of average super-edge size To evaluate sampling quality, normalization is used in the comparison process to eliminate the influence of different scales. Structural feature comparison employs 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 weights. This step uses an error feedback mechanism; when the error exceeds a preset threshold, an error is detected using a formula. The weights are adjusted, where λ is the weight adjustment step size and θ is the error threshold. Weight updates employ the gradient descent principle, dynamically adjusting the update step size based on the error magnitude. An adaptive learning rate is used during the update process to avoid weight oscillations. The core of this step is to achieve dynamic optimization of the weights, improving sampling convergence.
[0180] The specific implementation of step S70 involves performing weight normalization. This step first calculates the updated total weights, then normalizes each weight to ensure the weight sum equals 1. The normalization process employs numerical stability optimization to avoid numerical overflow and precision loss. 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 compares the current number of hyperedges with the target number of samples to decide whether to continue sampling. The determination process employs a dynamic threshold strategy, dynamically adjusting 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 characteristics, and uses 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] The parameters involved in all steps are explained as follows: α is the weight adjustment parameter, which controls the shape of the weight distribution and has a value range of 0.1 to 2.0; β is the weight combination coefficient, which is used to balance the importance of different features and has a value range of 0 to 1; λ is the weight update step size, which controls the magnitude of the weight adjustment and has 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, taking 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; 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 preservation sampling applied to microbial interaction networks
[0186] This embodiment uses microbial interaction network data obtained from a soil microbial community research project for validation. The dataset contains 1258 species nodes and 2436 hyperedges, each representing a group of co-occurring or closely interacting microbial species. The raw data was obtained through 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, the hypergraph data structure is initialized, with microbial species as nodes and co-occurrence relationship groups as hyperedges. Sampling parameters are set as follows: sampling ratio is set to 30%, meaning the target number of sampled hyperedges is 731; batch size is set to 12, meaning 12 hyperedges are sampled per round; and the weight adjustment parameter λ is set to 0.2. The global attributes calculated from the original hypergraph include: average hypergraph degree of 5.8, indicating that each microbial species participates in an average of 5.8 interactions; and average hyperedge size of 3.2, indicating that each interaction group contains an average of 3.2 species.
[0191] In the weight calculation stage, considering the characteristics of microbial interaction networks, special treatment was applied to the hyperedge size weight and node degree weight. For the hyperedge size weight, more attention was paid to medium-sized interaction groups, because excessively small groups may represent random co-occurrence, while excessively large groups may contain too much noise. Therefore, the weight adjustment parameter α was set to 1.5 to make the weight distribution more biased towards hyperedges with 3 to 7 species. For the node degree weight, the focus was on key species involved in multiple interaction relationships, 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] Super-edge ID Number of species included average degree Size weight Degree weight Overall 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 in each round to be added to the sampling subgraph. Special attention was paid to maintaining the modular structure of the microbial community during the sampling process, which is an important characteristic of microbial interaction networks. After 61 rounds of sampling, a sampling subgraph containing 731 hyperedges was obtained. The error variation during the sampling process is shown in Table 3.
[0195] Table 3: Sampling process error variation
[0196] Sampling rounds KL divergence of degree distribution Superedge 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 subgraphs have well preserved the key features of the original hypergraph.
[0198] Table 4: Comparison of Sampling Result Features
[0199] Feature indicators Original Hypergraph Sampling subgraph relative error Average node degree 5.8 5.6 3.4% Average super-edge size 3.2 3.1 3.1% Connectivity 0.023 0.022 4.3% Modular coefficient 0.42 0.40 4.8%
[0200] Further analysis of the sampling results revealed that the sampled subgraphs successfully preserved important ecological patterns from the original network. For example, the dominant bacterial communities identified in the original network maintained high connectivity in the sampled subgraphs, indicating that the ecological status of these key species was accurately reflected. Simultaneously, the interaction patterns of some important functional groups, such as nitrifying bacteria and phosphorus-solubilizing bacteria communities, remained highly consistent with those in the original network. This demonstrates that this method not only performs well in terms of statistical characteristics but also effectively preserves biological significance.
[0201] In terms of computational performance, processing this microbial interaction network dataset containing 1258 nodes requires approximately 15.6 seconds using traditional random sampling methods, while our proposed method completes the sampling process in just 9.2 seconds. Regarding sampling quality, our method also significantly outperforms random sampling in preserving network characteristics. Table 5 presents a performance comparison of different sampling methods.
[0202] Table 5: Performance Comparison of Different Sampling Methods
[0203] method Runtime (seconds) KL divergence of degree distribution Superedge size KL divergence Modular retention rate Random sampling 15.6 0.386 0.412 82% Degree-first sampling 12.8 0.245 0.328 87% This method 9.2 0.108 0.112 95%
[0204] This embodiment demonstrates that the sampling method can efficiently acquire representative subgraphs when processing hypergraph data with complex structural features, such as microbial interaction networks. The sampling results not only preserve the statistical characteristics of the network but also retain its biological significance, providing an effective data simplification tool for microbial community research. Particularly when analyzing large-scale microbial interaction data, this method can significantly reduce computational resource requirements while ensuring the reliability of the analysis results. This has important practical implications for understanding the complex structure and function of microbial communities.
[0205] Example 2: Structural feature preservation sampling applied to metabolic network data
[0206] This embodiment 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 involved in the same metabolic pathway or with similar chemical properties. The raw data was obtained using liquid chromatography-mass spectrometry (LC-MS / MS) and 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] Feature indicators numerical values Total number of nodes 2865 Total number of super-edges 4328 Average node degree 8.4 Average super-edge size 5.6 Maximum superedge size 18 Minimum superedge size 2 Connectivity 0.012
[0209] The initialization phase sampling parameters are set as follows: sampling ratio is 35%, meaning the target number of sampled hyperedges is 1515; batch size is 22, meaning 22 hyperedges are sampled per round. For metabolic networks, special attention is paid to highly connected metabolite nodes, which typically represent key metabolic intermediates. Therefore, an improved formula is used for node weight calculation:
[0210]
[0211] Where, d v Let c be the degree of node v. v For the betweenness centrality of node v, α is set to 1.8 and γ to 0.3. The results of the hyperedge weight calculation are partially shown in Table 7.
[0212] Table 7: Partial Display of Hyperedge Weight Calculation Results
[0213] Super-edge ID Number of nodes Mean Betweenness Size weight Degree weight Overall 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 variation record during the sampling process is shown in Table 8:
[0215] Table 8: Error Variation Records During the Sampling Process
[0216]
[0217]
[0218] To assess sampling quality, a metabolic pathway integrity indicator was introduced:
[0219]
[0220] Where P represents the set of all metabolic pathways. and p i These represent the number of nodes contained in metabolic pathway i in the sampled subgraph and the original hypergraph, respectively. A comparison of the features of the final sampling results is shown in Table 9.
[0221] Table 9: Feature Comparison of Final Sampling Results
[0222] Evaluation indicators Original network Sampling subnetwork relative error Average node degree 8.4 8.1 3.6% Average super-edge 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] The sampling efficiency was recorded in detail in this embodiment, as shown in Table 10:
[0224] Table 10: Sampling Efficiency
[0225] Performance indicators Random sampling Degree-first sampling This method Runtime (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 in processing metabolic networks. Particularly in preserving the integrity of metabolic pathways, the sampled subgraphs effectively retain the 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 exhibits excellent computational efficiency, saving approximately 40% of the runtime compared to traditional methods.
[0227] It should be noted that the variables involved in this invention are explained in detail in Table 11:
[0228] Table 11: Explanation of Variables
[0229]
[0230]
[0231] Example 3:
[0232] like Figure 2 As shown, this invention proposes an adaptive sampling method for hypergraphs to preserve structural features. This method achieves efficient sampling of large-scale hypergraphs by dynamically adjusting sampling probabilities and using an error feedback optimization strategy. It mainly consists of two parts: the first part is the calculation of hyperedge weights; the second part is the adaptive sampling process.
[0233] Part One:
[0234] This invention, based on the topological properties of hypergraphs, calculates the weight of each hyperedge to guide priority selection during the sampling process. The weight calculation method includes the following steps:
[0235] 1. Initialize the hypergraph H, with the hyperedge set E and the node set V.
[0236] 2. Calculate the hyperedge weights using one of the following methods:
[0237] (1) Weights based on hyperedge size: Calculate the ratio of the size of each hyperedge to the total size of the hyperedges, 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 all nodes connected by the hyperedge, and use the value of its power parameter α as the weight.
[0239] (3) Comprehensive weight: The combined ratio of the superedge size and node degree is introduced into the weight calculation to further optimize the weight allocation.
[0240] By adjusting the weight parameter α, the distribution of sampling weights can be flexibly controlled to ensure that the sampling results are diverse and representative.
[0241] Part Two:
[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 attribute values of the original hypergraph H (such as the 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 sampled 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 superedges: for high-error attributes, prioritize increasing the weights of the superedges associated with them; for low-error attributes, reduce their impact on the sampling weights. The adjusted weights are then used in the next round of sampling.
[0246] S205. Check sampling completion: Determine whether the current number of superedges sampled has reached the target proportion r·|E|. If not, return to step S202; if it has, jump to S206.
[0247] S206. Output sub-hypergraph: After sampling is completed, output the final sampled sub-hypergraph Hs = (Vs, Es).
[0248] Specifically, the principle of this invention is as follows: The core principle that enables this invention to solve the aforementioned technical problems lies in its innovative weight calculation and adaptive adjustment mechanism. Regarding weight calculation, this invention considers both hyperedge size and node degree as features, using a power-law distribution principle to perform nonlinear mapping on the features, resulting in a more reasonable weight allocation. Specifically, the hyperedge size weight reflects the coverage of the hyperedge; larger hyperedges often 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. This combination of weights considers both local and global structural features, ensuring comprehensive sampling. Regarding the adaptive adjustment mechanism, this 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 a large deviation in certain structural features is detected, the system automatically increases the sampling weight of the relevant hyperedges; conversely, it decreases the weight. This dynamic adjustment mechanism allows the sampling process to be continuously optimized, gradually approaching the ideal sampling result. Furthermore, this invention employs batch processing and normalization techniques, ensuring both computational efficiency and numerical stability. Theoretically, the effectiveness of this method is based on the following logic: First, the multi-dimensional weight design ensures that the sampling process can capture the key structural features of the hypergraph; second, the adaptive adjustment mechanism provides an optimization path for the sampling strategy; finally, the batch processing strategy improves the stability of sampling by accumulating information from multiple samples while ensuring efficiency. The entire scheme design conforms to the basic principles of graph theory and statistics, and is fully feasible in both theory and practice.
[0249] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.
Claims
1. A hypergraph adaptive sampling method for structural feature preservation, characterized in that, Includes the following steps: 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. Calculate the global attributes of the hypergraph. S20. Calculate the initial sampling weight of each hyperedge in the hyperedge set based on the hyperedge size, node degree distribution, and combination ratio; S30. Randomly select a batch of superedges from the set of superedges according to the sampling weights, add the batch of superedges to the sampling sub-hypergraph, and add the nodes corresponding to the batch of superedges to the node set of the sampling sub-hypergraph. S40. Calculate the difference value between the sampled sub-hypergraph and the hypergraph in terms of global attributes, and adjust the sampling weight according to the difference value; S50. Compare the average degree of the sampled sub-hypergraph with the average size of the hyperedge of the hypergraph to obtain the error value; S60. Update the sampling weights according to the error value. When the error value is greater than a preset threshold, increase the weight of the super-edge corresponding to the larger error portion. When the error value is less than the preset threshold, decrease the weight of the super-edge corresponding to the smaller error portion. S70. Normalize the updated sampling weights so that the sum of all hyperedge weights is 1. S80. Determine whether the number of hyperedges in the sampled sub-hypergraph has reached the target sampling number. If not, return to step S30 to continue sampling. If it has reached the target, execute step S90. S90. Output the sampled sub-hypergraph as the final sampling result.
2. The hypergraph adaptive sampling method for structural feature preservation according to claim 1, characterized in that, Step S10 specifically includes: Step 101: Construct the node set and the hyperedge set of the hypergraph, wherein the node set contains all nodes and the hyperedge set contains all hyperedges; Step 102: Set the sampling ratio to determine the final number of superedges sampled. The sampling ratio is the ratio of the number of sampled superedges to the total number of original superedges. Step 103: Set the batch size to determine the number of superedges in each round of sampling. The batch size is 0.5% of the original total number of superedges. Step 104: Set the weight adjustment parameter, wherein 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 average degree of the hypergraph and the average size of the hyperedge, wherein the average degree of the hypergraph is the average degree of all nodes, and the average size of the hyperedge is the average number of nodes contained in all hyperedges.
3. The hypergraph adaptive sampling method for structural feature preservation according to claim 2, characterized in that, 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 in each hyperedge to the total number of nodes in 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 all nodes connected by the hyperedge. Step 203: Calculate the combined weight of each hyperedge, which is obtained by weighting the size weight and the node degree weight. Step 204: Perform a power operation on the combined weights to obtain the initial sampling weights. 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 structural feature preservation according to claim 3, characterized in that, Step S30 specifically includes: Step 301: Construct a cumulative probability distribution based on the sampling weights, the cumulative probability distribution being used to randomly select superedges; Step 302: Generate the specified number of random numbers in the batch, with each random number ranging from 0 to 1; Step 303: Select corresponding superedges from the cumulative probability distribution according to the random number to form the batch of superedges; Step 304: Add the batch of superedges to the superedge set of the sampled sub-hypergraph; Step 305: Identify all nodes contained in the batch of hyperedges, and add the nodes that have not been 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 structural feature preservation according to claim 4, characterized in that, Step S40 specifically includes: Step 401: Calculate the degree of all nodes in the sampled sub-hypergraph to obtain the node degree distribution of the sampled sub-hypergraph; Step 402: Calculate the size 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: Combine the differences in node degree distribution and the differences in hyperedge size distribution to obtain the overall difference value.
6. The hypergraph adaptive sampling method for structural feature preservation according to claim 5, characterized in that, 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 of 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 the error value.
7. The hypergraph adaptive sampling method for structural feature preservation according to claim 6, characterized in that, Step S60 specifically includes: Step 601: Identify the attribute features with larger errors based on the error values; Step 602: Identify the hyperedges associated with the attribute features that have larger errors; Step 603: When the error value is greater than the preset threshold, increase the weight of the superedge corresponding to the larger part of the error according to the weight adjustment parameter; Step 604: When the error value is less than the preset threshold, reduce the weight of the superedge corresponding to the smaller error portion 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 structural feature preservation according to claim 7, characterized in that, Step S70 specifically includes: Step 701: Calculate the sum of the updated sampling weights; Step 702: Divide the sampling weight of each hyperedge by the sum of the sampling weights; Step 703: Verify whether the sum of the normalized sampling weights is 1; Step 704: Store the normalized sampling weights; Step 705: Use the normalized sampling weights for the next round of sampling.
9. A hypergraph adaptive sampling method for structural feature preservation according to claim 8, characterized in that, Step S80 specifically includes: Step 801: Count the total number of hyperedges in the sampled sub-hypergraph; Step 802: Calculate the target sampling quantity based on the sampling ratio; Step 803: Determine whether the total number of hyperedges in the sampled sub-hypergraph reaches the target sampling number; Step 804: If the target sampling number is not reached, return to step S30. Step 805: When the target sampling number is reached, continue to execute step S90.
10. A hypergraph adaptive sampling method for structural feature preservation according to claim 9, characterized in that, Step S90 specifically includes: Step 901: Organize 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 nodes of the hyperedges are in the node set; Step 903: Calculate the feature indices of the sampled sub-hypergraph, including node degree distribution and hyperedge size distribution; Step 904: Encapsulate the node set, hyperedge set, and feature index 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