A hypergraph segmentation method, system and medium based on hyperedge clustering coarsening
The hypergraph data is processed through the hyper-edge clustering coarse method, which solves the problem of medium and high time complexity of ultra-large-scale integrated circuit segmentation, realizes efficient hypergraph segmentation, and improves algorithm performance.
Patent Information
- Application Number
- CN202210248203.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-14
- Publication Date
- 2025-07-29
- Estimated Expiration
- 2042-03-14
AI Technical Summary
When the existing hypergraph segmentation algorithms deal with super-large-scale integrated circuits, they have problems of high time complexity and poor segmentation effects, making it difficult to get close to the optimal solution.
The hyper-edge clustering coarse method is used to convert the circuit into hypergraph data, initialize and model, judge the scale is larger than the preset threshold value and then roughen it, initially segment it according to the number of preset partitions, and the node partition position is adjusted by optimization to output the final segmented hypergraph.
The computing efficiency of the ultra-large-scale hypergraph segmentation algorithm is improved, and the hypergraph data of different sparse degrees is adapted to, and the performance of the segmentation algorithm is improved.
Smart Images

Figure CN114626331B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of high-dimensional hypergraph data segmentation processing, and particularly to a hypergraph segmentation method, system and medium based on hyperedge clustering coarsening. Background Art
[0002] With the continuous expansion of the scale of integrated circuits, hypergraph segmentation is widely used in the design of very large scale integrated circuits to reduce the complexity in computing, so as to achieve the purpose of reducing time consumption and improving algorithm performance. One of the difficulties in very large scale hypergraph segmentation lies in the relatively high time complexity in the subsequent optimization stage. In the case of a very large number of nodes, common classical hypergraph segmentation algorithms are difficult to achieve good performance when processing very large scale integrated circuit netlists, and the effect of hypergraph segmentation is usually not good and it is difficult to approach the optimal solution. Summary of the Invention
[0003] In order to solve the above technical problems, the purpose of the present invention is to provide a hypergraph segmentation method, system and medium based on hyperedge clustering coarsening, which can improve the operation efficiency of very large scale hypergraph segmentation algorithms.
[0004] The first technical solution adopted by the present invention is: a hypergraph segmentation method based on hyperedge clustering coarsening, comprising the following steps:
[0005] S1. Convert the circuit into hypergraph data and perform initialization and modeling processing to obtain the hypergraph data scale;
[0006] S2. When it is judged that the hypergraph data scale is greater than a preset threshold value, coarsen the hypergraph data based on the hyperedge clustering method to obtain a coarsened hypergraph;
[0007] S3. Perform an initial segmentation on the coarsened hypergraph according to the preset number of partitions to obtain a segmented hypergraph;
[0008] S4. Optimize the segmented hypergraph, adjust the node partition positions in the hypergraph, and output the final segmented hypergraph.
[0009] Further, before the step of obtaining the hypergraph data and performing initialization and modeling processing to obtain the hypergraph data scale, it further includes:
[0010] S11. Represent the circuit as composed of primitive cells, use nodes to represent primitive cells, and use hyperedges to represent the connections between primitive cells;
[0011] S12. Set the number of partitions and the balance parameter, and count the number of hyperedges and nodes to obtain the hypergraph data scale.
[0012] Further, the step of determining that the hypergraph data scale exceeds the preset threshold value and coarsening the hypergraph data based on the hyperedge clustering method to obtain the coarsened hypergraph specifically includes:
[0013] S21. Judge the hypergraph scale;
[0014] S22. When it is judged that the hypergraph scale is greater than the preset threshold value, randomly select a hyperedge as the initial set data;
[0015] S23. Search for and record other hyperedges connected to the nodes on the initial set data and the number of times all the hyperedges in the set are searched;
[0016] S24. Incorporate the hyperedges whose occurrence times exceed the preset ratio of the number of nodes contained in the hyperedge into the initial set;
[0017] S25. Repeat steps S23 and S24 until the preset condition is reached, and lock the hyperedges in the initial set;
[0018] S26. Repeat step S22 to search for a new hyperedge set among the unlocked hyperedges until there are no unlockable hyperedges that can be clustered in the current hypergraph data, and obtain the hyperedge set data;
[0019] S27. Take the union of the nodes contained in all the hyperedges in the hyperedge set data to obtain the node set data, and exclude the nodes with too low proportion of the number of internal hyperedges associated with the nodes in all the hyperedges associated with the nodes, to obtain the final node set data;
[0020] S28. Perform node merging in the final node set data and record the merged node pairs to complete the coarsening of the hypergraph data and obtain the coarsened hypergraph.
[0021] Further, the step of initially partitioning the coarsened hypergraph according to the preset number of partitions to obtain the partitioned hypergraph specifically includes:
[0022] S31. Initially partition the coarsened hypergraph according to the preset number of partitions;
[0023] S32. When it is judged that a node is initially assigned to a fixed partition, move the node to the corresponding assigned partition;
[0024] S33. When it is judged that there is a partition without initially assigned nodes, randomly select an unpartitioned node and move it to this partition;
[0025] S34. Place the unassigned nodes in a separate temporary partition;
[0026] S35. Calculate the benefits of moving the unassigned nodes to different partitions according to the objective function to obtain the benefit situation;
[0027] S36. Based on the greedy strategy and the revenue situation, select the allocation method with the largest revenue from the nodes that have never moved and move them;
[0028] S37. For each moved node, update the revenue of the remaining unmoved nodes;
[0029] S38. Repeat step S36 until all nodes have been moved.
[0030] Furthermore, the step of optimizing the segmented hypergraph, adjusting the node partition positions in the hypergraph, and outputting the final segmented hypergraph specifically includes:
[0031] S41. Construct a list based on the merged node pairs and perform reverse processing to obtain a list of merged node pairs;
[0032] S42. Take out the currently last merged node pair from the list of merged node pairs and disassemble it to obtain the target nodes;
[0033] S43. Calculate the revenue of the target nodes moving to different partitions;
[0034] S44. Adjust the partition positions of the target nodes according to the revenue;
[0035] S45. If any node moves in step S44, update the revenue of the other nodes connected to this node moving to different partitions;
[0036] S46. Repeat step S42 until there are no more merged node pairs, and output the final segmented hypergraph.
[0037] The second technical solution adopted by the present invention is: A hypergraph segmentation system based on hyperedge clustering coarsening, including:
[0038] A modeling module, configured to obtain hypergraph data and perform initialization and modeling processing to obtain the hypergraph data scale;
[0039] A coarsening module, configured to determine that the hypergraph data scale is greater than a preset threshold value, and based on the hyperedge clustering method, coarsen the hypergraph data to obtain a coarsened hypergraph;
[0040] A segmentation module, configured to perform an initial segmentation on the coarsened hypergraph according to the preset number of partitions to obtain a segmented hypergraph;
[0041] An optimization module, configured to optimize the segmented hypergraph, adjust the node partition positions in the hypergraph, and output the final segmented hypergraph.
[0042] The third technical solution adopted by the present invention is: a medium in which instructions executable by a processor are stored, characterized in that: the instructions executable by the processor are used to implement the above-mentioned method for hypergraph segmentation based on hyperedge clustering coarsening when executed by the processor.
[0043] The beneficial effects of the method, system and medium of the present invention are: in view of the characteristic that the hypergraph segmentation of the present invention is segmented according to the objective function, similar nodes are clustered by hyperedge clustering at the initial stage of coarsening, which can efficiently coarsen hypergraph data with different sparsity degrees, and further improve the operation efficiency of the hypergraph segmentation algorithm. Description of the Drawings
[0044] Figure 1 is a flowchart of the steps of a method for hypergraph segmentation based on hyperedge clustering coarsening according to the present invention;
[0045] Figure 2 is a structural block diagram of a system for hypergraph segmentation based on hyperedge clustering coarsening according to the present invention;
[0046] Figure 3 is a comparison graph of the CUTNET segmentation quality between the hypergraph segmentation algorithm based on hyperedge clustering coarsening according to the present invention and the existing hMetis hypergraph segmentation tool;
[0047] Figure 4 is a comparison graph of the running time between the hypergraph segmentation algorithm based on hyperedge clustering coarsening according to the present invention and the existing hMetis hypergraph segmentation tool. Detailed Embodiments
[0048] The following further describes the present invention in detail with reference to the drawings and specific embodiments. For the step numbers in the following embodiments, they are only set for the convenience of description and explanation, and no limitation is made on the order between steps. The execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
[0049] As Figure 1 shown, the present invention provides a method for hypergraph segmentation based on hyperedge clustering coarsening, and the method includes the following steps:
[0050] S1. Convert the circuit into hypergraph data and perform initialization and modeling processing to obtain the hypergraph data scale;
[0051] S11. Represent the circuit as composed of primitive cells, represent the primitive cells by nodes, and represent the connections between primitive cells by hyperedges;
[0052] S12. Set the number of partitions and the balance parameter, and count the number of hyperedges and nodes to obtain the hypergraph data scale.
[0053] Specifically, set the number of partition parameters k = 8, that is, determine that the specific number of hypergraph segmentation regions is 8, which is also the number of divisions of hypergraph segmentation; set the number of hyperedges E = 12060 and the number of nodes V = 25027 of the hypergraph; set the balance parameter ε = 0.5. The setting of the balance parameter determines the maximum and minimum number of nodes in each partition of the hypergraph segmentation. The data range of the balance parameter ε is limited to (0, 1). The maximum number of nodes specified for each partition The minimum number of nodes specified for each partition is where c(V) represents the total number of nodes in the hyper Figure 1 graph. Then the maximum number of nodes specified for each of the above partitions is L max = 4693, and the minimum number of nodes is L min = 1565.
[0054] S2. Determine that the hypergraph data size is greater than the preset threshold. Based on the hyperedge clustering method, coarsen the hypergraph data to obtain the coarsened hypergraph;
[0055] S21. Judge the scale of the hypergraph;
[0056] S22. Determine that the hypergraph scale is greater than the preset threshold, and randomly select a hyperedge as the initial set Θ E data;
[0057] Specifically, the specific threshold reference here is 160×k = 1280. Since the number of nodes is 25027 which is greater than the threshold, I need to perform a coarsening operation to coarsen the number of nodes of the hypergraph to 1280.
[0058] S23. Search for and record other hyperedges e connected to the nodes in the initial set Θ E data and the number of times σ(e) that all hyperedges in the set are searched;
[0059] S24. Incorporate the hyperedges whose occurrence times exceed the preset ratio of the number of nodes included in the hyperedge into the initial set;
[0060] Specifically, screen out the hyperedges whose occurrence times exceed a certain ratio τ of the number of nodes included in the hyperedge through the judgment threshold τ < σ(e) / |e| and incorporate them into the set Θ E inside. The specific threshold τ is generally set to 0.5 for a relatively good overall effect.
[0061] S25. Repeat steps S23 and S24 until the preset condition is reached, and lock the hyperedges in the initial set;
[0062] Specifically, repeat steps S23 and S24 to search, record and screen until the set Θ E is too large or there are no new hyperedges, thus obtaining a set ΘE and lock the hyperedges in the set Θ E .
[0063] S26. Repeat step S22 to search for a new hyperedge set Θ in the un-locked hyperedges E until there are no un-locked hyperedges that can be clustered in the current hypergraph data, and obtain the hyperedge set data;
[0064] S27. Take the union of the nodes contained in all hyperedges in the hyperedge set data, and exclude the nodes with too low proportion of the number of internal hyperedges associated with the node in all the hyperedges associated with the node, to obtain the final node set data;
[0065] Specifically, for each hyperedge set data Θ obtained in the above steps E according to the nodes contained in each internal hyperedge as the node set data Θ V , exclude the nodes with too low proportion of the number of internal hyperedges associated with the node in all the hyperedges associated with the node I(v), that is, through the criterion to further reduce the scale of the set data and obtain the final node set data Θ V . The criterion τ in this step s is generally also set to 0.4.
[0066] S28. Perform node merging in the final node set data and record the merged node pairs to complete the coarsening of the hypergraph data and obtain the coarsened hypergraph.
[0067] Specifically, complete the coarsening to reduce the scale of the overall hypergraph data.
[0068] S3. Perform an initial partition on the coarsened hypergraph according to the preset number of partitions to obtain the partitioned hypergraph;
[0069] Specifically, perform an initial partition on the hypergraph after completing step S2, and partition the hypergraph into k non-overlapping partitions.
[0070] S31. If it is determined that a node is initially assigned to a fixed partition, move the node to the corresponding assigned partition;
[0071] S32. If it is determined that a partition has no initially assigned nodes, randomly select an un-partitioned node and move it to this partition;
[0072] S33. If it is determined that a partition has no initially assigned nodes, randomly select an un-partitioned node and move it to this partition;
[0073] Specifically, according to whether there are nodes initially assigned to fixed partitions, in the case where there are nodes initially partitioned into fixed partitions, first move these nodes to the corresponding assigned partitions; if there are no initially partitioned nodes, randomly select nodes and partition them into different partitions, ensuring that each partition has exactly one node.
[0074] S34. Place the unassigned nodes in a separate temporary partition;
[0075] Specifically, this partition is not included in the final hypergraph partition.
[0076] S35. Calculate the benefits of moving the unassigned nodes to different partitions according to the objective function to obtain the benefit situation;
[0077] Specifically, calculate the benefit situation of moving the unassigned nodes to different partitions and sort these benefits in descending order. The objective function can be CUTNET.
[0078] S36. Based on the greedy strategy and the benefit situation, select the allocation method with the greatest benefit from the nodes that have not been moved and move them;
[0079] Specifically, this step needs to meet the constraints of the maximum and minimum number of nodes in each partition.
[0080] S37. Every time a node is moved, update the benefits of the remaining nodes that have not been moved;
[0081] S38. Repeat step S36 until all nodes have been moved.
[0082] S4. Optimize the partitioned hypergraph, adjust the node partition positions in the hypergraph, and output the final partitioned hypergraph.
[0083] Specifically, optimize the partitioned hypergraph, separate the nodes that were coarsened and merged before and readjust the best node partition positions, so as to achieve higher-quality hypergraph partitioning.
[0084] S41. Construct a list based on the merged node pairs and perform reverse processing to obtain the merged node pair list;
[0085] Specifically, reverse processing always places the last merged node pair at the head of the list.
[0086] S42. Take out the currently last merged node pair from the merged node pair list and disassemble it to obtain the target nodes;
[0087] Specifically, disassemble the merged nodes from the node pair to obtain the target nodes.
[0088] S43. Calculate the benefits of moving the target nodes to different partitions;
[0089] Specifically, calculate the "benefit" that the target node can bring when moving to different partitions. The moving rule is to move the node from the current partition to the target partition.
[0090] S44. Adjust the position of the partition of the target node according to the benefit;
[0091] Specifically, if the benefit of moving to other partitions is not positive, choose not to move. Otherwise, move the target node to the partition with the greatest benefit.
[0092] S45. Determine that any node in step S44 generates a movement, and update the benefit of other nodes connected to this node when moving to different partitions;
[0093] S46. Repeat step S42 until there are no node pairs to be merged, and output the final segmented hypergraph.
[0094] Specifically, the scale of the current node is restored to the node data scale of the original hypergraph.
[0095] The comparative experiment is as follows:
[0096] From Figure 3 It can be seen that the hypergraph segmentation method based on hyperedge clustering coarsening of the present invention is relatively close to the segmentation quality of hMeti. The specific related definition of CUTNET is as follows:
[0097] f c (П)=∑ e∈E ω(e)
[0098] where П={V1,…,V k} represents the final segmentation result.
[0099] The CUTNET objective function aims to minimize the sum of the weights of the segmented hyperedges.
[0100] Figure 4 The time required for hypergraph segmentation of the hypergraph segmentation method based on hyperedge clustering coarsening of the present invention and the existing hypergraph segmentation tool hMetis under different numbers of segmentations is given (as a standard for judging the time complexity of hypergraph segmentation)
[0101] As Figure 2 shown, a hypergraph segmentation system based on hyperedge clustering coarsening includes:
[0102] A modeling module, configured to obtain hypergraph data and perform initialization and modeling processing to obtain the hypergraph data scale;
[0103] A coarsening module, configured to determine that the hypergraph data scale is greater than a preset threshold value, and coarsen the hypergraph data based on the hyperedge clustering method to obtain a coarsened hypergraph;
[0104] A splitting module, configured to perform an initial split on the coarsened hypergraph according to a preset number of partitions, to obtain a split hypergraph;
[0105] An optimization module, configured to optimize the split hypergraph, adjust the node partition positions in the hypergraph, and output a final split hypergraph.
[0106] The content in the above method embodiments is applicable to the present system embodiment. The functions specifically implemented by the present system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.
[0107] A hypergraph splitting device based on hyperedge clustering coarsening:
[0108] At least one processor;
[0109] At least one memory, configured to store at least one program;
[0110] When the at least one program is executed by the at least one processor, the at least one processor implements a hypergraph splitting method based on hyperedge clustering coarsening as described above.
[0111] The content in the above method embodiments is applicable to the present device embodiment. The functions specifically implemented by the present device embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.
[0112] A medium, in which processor-executable instructions are stored, characterized in that: the processor-executable instructions, when executed by a processor, are used to implement a hypergraph splitting method based on hyperedge clustering coarsening as described above.
[0113] The content in the above method embodiments is applicable to the present storage medium embodiment. The functions specifically implemented by the present storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those in the above method embodiments.
[0114] The above has specifically described the preferred embodiments of the present invention, but the present invention is not limited to the described embodiments. Those skilled in the art can also make various equivalent deformations or substitutions without departing from the spirit of the present invention, and these equivalent deformations or substitutions are all included within the scope defined by the claims of the present application.
Claims
1. A hypergraph segmentation method based on super-edge clustering coarsening, characterized in that, It includes the following steps: S1. Convert the circuit into hypergraph data and perform initialization and modeling processing to obtain the hypergraph data scale; S2. Determine that the hypergraph data scale is greater than the preset threshold, and based on the hyperedge clustering method, coarsen the hypergraph data to obtain the coarsened hypergraph; S3. Perform an initial segmentation on the coarsened hypergraph according to the preset number of partitions to obtain the segmented hypergraph; S4. Optimize the segmented hypergraph, adjust the node partition positions in the hypergraph, and output the final segmented hypergraph; The step of optimizing the segmented hypergraph, adjusting the node partition positions in the hypergraph, and outputting the final segmented hypergraph specifically includes: S41. Construct a list based on the merged node pairs and perform reverse processing to obtain the merged node pair list; S42. Take out the currently last merged node pair from the merged node pair list and disassemble it to obtain the target node; S43. Calculate the benefits of moving the target node to different partitions; S44. Adjust the partition position of the target node according to the benefits; S45. Determine that any node moves in step S44, and update the benefits of moving other nodes connected to this node to different partitions; S46. Repeat step S42 until there are no more merged node pairs, and output the final segmented hypergraph.
2. The hypergraph segmentation method based on superedge clustering coarsening according to claim 1, wherein The step of converting the circuit into hypergraph data and performing initialization and modeling processing to obtain the hypergraph data scale specifically includes: S11. Represent the circuit as composed of cells, use nodes to represent cells, and hyperedges to represent the connections between cells; S12. Set the number of partitions and the balance parameter, and count the number of hyperedges and nodes to obtain the hypergraph data scale.
3. The hypergraph segmentation method based on hyperedge clustering coarsening according to claim 2, characterized in that, The step of determining that the hypergraph data scale is greater than the preset threshold, and based on the hyperedge clustering method, coarsen the hypergraph data to obtain the coarsened hypergraph specifically includes: S21. Judge the hypergraph scale; S22. Determine that the hypergraph scale is greater than the preset threshold, and randomly select a hyperedge as the initial set data; S23. Search for and record other hyperedges connected to the nodes on the initial set data and the number of times all hyperedges in the set are searched; S24. Incorporate the hyperedges whose occurrence times exceed the preset ratio of the number of nodes contained in the hyperedge into the initial set; S25. Repeat steps S23 and S24 until the preset condition is reached, and lock the hyperedges in the initial set; S26. Repeat step S22 to search for new hyperedge sets among the unlocked hyperedges until there are no unlocked hyperedges that can be clustered in the current hypergraph data to obtain the hyperedge set data; S27. Take the union of the nodes contained in all hyperedges in the hyperedge set data, and exclude the nodes with too low a proportion of the number of internal hyperedges associated with the node in all hyperedges associated with the node to obtain the final node set data; S28. Perform node merging in the final node set data and record the merged node pairs to complete the coarsening of the hypergraph data and obtain the coarsened hypergraph.
4. The hypergraph segmentation method based on hyperedge clustering coarsening according to claim 3, wherein The step of performing an initial segmentation on the coarsened hypergraph according to the preset number of partitions to obtain the segmented hypergraph specifically includes: S31. Perform an initial segmentation of the coarsened hypergraph according to the preset number of partitions; S32. If it is determined that a node has been initially assigned to a fixed partition, move the node to the corresponding assigned partition; S33. If it is determined that there is a partition to which no node has been initially assigned, randomly select an unpartitioned node and move it to this partition; S34. Place the unassigned nodes in a separate temporary partition; S35. Calculate the benefits of moving the unassigned nodes to different partitions according to the objective function to obtain the benefit situation; S36. Based on the greedy strategy and the benefit situation, select the allocation method with the greatest benefit from the nodes that have not been moved and perform the move; S37. For each moved node, update the benefits of the remaining nodes that have not been moved; S38. Repeat step S36 until all nodes have been moved.
5. A hypergraph segmentation system based on hyperedge clustering coarsening, characterized in that, Used to execute a hypergraph segmentation method based on hyperedge clustering coarsening as described in any one of claims 1, including: A modeling module, used to obtain hypergraph data and perform initialization and modeling processing to obtain the scale of the hypergraph data; A coarsening module, used to determine that the scale of the hypergraph data is greater than a preset threshold value, and based on the hyperedge clustering method, coarsen the hypergraph data to obtain a coarsened hypergraph; A segmentation module, used to perform an initial segmentation of the coarsened hypergraph according to the preset number of partitions to obtain a segmented hypergraph; An optimization module, used to optimize the segmented hypergraph, adjust the node partition positions in the hypergraph, and output the final segmented hypergraph.
6. A medium storing processor-executable instructions, characterized in that: The instructions executable by the processor are used to implement a hypergraph segmentation method based on hyperedge clustering coarsening as described in any one of claims 1-4 when executed by the processor.
Citation Information
Patent Citations
High-dimensional data clustering method based on unweighted hypergraph segmentation
CN105279524A