Graph clustering method and equipment

The core hyper-edge set and similar hyper-edge set of the hypergraph are determined by preset hyper-edge index and query parameters. The core hyper-edge is used as the starting point of clustering to cluster similar hyper-edges, which solves the problem of low efficiency of large-scale hyper-graph clustering and realizes efficient hyper-graph structural clustering.

CN120541561APending Publication Date: 2025-08-26BEIJING OCEANBASE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510626225.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-15
Publication Date
2025-08-26

AI Technical Summary

Technical Problem

In the prior art, when clustering large-scale hypergraphs, the efficiency is low and the structural similarity calculation cannot be efficiently performed, resulting in slow clustering speed.

Method used

By presetting the hyper-edge index and query parameters, the core hyper-edge set and similar hyper-edge set of the hypergraph are determined. The core hyper-edge is used as the starting point of clustering to cluster the similar hyper-edge, and the structural similarity calculation for each pair of adjacent hyper-edges is reduced.

Benefits of technology

It significantly improves the time performance of hypergraph structural clustering, and can efficiently cluster large-scale hypergraphs, reducing calculation time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120541561A_ABST
    Figure CN120541561A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a graph clustering method and equipment. The method comprises the following steps: querying from a hyperedge index according to query parameters to obtain a core hyperedge set of the hypergraph and a similar hyperedge set of core hyperedges; clustering the similar hyperedges in the similar hyperedge set of the core hyperedges by taking the core hyperedges as clustering starting points to obtain a plurality of class clusters; and classifying hyperedges of the hypergraph outside the plurality of class clusters. According to the technical scheme of the embodiment of the invention, the calculation time consumption of graph clustering can be reduced, so that large-scale hypergraphs can be efficiently and structurally clustered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of big data technology, and in particular to a graph clustering method and electronic device. Background Art

[0002] With the development of Internet technology, the use of graph data structures has become increasingly common. For example, social networks, information networks, e-commerce networks, and biological networks all use graph data structures. How to analyze graph data structures has become a research focus.

[0003] Due to the powerful expressive power of graph data structures, many practical applications model data and relationships between data as a graph G = (V, E), where the vertices in V represent entities of interest and the edges in E represent the relationships between entities. A hypergraph is a basic graph structure composed of hyperedges, where each hyperedge connects any number of vertices. Hypergraphs can capture high-order relationships between multiple entities in a network, such as a social network. In related technical solutions, vertices in a hypergraph are clustered based on structural similarity, such as cosine similarity, between the vertices.

[0004] However, in this technical solution, since the structural similarity calculation needs to be performed on each pair of adjacent vertices, the efficiency is low and it is impossible to efficiently cluster large-scale hypergraphs.

[0005] The content of the background technology section is merely information known to the inventor personally, and does not mean that the above information has entered the public domain before the filing date of this specification, nor does it mean that it can become the prior art of this specification. Summary of the Invention

[0006] This specification provides a graph clustering method and electronic device, which can reduce the computational time of graph clustering, thereby enabling efficient structural clustering of larger-scale hypergraphs.

[0007] In a first aspect, this specification provides a graph clustering method, comprising:

[0008] Determine a core hyperedge set of a hypergraph and similar hyperedge sets of each core hyperedge in the core hyperedge set based on a preset hyperedge index and a query parameter;

[0009] Taking the core hyperedge as a clustering starting point, clustering each of the similar hyperedges in the similar hyperedge set of each core hyperedge to obtain a plurality of clusters; and

[0010] Hyperedges of the hypergraph outside the plurality of clusters are classified.

[0011] In some example embodiments, based on the above scheme, the preset hyperedge index includes a core hyperedge index and an adjacent hyperedge index. The core hyperedge index represents an index obtained by arranging the core hyperedges in descending order according to the size of the similarity extreme values ​​corresponding to each core hyperedge. The similarity extreme value represents the maximum value of the structural similarity of the core hyperedge under the condition of satisfying a preset number of similar neighbors. The adjacent hyperedge index represents an index obtained by arranging the adjacent hyperedges of each hyperedge in descending order according to the size of the structural similarity of the two hyperedges of the hypergraph.

[0012] In some example embodiments, based on the above solution, the query parameters include a similar neighbor number parameter and a similarity parameter, and determining the core hyperedge set of the hypergraph based on the preset hyperedge index and the query parameters includes:

[0013] Determining a corresponding target core hyperedge index based on the similar neighbor number parameter; and

[0014] The core hyperedges whose structural similarity is greater than the similarity parameter are selected from the target core hyperedge indexes to obtain a core hyperedge set of the hypergraph.

[0015] In some example embodiments, based on the above solution, determining a similar hyperedge set of each core hyperedge in the core hyperedge set based on a preset hyperedge index and a query parameter includes:

[0016] Determining a target adjacent hyperedge index corresponding to each core hyperedge in the core hyperedge set; and

[0017] Hyperedges whose structural similarity is greater than the similarity parameter are selected from the target adjacent hyperedge index to obtain the similar hyperedge set of each core hyperedge.

[0018] In some example embodiments, based on the above solution, before determining the core hyperedge set of the hypergraph and the similar hyperedge set of each core hyperedge in the core hyperedge set, the method further includes:

[0019] For each hyperedge in the hypergraph, determining the structural similarity between the hyperedge and each adjacent hyperedge, arranging the adjacent hyperedges of the hyperedge in descending order based on the structural similarity, and generating the adjacent hyperedge index corresponding to the hyperedge; and

[0020] For each of the similar neighbor numbers, determine the similarity extreme value of each of the hyperedges under the condition that the similar neighbor number is satisfied, arrange the hyperedges in descending order based on the size of the similarity extreme value, and generate the core hyperedge index corresponding to the similar neighbor number.

[0021] In some example embodiments, based on the above solution, clustering each similar hyperedge in the similar hyperedge set of each core hyperedge using the core hyperedge as a clustering starting point includes:

[0022] Taking the core hyperedge as a clustering starting point, sequentially clustering each similar hyperedge in the similar hyperedge set of each core hyperedge; or,

[0023] Taking the core hyperedge as a clustering starting point, each similar core hyperedge and each similar non-core hyperedge in the similar hyperedge set of each core hyperedge are clustered in parallel.

[0024] In some example embodiments, based on the above solution, sequentially clustering similar hyperedges in the similar hyperedge set of each core hyperedge using the core hyperedge as a clustering starting point includes:

[0025] Traversing the unlabeled core hyperedges in the core hyperedge set, determining a current core hyperedge and a cluster label of a current cluster corresponding to the current core hyperedge;

[0026] Traversing each of the similar hyperedges in the similar hyperedge set of the current core hyperedge to obtain a current similar hyperedge;

[0027] If the current similar hyperedge is not marked as the cluster label, the current similar hyperedge is added to the current cluster and marked with the cluster label.

[0028] In some example embodiments, based on the above solution, the method further includes:

[0029] If the current similar hyperedge is a core hyperedge, the current similar hyperedge is added to a core hyperedge queue, which is used to store core hyperedges to be clustered.

[0030] Determining the current core hyperedge includes:

[0031] The core hyperedge to be clustered is obtained from the core hyperedge queue, and the obtained core hyperedge to be clustered is used as the current core hyperedge.

[0032] In some example embodiments, based on the above solution, taking the core hyperedge as the clustering starting point and performing parallel clustering on similar core hyperedges and similar non-core hyperedges in the similar hyperedge set of each core hyperedge includes:

[0033] Traversing each core hyperedge in the core hyperedge set, determining a current core hyperedge and a cluster label of a current cluster corresponding to the current core hyperedge;

[0034] Clustering similar core hyperedges in the similar hyperedge set of the current core hyperedge by a first multithreading; and

[0035] The similar non-core hyperedges in the similar hyperedge set of the current core hyperedge are clustered in parallel by using the second multithreading.

[0036] In some example embodiments, based on the above solution, clustering similar core hyperedges in the similar hyperedge set of the current core hyperedge by the first multithreading includes:

[0037] Traversing each of the similar hyperedges in the similar hyperedge set of the current core hyperedge by the first multithread to obtain a current similar hyperedge;

[0038] If the current similar hyperedge belongs to the core hyperedge set and the identifier of the current core hyperedge is greater than the identifier of the current similar hyperedge, the cluster to which the current core hyperedge belongs is merged with the cluster to which the current similar hyperedge belongs.

[0039] In some example embodiments, based on the above solution, merging the cluster to which the current core hyperedge belongs and the cluster to which the current similar hyperedge belongs includes:

[0040] Determine, by a path compression lookup function, a first return value of the current core hyperedge and a second return value corresponding to the current similar hyperedge, wherein the first return value represents the cluster label of the smallest-numbered hyperedge of the cluster to which the current core hyperedge belongs, and the second return value represents the cluster label of the smallest-numbered hyperedge of the cluster to which the current similar hyperedge belongs;

[0041] If the first return value is greater than or equal to the second return value, merging the cluster to which the current core hyperedge belongs into the cluster to which the current similar hyperedge belongs through the merging function;

[0042] If the first return value is less than the second return value, the cluster to which the current similar hyperedge belongs is merged into the cluster to which the current core hyperedge belongs through a merging function.

[0043] In some example embodiments, based on the above solution, the parallel clustering of similar non-core hyperedges in the similar hyperedge set of the current core hyperedge by the second multithreading includes:

[0044] traversing each of the similar hyperedges in the similar hyperedge set of the current core hyperedge by the second multithread to obtain a current similar hyperedge;

[0045] If the current similar hyperedge does not belong to the core hyperedge set, the current similar hyperedge is added to the cluster to which the current core hyperedge belongs.

[0046] In some example embodiments, based on the above solution, the method further includes:

[0047] traversing each hyperedge in the hypergraph by a third multithread to obtain a current hyperedge;

[0048] Determine a third return value corresponding to the current hyperedge by a path compression lookup function, wherein the third return value represents the cluster label of the smallest-numbered hyperedge of the cluster to which the current hyperedge belongs;

[0049] The cluster label of the current hyperedge is set as the third return value.

[0050] In some example embodiments, based on the above solution, classifying the hyperedges of the hypergraph outside the multiple clusters includes:

[0051] Based on the connection relationship between the hyperedges of the hypergraph and the hyperedges of the cluster, the unlabeled hyperedges of the hypergraph are labeled as outlier hyperedges or bridging hyperedges.

[0052] The outlier hyperedge means that the hyperedge is not included in the plurality of clusters and is connected to only one more hyperedge of the cluster, and the bridging hyperedge means that the hyperedge is not included in the plurality of clusters and is connected to at least two hyperedges of the cluster.

[0053] In a second aspect, this specification also provides an electronic device comprising: at least one storage medium storing at least one instruction set for performing graph clustering processing; and at least one processor communicatively connected to the at least one storage medium, wherein, when the electronic device is running, the at least one processor reads the at least one instruction set and executes the graph clustering method described in the first aspect of this specification according to the instructions of the at least one instruction set.

[0054] It can be seen from the above technical solutions that the graph clustering method and device provided in the embodiments of this specification, on the one hand, pre-establish a hyperedge index for each hyperedge in the hypergraph based on structural similarity, and when performing hypergraph clustering, the core hyperedge set of the hypergraph and the similar hyperedge set of the core hyperedge are efficiently queried directly from the hyperedge index according to the query parameters, and there is no need to perform structural similarity calculations on each pair of adjacent hyperedges, which reduces the computational time of graph clustering and significantly improves the time performance of hypergraph structural clustering; on the other hand, with the core hyperedge as the clustering starting point, each similar hyperedge in the similar hyperedge set of each core hyperedge is clustered. Since the core hyperedge set and the similar hyperedge set of the core hyperedge can be efficiently obtained through the hyperedge index, the hyperedges in the hypergraph that are similar to the core hyperedge can be efficiently divided into the same cluster with the core hyperedge as the clustering starting point, thereby efficiently performing structural clustering on larger-scale hypergraphs.

[0055] Other features of the graph clustering method and apparatus provided herein are partially outlined in the following description. Based on the description, the following figures and examples will be readily apparent to those skilled in the art. The inventive aspects of the graph clustering method and apparatus provided herein can be fully explained by practicing or using the methods, apparatus, and combinations described in the following detailed examples. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical solutions in the embodiments of this specification, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0057] Figure 1 A schematic diagram showing an implementation environment of a graph clustering method provided in an embodiment of this specification is shown;

[0058] Figure 2 FIG2 shows a hardware structure diagram of an electronic device 200 provided according to an embodiment of this specification;

[0059] Figure 3 A flowchart of a graph clustering method provided according to some embodiments of this specification is shown;

[0060] Figure 4 A schematic diagram of a hypergraph provided according to some embodiments of the present specification is shown;

[0061] Figure 5 A schematic diagram of a preset hyperedge index provided according to some embodiments of this specification is shown;

[0062] Figure 6 A schematic diagram of a process for performing sequential clustering according to some embodiments of this specification is shown;

[0063] Figure 7 A schematic diagram of performing parallel clustering according to some embodiments of this specification is shown; and

[0064] Figure 8 A schematic flow chart of a graph clustering method provided according to some further embodiments of this specification is shown. DETAILED DESCRIPTION

[0065] The following description provides specific application scenarios and requirements for this specification, with the goal of enabling those skilled in the art to make and use the contents of this specification. Various modifications to the disclosed embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other embodiments and applications without departing from the spirit and scope of this specification. Therefore, this specification is not limited to the embodiments shown, but is intended to be accorded the broadest scope consistent with the claims.

[0066] The terms used herein are for the purpose of describing specific example embodiments only and are not intended to be limiting. For example, as used herein, the singular forms "a," "an," and "the" may also include the plural forms unless the context clearly indicates otherwise. When used in this specification, the terms "comprise," "include," and / or "contain" are intended to refer to the presence of the associated integers, steps, operations, elements, and / or components, but do not preclude the presence of one or more other features, integers, steps, operations, elements, components, and / or groups or the addition of other features, integers, steps, operations, elements, components, and / or groups in the system / method.

[0067] These and other features of this specification, as well as the operation and function of the associated elements of the structure, and the economical assembly and manufacture of the components, can be significantly improved with consideration of the following description. Reference is made to the accompanying drawings, all of which form a part of this specification. However, it should be expressly understood that the drawings are for illustration and description purposes only and are not intended to limit the scope of this specification. It should also be understood that the drawings are not drawn to scale.

[0068] The flowcharts used in this specification illustrate operations implemented by systems according to some embodiments of the present specification. It should be clearly understood that the operations of the flowcharts may not be implemented in sequence. Rather, the operations may be implemented in reverse order or simultaneously. Furthermore, one or more additional operations may be added to the flowcharts. One or more operations may be removed from the flowcharts.

[0069] It should be noted that the user data obtained in this manual is authorized by the user and does not involve user privacy.

[0070] First, the terms involved in one or more embodiments of this specification are explained.

[0071] Hypergraph: A graph in which each edge connects an arbitrary number of vertices, represented by G = (V, E), where V is the set of vertices and E is the set of hyperedges (edges in a hypergraph).

[0072] Hyperedges are adjacent: When there is a common vertex between the vertices connected (also called included) by two hyperedges, the two hyperedges are adjacent;

[0073] ∈ and μ: similarity parameter and similar neighbor number parameter, where the similarity parameter ∈ ranges from 0 to 1 and the similar neighbor number parameter μ ranges from 2 to positive infinity.

[0074] Structural similarity of hyperedges: The structural similarity σ(e1,e2) of two hyperedges e1 and e2 is calculated as follows:

[0075]

[0076] Structural neighbors of a hyperedge: The set of a hyperedge and all its adjacent hyperedges is the set of structural neighbors of the hyperedge N[e1].

[0077] ∈-neighbor of a hyperedge: a neighbor whose structural similarity with the hyperedge exceeds ∈ among its structured neighbors.

[0078] Core hyperedge: A hyperedge is a core hyperedge if the number of its ∈ neighbors exceeds the number of similar neighbors μ.

[0079] Core subgraph: The core subgraph of a hypergraph refers to the subgraph consisting of the core hyperedges of the hypergraph and the vertices contained in the core hyperedges;

[0080] Structural reachability: Given two hyperedges, if a path can be found that starts and ends at these two hyperedges, and the remaining hyperedges in the path are all core hyperedges, then it means that the two hyperedges are structurally reachable.

[0081] Structured cluster: A structured cluster C in a hypergraph is a set of hyperedges that satisfies the following two conditions: (1) the structural similarity of any two hyperedges in the cluster is greater than the similarity parameter ∈; (2) any two hyperedges in the cluster are structurally reachable, and all hyperedges in the structurally reachable path are in the cluster;

[0082] Cluster subgraph: A cluster subgraph in a hypergraph refers to the hyperedges in the cluster and all the vertices contained in the hyperedges.

[0083] Outlier hyperedge: refers to a hyperedge in the hypergraph that is not included in any cluster and only connects at most one cluster.

[0084] Bridging (also called hub) hyperedge: refers to a hyperedge in the hypergraph that is not included in any cluster and connects at least two clusters.

[0085] Hyperedge-based structured graph clustering (HSCAN): Given a hypergraph G = (V, E) and two query parameters, namely the similarity parameter ∈ and the number of similar neighbors parameter μ, hyperedge-based structured graph clustering identifies clusters of multiple hyperedges in the hypergraph, bridging hyperedges and outlier hyperedges.

[0086] The purpose of structural graph clustering is to cluster the vertices of the graph according to structural similarity, such as cosine similarity, and obtain clusters, bridging vertices hubs, and outlier vertices. In related technical solutions, the structural similarity of each pair of vertices is calculated using the neighborhood of each pair of vertices, and the vertices of the graph are clustered based on the structural similarity. For example, if a vertex has a large number of neighborhoods with high structural similarity, the vertex is classified as a core vertex, and a connection structure containing the core vertex, the neighborhood of the core vertex, and the edges between the vertices is constructed to form multiple clusters. Other vertices outside the multiple clusters are identified as bridging vertices and outlier vertices that do not belong to any cluster, where the bridging vertex is a bridge between different clusters. However, in this technical solution, since the structural similarity calculation is performed on each pair of adjacent vertices, the efficiency is low and it is impossible to efficiently process larger-scale hypergraphs.

[0087] Based on the above content, the embodiments of this specification provide a graph clustering method and electronic device. On the one hand, a hyperedge index of each hyperedge in a hypergraph is pre-established based on structural similarity. When performing hypergraph clustering, the core hyperedge set of the hypergraph and the similar hyperedge set of the core hyperedge are efficiently queried directly from the hyperedge index according to the query parameters. There is no need to perform structural similarity calculations on each pair of adjacent hyperedges, which reduces the computational time of graph clustering and significantly improves the time performance of hypergraph structural clustering. On the other hand, with the core hyperedge as the clustering starting point, each similar hyperedge in the similar hyperedge set of each core hyperedge is clustered. Since the core hyperedge set and the similar hyperedge set of the core hyperedge can be efficiently obtained through the hyperedge index, the hyperedges in the hypergraph that are similar to the core hyperedge can be efficiently divided into the same cluster with the core hyperedge as the clustering starting point, thereby efficiently performing structural clustering on larger-scale hypergraphs.

[0088] The technical solutions of the embodiments of this specification will be described in detail below with reference to the accompanying drawings.

[0089] Figure 1 A schematic diagram of an implementation environment of a graph clustering method provided in an embodiment of this specification is shown.

[0090] See also Figure 1 As shown, the implementation environment 100 may include a terminal 110 , a server 130 , and a database 140 .

[0091] The terminal 110 is connected to the server 130 via a wireless network or a wired network 120. The terminal 110 may be a mobile phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto.

[0092] The terminal 110 may store data or instructions for executing the graph clustering method described in this specification. The terminal 110 may include a hardware device with data information processing capabilities and necessary programs to drive the hardware device to work.

[0093] Server 130 is an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms. Server 130 provides background services for applications running on terminal 110.

[0094] The server 130 is equipped with an integrated development platform. An integrated development platform, also known as an integrated development environment (IDE), is an application program used to provide a program development environment. It generally includes tools such as a code editor, a compiler, a debugger, and a graphical user interface. Developers can write program code (i.e., program development) on the integrated development platform. The integrated development platform server can be a computing device specifically used by the integrated development platform to implement the graph clustering method. The server 130 can communicate data with the terminal 110 and the database 140 respectively.

[0095] In addition, the server 130 may store data or instructions for executing the graph clustering method described in this specification. The server 130 may include a hardware device with data information processing capabilities and the necessary programs required to drive the hardware device to work. Of course, the server 130 may also be only a hardware device with data processing capabilities, or only a program running in the hardware device. In some embodiments, the server 130 may also be a plug-in and deployed on the terminal 110. In this case, the server 130 stores data or instructions for executing the graph clustering method corresponding to the terminal 110 described in this specification.

[0096] The database 140 can store data and / or instructions. In some embodiments, the database 140 can store hypergraphs and preset hypergraph indexes, etc. In some embodiments, the database 140 can store data and / or instructions executed by the server 130 or used to execute the graph clustering method described in this specification. The terminal 110 and the server 130 have access to the database 140, and the terminal 110 and the server 130 can access the data or instructions stored in the database 140 through the network. In some embodiments, the database 140 can be directly connected to the terminal 110 and the server 130. In some embodiments, the database 140 can be part of the server 130. In some embodiments, the database 140 can include mass storage, removable storage, volatile read-write memory, read-only memory (ROM) or the like, or any combination thereof. Exemplary mass storage may include non-transitory storage media such as disks, optical disks, solid-state drives, etc. Example removable storage may include flash drives, floppy disks, optical disks, memory cards, zip disks, tapes, etc. Typical volatile read-write memory may include random access memory (RAM). Example RAMs may include dynamic RAM (DRAM), double date rate synchronous dynamic RAM (DDRSDRAM), static RAM (SRAM), thyristor RAM (T-RAM), zero capacitance RAM (Z-RAM), etc. Example ROMs may include mask ROM (MROM), programmable ROM (PROM), virtually programmable ROM (PEROM), electronically programmable ROM (EEPROM), compact disc ROM (CD ROM), digital versatile disk ROM, etc.

[0097] Those skilled in the art will appreciate that the number of terminals can be greater or lesser. For example, there may be only one terminal, or there may be dozens, hundreds, or even more terminals, in which case the implementation environment may also include other terminals. The embodiments of this specification do not limit the number of terminals or device types.

[0098] After introducing the implementation environment of the embodiments of this specification, the application scenarios of the embodiments of this specification will be introduced in combination with the above implementation environment. In the following description, the terminal is the terminal 110 in the above implementation environment, and the server is the server 130 in the above implementation environment. The technical solutions provided by the embodiments of this specification can be applied to graph clustering processing scenarios of various network hypergraphs, such as social networks, academic networks, and protein complex networks.

[0099] Taking the application of the technical solution provided in the embodiments of this specification in the graph clustering processing scenario of a social network hypergraph as an example, a hyperedge index of the social network hypergraph, i.e., a preset hyperedge index, is generated in advance. The terminal 110 determines the core hyperedge set of the social network hypergraph and the similar hyperedge set of each core hyperedge in the core hyperedge set based on the preset hyperedge index and the query parameters; using the core hyperedge as the clustering starting point, clustering each similar hyperedge in the similar hyperedge set of each core hyperedge to obtain multiple clusters; and marking the hyperedges of the social network hypergraph outside the multiple clusters.

[0100] It should be noted that the above is explained using the technical solution provided in the embodiments of this specification as an example of applying the technical solution provided in the embodiments of this specification to the graph clustering processing scenario of a social network hypergraph. The technical solution provided in the embodiments of this specification can also be applied to other appropriate graph clustering processing scenarios of network hypergraphs, such as graph clustering processing scenarios of academic network hypergraphs or e-commerce network hypergraphs, etc. The implementation process belongs to the same inventive concept as the above description and will not be repeated here.

[0101] It should be noted that the steps in the graph clustering method in the example embodiment of this specification can be partially executed by the terminal, partially executed by the server, or all executed by the server or all executed by the client, and this specification does not specifically limit this.

[0102] based on Figure 1 The implementation environment shown below will be combined with Figure 2-Figure 8 , a detailed introduction to the graph clustering method and electronic device provided in the embodiments of this specification is provided. It should be noted that the above implementation environment is only provided to facilitate understanding of the spirit and principles of this specification, and the embodiments of this specification are not limited in this respect. On the contrary, the embodiments of this specification can be applied to any applicable scenario.

[0103] Figure 2 This is a structural diagram of an electronic device 200 provided according to some embodiments of this specification. The electronic device 200 can execute the graph clustering method described in this specification. The graph clustering method is introduced in other parts of this specification. The electronic device 200 can be a general-purpose computer or a special-purpose computer. For example, the electronic device 200 can be a server, a personal computer, a portable computer (such as a notebook computer, a tablet computer, etc.), or other electronic devices with computing capabilities. Of course, the electronic device can be Figure 1 The intermediate terminal 110 and / or the server 130 may also be terminal devices used by multiple developers to develop programs on an integrated development platform.

[0104] The electronic device in this specification may include one or more of the following components: a processor 210 , a memory 220 , an input device 230 , an output device 240 , and a bus 250 . The processor 210 , the memory 220 , the input device 230 , and the output device 240 may be connected via the bus 250 .

[0105] The processor 210 may include one or more processing cores. The processor 210 uses various interfaces and lines to connect various parts of the entire electronic device, and executes the graph clustering method described in this specification by running or executing instructions, programs, code sets or instruction sets stored in the memory 220, and calling data stored in the memory 220. Optionally, the processor 210 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 210 can integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to handle wireless communication. It is understandable that the above-mentioned modem may not be integrated into the processor 210 and may be implemented separately through a communication chip.

[0106] The memory 220 may include a random access memory (RAM) or a read-only memory (ROM). Optionally, the memory 220 includes a non-transitory computer-readable storage medium. The memory 220 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 220 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The operating system may be an Android system, including a system deeply developed based on the Android system, an IOS system, including a system deeply developed based on the IOS system, or other systems.

[0107] In order for the operating system to distinguish the specific application scenarios of third-party applications, it is necessary to open up data communication between third-party applications and the operating system so that the operating system can obtain the current scenario information of third-party applications at any time, and then perform targeted system resource adaptation based on the current scenario.

[0108] The input device 230 is used to receive input commands or data and includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch-sensitive device. The output device 240 is used to output commands or data and includes, but is not limited to, a display device and a speaker. In one example, the input device 230 and the output device 240 may be combined, and the input device 230 and the output device 240 may be a touch-sensitive display.

[0109] In addition, those skilled in the art will understand that the structures of the electronic devices shown in the above figures do not limit the electronic devices. The electronic devices may include more or fewer components than shown, or may combine certain components, or arrange the components differently. For example, the electronic devices may also include radio frequency circuits, input units, sensors, audio circuits, wireless fidelity (WiFi) modules, power supplies, Bluetooth modules, and other components, which will not be described in detail here.

[0110] Figure 3 A flowchart of a graph clustering method provided according to an embodiment of the present specification is shown. As before, the electronic device 200 can execute the graph clustering method of the embodiment of the present specification. Specifically, the processor 210 can read the instruction set stored in its local storage medium, and then execute the graph clustering method of the embodiment of the present specification according to the provisions of the instruction set. Below, steps S310 to S330 in the graph clustering method will be described in detail with reference to the accompanying drawings.

[0111] Reference Figure 3 As shown, in step S310, a core hyperedge set of the hypergraph and similar hyperedge sets of each core hyperedge in the core hyperedge set are determined based on a preset hyperedge index and query parameters.

[0112] In an example embodiment, the hyperedge index of a hypergraph is a unique identifier or structured description for a hyperedge, which is used to quickly locate, query, and operate hyperedges. Taking a social network hypergraph as an example, a hyperedge can represent a "group" or "event". If a group contains multiple users, the hyperedge index can be used to quickly find groups in which users participate, and core hyperedges can represent popular "groups" or "events". Taking an academic network hypergraph as an example, a hyperedge can represent a "research team" or "cooperative team". If a "research team" includes multiple members, the hyperedge index can be used to quickly query research teams in which research members participate, and core hyperedges can represent popular "research teams". The preset hyperedge index is a sequential index of each hyperedge of a pre-established hypergraph. For example, the hyperedge index of a target hyperedge is established based on the descending order of the structural similarity between the target hyperedge and other hyperedges.

[0113] The structural similarity of two hyperedges is the value obtained by normalizing the number of common vertices between the two hyperedges by the geometric mean of the number of vertices of the two hyperedges. For example, let the hypergraph be G = (V, E), and the structural similarity σ(e1, e2) of two hyperedges e1 and e2 is calculated as follows:

[0114]

[0115] Among them, |V(e1)∩V(e2)| represents the number of vertices shared by hyperedge e1 and hyperedge e2. represents the geometric mean of the number of vertices of hyperedge e1 and hyperedge e2. Figure 4 As shown, the common vertex of hyperedge e1 and hyperedge e2 is V1, that is, the number of common vertices is 1, the number of vertices of hyperedge e1 |V(e1)| is 2, the number of vertices of hyperedge e2 |V(e2)| is 3, and the geometric mean of the number of vertices of hyperedge e1 and hyperedge e2 is Then the structural similarity σ(e1,e2) of the two hyperedges e1 and e2 is 0.41.

[0116] Reference Figure 4 As shown, hyperedge e1 contains vertex V 1、 V2, hyperedge e2 contains vertex V 1、 V 3、 V4, hyperedge e3 contains vertex V 1、 V 2、 V 3、 V4, hyperedge e4 contains vertex V 1、 V 2、 V 3、 V 4、 V5, hyperedge e5 contains V 7、 V 8、 V9, hyperedge e6 contains vertex V 6、 V 7、 V8、 V9, hyperedge e7 contains vertex V 5、 V 6、 V 7、 V 8、 V9. For example, a hyperedge index of hyperedge e is established based on the structural similarity between each hyperedge e and other hyperedges. Table 1 below shows the hyperedge index corresponding to each hyperedge e of the hypergraph in an example embodiment.

[0117] Table 1. Hyperedge index corresponding to each hyperedge e of the hypergraph in the exemplary embodiment

[0118] Super Edge e The vertices V contained in e The similarity between e's neighbors and the corresponding <![CDATA[e1]]> <![CDATA[V1、V2]]> <![CDATA[e1:1.00,e3:0.71,e4:0.63,e2:0.41]]> <![CDATA[e2]]> <![CDATA[V1、V3、V4]]> <![CDATA[e2:1.00,e3:0.87,e4:0.77,e1:0.41]]> <![CDATA[e3]]> <![CDATA[V1、V2、V3、V4]]> <![CDATA[e3:1.00,e4:0.89,e2:0.87,e1:0.71]]> <![CDATA[e4]]> <![CDATA[V1、V2、V3、V4、V5]]> <![CDATA[e4:1.00,e3:0.89,e2:0.77,e1:0.63,e7:0.20]]> <![CDATA[e5]]> <![CDATA[V7、V8、V9]]> <![CDATA[e5:1.00,e6:0.86,e7:0.77]]> <![CDATA[e6]]> <![CDATA[V6、V7、V8、V9]]> <![CDATA[e6:1.00,e7:0.89,e5:0.86 <!-- 9 -->]]> <![CDATA[e7]]> <![CDATA[V5、V6、V7、V8、V9]]> <![CDATA[e7:1.00,e6:0.89,e5:0.77,e4:0.20]]>

[0119] In some example embodiments, the preset hyperedge index includes a core hyperedge index CO (Core Order) and an adjacent hyperedge index NO (Neighbor Order). The core hyperedge index represents an index obtained by arranging the core hyperedges in descending order according to the similarity extreme values ​​corresponding to each core hyperedge. The similarity extreme value represents the maximum value of the structural similarity of the core hyperedge under the condition of satisfying the preset similarity neighbor number μ. The similarity neighbor number μ represents the number of adjacent hyperedges similar to the hyperedge. For example, an adjacent hyperedge similar to the hyperedge may be an ε neighbor of the hyperedge. The ε neighbor of the hyperedge refers to an adjacent hyperedge among the adjacent hyperedges of the hyperedge whose structural similarity exceeds the similarity parameter ε. The adjacent hyperedge of a hyperedge refers to a hyperedge that has a common vertex with the hyperedge. The adjacent hyperedge index represents the index obtained by arranging the adjacent hyperedges of each hyperedge in descending order according to the structural similarity of the two hyperedges of the hypergraph. For example, the adjacent hyperedge index of hyperedge e1 in Table 1 above is (e1: 1.00, e3: 0.71, e4: 0.63, e2: 0.41), and the neighbor hyperedge index of hyperedge e2 is (e2: 1.00, e3: 0.87, e4: 0.77, e1: 0.41).

[0120] Figure 5 Shown Figure 4 Some preset hyperedge indexes in the hypergraph, including the adjacent hyperedge index NO and the core hyperedge index CO. Figure 5 As shown in Figure 1, NO1 represents the adjacent hyperedge index corresponding to hyperedge e1, NO2 represents the adjacent hyperedge index corresponding to hyperedge e2, and NO3 represents the adjacent hyperedge index corresponding to hyperedge e3. CO2 represents the core hyperedge index corresponding to the number of similar neighbors μ being 2, and CO3 represents the core hyperedge index corresponding to the number of similar neighbors μ being 3.

[0121] In an example embodiment, before determining the core hyperedge set of the hypergraph and the similar hyperedge set of each core hyperedge in the core hyperedge set, the electronic device 200 determines the structural similarity between each hyperedge and each adjacent hyperedge in the hypergraph, arranges the adjacent hyperedges of the hyperedge in descending order based on the size of the structural similarity, and generates an adjacent hyperedge index NO corresponding to the hyperedge; and for each similar neighbor number, determines the similarity extreme value of each hyperedge under the condition of satisfying the similar neighbor number, arranges each hyperedge in descending order based on the size of the similarity extreme value, and generates a core hyperedge index CO corresponding to the similar neighbor number.

[0122] For example, the data structure of the adjacent hyperedge index NO can be an adjacency table, which stores (hyperedge id, similarity) pairs. For each hyperedge e∈E, the electronic device 200 arranges the adjacent hyperedges in descending order according to the size of the structural similarity, and can quickly obtain similar adjacent hyperedges of the hyperedge through the adjacent hyperedge index. Figure 5 As shown, NO1 represents the adjacent hyperedge index corresponding to hyperedge e1 (e1: 1.00, e3: 0.71, e4: 0.63, e2: 0.41), NO2 represents the adjacent hyperedge index corresponding to hyperedge e2 (e2: 1.00, e3: 0.87, e4: 0.77, e1: 0.41), and NO3 represents the adjacent hyperedge index corresponding to hyperedge e3 (e3: 1.00, e4: 0.89, e2: 0.87, e1: 0.71).

[0123] The data structure for the core hyperedge index CO can be an adjacency table, which stores (hyperedge id, ε) pairs. The electronic device 200 obtains the maximum value of the similarity ε of each hyperedge e∈E under each possible number of similar neighbors μ, Represents the core subgraph for the similarity parameter ε and the number of similar neighbors μ, storing (hyperedge id, ε) pairs in descending order of structural similarity ε. Figure 5 As shown, CO2 represents the core hyperedge index corresponding to the similar neighbor number μ being 2 (e3: 0.89, e4: 0.89, e6: 0.89, e7: 0.89, e2: 0.87, e5: 0.86, e1: 0.71), and CO3 represents the core hyperedge index corresponding to the similar neighbor number μ being 3 (e3: 0.87, e6: 0.86, e2: 0.77, e4: 0.77, e5: 0.77, e6: 0.77, e1: 0.63).

[0124] Furthermore, the query parameters represent clustering parameters for clustering the hypergraph determined based on the actual problem. The query parameters include a similar neighbor number parameter μ and a similarity parameter ε. For example, when clustering an academic network hypergraph, if the "research team" that needs to be paid attention to has published a large number of papers, the similar neighbor number parameter μ and the similarity parameter ε can be set higher; if the "research team" that needs to be paid attention to has published fewer papers, the similar neighbor number parameter μ and the similarity parameter ε can be set lower. The electronic device 200 determines the core hyperedge set of the hypergraph and the similar hyperedge set of each core hyperedge in the core hyperedge set based on the preset hyperedge index and the query parameters.

[0125] In an exemplary embodiment, the electronic device 200 determines the corresponding target core hyperedge index based on the similar neighbor number parameter μ; and selects the core hyperedges whose structural similarity is greater than the similarity parameter ε from the target core hyperedge index to obtain the core hyperedge set of the hypergraph. Figure 5 As shown, assuming that the similarity parameter ε=0.85 and the similar neighbor number parameter μ=3, the electronic device 200 determines that the corresponding target core hyperedge index is CO3 based on the similar neighbor number parameter 3, and selects core hyperedges e3 and e6 with structural similarity greater than 0.85 from the target core hyperedge index CO3, that is, the core hyperedge set is {e3, e6}.

[0126] In an exemplary embodiment, the electronic device 200 determines the target adjacent hyperedge index corresponding to each core hyperedge in the core hyperedge set; and selects hyperedges whose structural similarity is greater than the similarity parameter ε from the target adjacent hyperedge index to obtain similar hyperedge sets for each core hyperedge. Figure 5 As shown, assuming the similarity parameter ε = 0.85, the electronic device 200 determines the target adjacent hyperedge index NO3 corresponding to the core hyperedge e3, and selects hyperedges e3, e4, and e2 from the target adjacent hyperedge index NO3 whose structural similarity is greater than the similarity parameter 0.85. Then the similar hyperedge set of the core hyperedge e3, i.e., the ε neighbor set, is {e3, e4, and e2}. 4, e2}.

[0127] In step S320 , the core hyperedge is used as a clustering starting point, and similar hyperedges in the hyperedge set of each core hyperedge are clustered to obtain multiple clusters.

[0128] In an exemplary embodiment, the electronic device 200 uses each core hyperedge as a clustering starting point or cluster seed and divides each similar hyperedge in the core hyperedge's similar hyperedge set into different clusters. For example, the electronic device 200 traverses the unlabeled core hyperedges in the core hyperedge set to obtain the current core hyperedge, uses the current core hyperedge as a clustering starting point and labels it with the cluster label of the current cluster, determines the similar hyperedge set corresponding to the current core hyperedge, and adds each similar hyperedge in the current core hyperedge's similar hyperedge set to the current cluster.

[0129] In some example embodiments, electronic device 200 uses a core hyperedge as a clustering starting point and sequentially clusters each similar hyperedge in a hyperedge set similar to each core hyperedge; or, using a core hyperedge as a clustering starting point, performs parallel clustering on each similar core hyperedge and each similar non-core hyperedge in a hyperedge set similar to each core hyperedge. Sequential clustering and parallel clustering are described in detail below with reference to specific examples.

[0130] Sequential clustering example:

[0131] In an example embodiment, the electronic device 200 traverses the unlabeled core hyperedges in the core hyperedge set to determine the current core hyperedge and the cluster label of the current cluster corresponding to the current core hyperedge; traverses each similar hyperedge in the similar hyperedge set of the current core hyperedge to obtain the current similar hyperedge; if the current similar hyperedge is not labeled as a cluster label, the current similar hyperedge is added to the current cluster and labeled with the cluster label.

[0132] For example, refer to Figure 4As shown, the hypergraph has a hyperedge set E = {e1, e2, e3, e4, e5, e6, e7}. Assuming the similarity parameter ε = 0.87 and the similar neighbor number parameter μ = 2, the core hyperedge set H is {e3, e4, e6, e7}, the similar hyperedge set S(e3) of the core hyperedge e3 = {e4, e2}; the similar hyperedge set S(e4) of the core hyperedge e4 = {e3}; the similar hyperedge set S(e6) of the core hyperedge e6 = {e7, e5}; the similar hyperedge set S(e7) of the core hyperedge e7 = {e6}; the similar hyperedge set S(e2) of the core hyperedge e2 = {e3}. The electronic device 200 traverses the unlabeled core hyperedges in the core hyperedge set H to obtain the current core hyperedge e3, determines the cluster label C1 of the current cluster C1{e3} corresponding to the current core hyperedge e3, and traverses each similar hyperedge e4 and e2 in the similar hyperedge set S(e3) of the current core hyperedge e3. For the traversed current similar hyperedge e4, if it is not labeled with the cluster label C1, the current similar hyperedge is added to the current cluster C1 and the current similar hyperedge e4 is labeled with the cluster label C1, i.e., C1{e3, e4}. For the traversed current similar hyperedge e2, the current similar hyperedge is added to the current cluster C1, if it is not labeled with the current cluster C1, and the current similar hyperedge e2 is labeled with the cluster label C1, to obtain cluster C1{e3, e4, e2}. Since the hyperedge e3 in the similar hyperedge set S(e4)={e3} of the core hyperedge e4 has been labeled, it is no longer processed. Similarly, we process core hyperedge e6, obtaining cluster C2{e6, e7, e5}. Since hyperedge e6 in the set of similar hyperedges S(e7) = {e6} to core hyperedge e7 has already been marked, it is not processed further. Through the above sequential clustering, we obtain two clusters of the hypergraph, C1{e3, e4, e2} and C2{e6, e7, e5}.

[0133] According to the technical solution in the above-mentioned example embodiment, through the sequential traversal of the core hyperedge set and the similar hyperedge set and the dynamic expansion of similar hyperedges, multiple clusters can be dynamically generated without pre-specifying the number of clusters, thereby realizing efficient, robust and adaptive hypergraph clustering.

[0134] Parallel clustering example:

[0135] In an exemplary embodiment, electronic device 200 traverses each core hyperedge in the core hyperedge set, determines the current core hyperedge and the cluster label of the current cluster corresponding to the current core hyperedge; clusters similar core hyperedges in the similar hyperedge set of the current core hyperedge using a first multithreading algorithm; and concurrently clusters similar non-core hyperedges in the similar hyperedge set of the current core hyperedge using a second multithreading algorithm. Multithreading is a technology that enables the concurrent execution of multiple threads at the software or hardware level. Multithreading allows for the simultaneous processing of multiple tasks, improving performance and responsiveness.

[0136] For example, refer to Figure 4 As shown, the hypergraph has a hyperedge set E = {e1, e2, e3, e4, e5, e6, e7}. Assuming the similarity parameter ε = 0.87 and the similar neighbor number parameter μ = 2, the core hyperedge set H is {e3, e4, e6, e7}, the similar hyperedge set S(e3) = {e4, e2} of the core hyperedge e3, where e4 is a similar core hyperedge and e2 is a similar non-core hyperedge; the similar hyperedge set S(e4) = {e3} of the core hyperedge e4; the similar hyperedge set S(e6) = {e7, e5} of the core hyperedge e6, where e7 is a similar core hyperedge and e5 is a similar non-core hyperedge; the similar hyperedge set S(e7) = {e6} of the core hyperedge e7. The electronic device 200 traverses the core hyperedge set H, obtains the current core hyperedge e3, and determines the cluster label C1 of the current cluster corresponding to the current core hyperedge e3; clusters the similar core hyperedges e4 in the similar hyperedge set S(e3)={e4, e2} of the current core hyperedge e3 through the first multithreading, for example, adding the similar core hyperedge e4 to the current cluster, that is, cluster C1={e3, e4}; clusters the similar non-core hyperedges e2 in the similar hyperedge set S(e3)={e4, e2} of the current core hyperedge e3 through the second multithreading, for example, adding the similar non-core hyperedge e2 to the current cluster, that is, cluster C1={e3, e4, e2}. Since the hyperedge e3 in the similar hyperedge set S(e4)={e3} of the core hyperedge e4 has been marked, it is no longer processed. The core hyperedge e6 is processed in the same way: the cluster label of the current cluster corresponding to the current core hyperedge e6 is C2. Through the first multithreading, the similar core hyperedge e7 in the similar hyperedge set S(e6) = {e7, e5} of the current core hyperedge e6 is added to the cluster C2, that is, C2{e6, e7}; through the second multithreading, the similar non-core hyperedge e5 is added to the cluster C2, that is, C2{e6, e7, e5}. Since the hyperedge e6 in the similar hyperedge set S(e7) = {e6} of the core hyperedge e7 has been marked, it is no longer processed. Through the above parallel clustering, two clusters C1{e3, e4, e2} and C2{e6, e7, e5} of the hypergraph are obtained.

[0137] According to the technical solution in the above-mentioned example embodiment, by processing similar core hyperedges and similar non-core hyperedges in the similar hyperedge set of core hyperedges in parallel through multi-threading, multiple hyperedges can be clustered at the same time, thereby improving data processing efficiency, thereby enabling more efficient clustering of larger-scale hypergraphs.

[0138] In step S330 , hyperedges of the hypergraph outside the plurality of clusters are classified.

[0139] In an exemplary embodiment, hyperedges of a hypergraph outside of multiple clusters include outlier hyperedges and bridge hyperedges. An outlier hyperedge indicates a hyperedge that is not included in multiple clusters and is connected to only one more cluster, and a bridge hyperedge indicates a hyperedge that is not included in multiple clusters and is connected to at least two clusters. After clustering, the hyperedges of the hypergraph outside of multiple clusters are unlabeled hyperedges. The electronic device 200 labels the unlabeled hyperedges of the hypergraph as outlier hyperedges or bridge hyperedges based on the connection relationship between the hyperedges of the hypergraph and the hyperedges of the clusters.

[0140] For example, refer to Figure 4 As shown, the hypergraph has a hyperedge set E = {e1, e2, e3, e4, e5, e6, e7}. Through the above clustering, we get two clusters C1 {e3, e4, e2} and C2 {e6, e7, e5} of the hypergraph. Hyperedge e1 is an unlabeled hyperedge outside multiple clusters. Since hyperedge e1 has a connection relationship with hyperedges e2, e3 and e4 in cluster C1, that is, they have a common vertex V1, and has no connection relationship with cluster C2, that is, they have no common vertex, that is, hyperedge e1 only connects the hyperedges of one cluster, then hyperedge e1 is marked as an outlier hyperedge.

[0141] according to Figure 3 According to the technical solution in the example embodiment, on the one hand, a hyperedge index of each hyperedge in the hypergraph is established in advance based on structural similarity. When performing hypergraph clustering, the core hyperedge set of the hypergraph and the similar hyperedge set of the core hyperedge are efficiently queried directly from the hyperedge index according to the query parameters. There is no need to perform structural similarity calculation on each pair of adjacent hyperedges, which reduces the computational time of graph clustering and significantly improves the time performance of hypergraph structural clustering. On the other hand, with the core hyperedge as the clustering starting point, each similar hyperedge in the similar hyperedge set of each core hyperedge is clustered. Since the core hyperedge set and the similar hyperedge set of the core hyperedge can be efficiently obtained through the hyperedge index, the hyperedges in the hypergraph that are similar to the core hyperedge can be efficiently divided into the same cluster with the core hyperedge as the clustering starting point, thereby efficiently performing structural clustering on a larger scale of hypergraph.

[0142] In some example embodiments, when similar core hyperedges in the similar hyperedge set of the current core hyperedge are clustered through the first multi-thread, the electronic device 200 traverses each similar hyperedge in the similar hyperedge set of the current core hyperedge through the first multi-thread to obtain the current similar hyperedge; if the current similar hyperedge belongs to the core hyperedge set and the identifier of the current core hyperedge is greater than the identifier of the current similar hyperedge, the cluster to which the current core hyperedge belongs and the cluster to which the current similar hyperedge belongs are merged.

[0143] For example, refer to Figure 4As shown, the hypergraph has a hyperedge set E = {e1, e2, e3, e4, e5, e6, e7}, assuming a similarity parameter ε = 0.87 and a similar neighbor number parameter μ = 2, then the core hyperedge set H is {e3, e4, e6, e7}, the electronic device 200 traverses the core hyperedge set H to obtain the current core hyperedge e7, and traverses the similar hyperedge e6 in the similar hyperedge set S(e7) = {e6} of the current core hyperedge e7 through the first multi-thread to obtain the current similar hyperedge e6. The current similar hyperedge e6 belongs to the core hyperedge set and the identifier 7 of the current core hyperedge e7 is greater than the identifier 6 of the current similar hyperedge e6, then the cluster Cm to which the current core hyperedge e7 belongs is merged with the cluster Cn to which the current similar hyperedge e6 belongs. Since the current similar hyperedge e6 belongs to the core hyperedge, and the identifier 6 of the current similar hyperedge is smaller than the identifier of the current core hyperedge 7, it means that the current similar hyperedge e6, i.e., the core hyperedge e6, has been clustered. Therefore, in order to avoid repeated processing, it is necessary to merge the cluster to which the current core hyperedge e7 belongs with the cluster to which the current similar hyperedge e6 belongs.

[0144] According to the technical solution in the above-mentioned example embodiment, if the current similar hyperedge belongs to the core hyperedge set and the identifier of the current core hyperedge is greater than the identifier of the current similar hyperedge, the cluster to which the current core hyperedge belongs and the cluster to which the current similar hyperedge belongs are merged, and the two core hyperedges with structurally similar hyperedges can be processed only once, thereby avoiding repeated operations and further improving the efficiency of graph clustering.

[0145] Furthermore, in the exemplary embodiment, when performing parallel clustering, the electronic device 200 primarily uses a union-find operation to complete clustering. Union-find is implemented using a path compression find() function and a union() function. In graph clustering, union-find is an efficient data structure used to manage the grouping of elements. Dynamic connectivity analysis is achieved through the path compression find() and union() operations. The core goal of union-find is to divide nodes or edges in a graph into connected components (clusters), determine whether elements belong to the same set, and support dynamic merge operations.

[0146] Among them, the path compression search function find(e) returns the smallest numbered hyperedge e in the set or cluster where the hyperedge e is located. min The cluster label Label[e min ], if the return value of the function find(e) is equal to the return value of the function find(e1), it means that the hyperedge e and the hyperedge e1 are in the same set or cluster. The function union(e1,e2) performs the operation Label[find(e1)]=find(e2), which sets the hyperedge e with the minimum number in the set where the hyperedge e1 is located. min1 The cluster label Label[emin1 ] is the smallest numbered hyperedge e in the set where hyperedge e2 is located min2 The cluster label Label[e min2 ].

[0147] In an example embodiment, the electronic device 200 determines the first return value of the current core hyperedge and the second return value corresponding to the current similar hyperedge through a path compression lookup function, the first return value representing the cluster label of the smallest-numbered hyperedge of the cluster to which the current core hyperedge belongs, and the second return value representing the cluster label of the smallest-numbered hyperedge of the cluster to which the current similar hyperedge belongs; if the first return value is greater than or equal to the second return value, the cluster to which the current core hyperedge belongs is merged into the cluster to which the current similar hyperedge belongs through a merge function; if the first return value is less than the second return value, the cluster to which the current similar hyperedge belongs is merged into the cluster to which the current core hyperedge belongs through a merge function. That is to say, when the cluster to which the current core hyperedge belongs is not the same cluster as the cluster to which the current similar hyperedge belongs, the two clusters are merged through the merging function. For example, if the cluster label of the cluster to which hyperedge e2 belongs is C2, and the cluster label of the cluster to which hyperedge e3 belongs is C3, the cluster C3 to which hyperedge e3 belongs is merged into the cluster C2 to which hyperedge e2 belongs, that is, the cluster with the larger cluster label is merged into the cluster with the smaller cluster label.

[0148] For example, refer to Figure 4 As shown, the hypergraph has a set of hyperedges E = {e1, e2, e3, e4, e5, e6, e7}. The cluster labels of each hyperedge are initialized, for example, e1∈C1; e2∈C2; e3∈C3; e4∈C4; e5∈C5; e6∈C6; e7∈C7. Assuming the similarity parameter ε = 0.86 and the number of similar neighbors parameter μ = 2, the core hyperedge set H is {e3, e4, e6, e7, e2}, and the similar hyperedge set S(e3) of the core hyperedge e3 is {e4, e2}. Suppose the current core hyperedge is e3. If the current similar hyperedge is e4, the path compression search function find() is used to determine that the first return value of the current core hyperedge e3 is C3 and the second return value C4 corresponding to the current similar hyperedge e4. If the first return value C3 is less than the second return value C4, the cluster C4 to which the current similar hyperedge e4 belongs is merged into the cluster C3 to which the current core hyperedge e3 belongs, that is, C3{e3, e4}, through the merge function; if the current similar hyperedge is e2, the path compression search function find() is used to determine that the first return value of the current core hyperedge e3 is C3 and the second return value C2 corresponding to the current similar hyperedge e2. If the first return value C3 is greater than the second return value C2, the cluster C3 to which the current core hyperedge e3 belongs is merged into the cluster C2 to which the current similar hyperedge e2 belongs, that is, C2{e2, e3, e4}, through the merge function.

[0149] According to the technical solution in the above-mentioned example embodiment, the connected cluster to which the hyperedge belongs is found through the path compression search function, and the two connected clusters are merged through the merge function. In the search process, similar hyperedges can be directly pointed to the same cluster label, which significantly reduces the time complexity of subsequent clustering and further improves the efficiency of graph clustering.

[0150] Furthermore, when clustering similar non-core hyperedges in the similar hyperedge set of the current core hyperedge through the second multi-threading, the electronic device 200 traverses each similar hyperedge in the similar hyperedge set of the current core hyperedge through the second multi-threading to obtain the current similar hyperedge; if the current similar hyperedge does not belong to the core hyperedge set, the current similar hyperedge is added to the cluster to which the current core hyperedge belongs.

[0151] For example, assuming the similarity parameter ε = 0.87 and the similar neighbor number parameter μ = 2, the core hyperedge set H is {e3, e4, e6, e7}, and the electronic device 200 traverses the similar hyperedge set S(e3) = {e4, e2} of the current core hyperedge e3 through the second multi-thread. If the current similar hyperedge e4 is a similar core hyperedge, no processing is performed; if the current similar hyperedge e2 is obtained, the current similar hyperedge e2 is a similar non-core hyperedge e2, and the similar non-core hyperedge e2 is added to the current cluster, that is, the cluster C = {e3, e2}.

[0152] According to the technical solution in the above example embodiment, similar non-core hyperedges in the similar hyperedge set of the current core hyperedge are clustered by the second multithreading, and multiple hyperedges can be clustered simultaneously, thereby improving data processing efficiency.

[0153] In addition, in an example embodiment, the electronic device 200 traverses each hyperedge in the hypergraph through a third multi-thread to obtain the current hyperedge; determines the third return value corresponding to the current hyperedge through the path compression search function find(), and the third return value represents the cluster label of the smallest numbered hyperedge of the cluster to which the current hyperedge belongs; and sets the cluster label of the current hyperedge to the third return value.

[0154] For example, the electronic device 200 sets the nth hyperedge e n Label(e n )=find(e n ), the label will not be set to the smallest number hyperedge e in its set min Label[e min ] is set to Label[e min ].

[0155] According to the technical solution in the above example embodiment, the final cluster label of each hyperedge is updated through the path compression search function find(), which can ensure the consistency of the cluster label of the hyperedge and improve the subsequent clustering efficiency.

[0156] Figure 6 A schematic diagram of a process for performing sequential clustering according to some embodiments of this specification is shown.

[0157] Reference Figure 6 As shown in Figure 2, based on the obtained core hyperedge set H and the similar hyperedge set S corresponding to each core hyperedge, the sequential clustering method is mainly implemented through the following sub-steps:

[0158] In step S610, a cluster set of multiple clusters is set.

[0159] In step S620, set the counter i=1;

[0160] In step S630, it is determined whether the counter i is greater than the number of hyperedges stored in the core hyperedge set H. If so, the process proceeds to step S6140. Otherwise, an unmarked core hyperedge e in the core hyperedge set H is obtained, and the process proceeds to step S640.

[0161] In step S640, the current cluster set C is set to {e}, the core hyperedge queue Q is set to {e}, and a new cluster label l is used to mark the core hyperedge e;

[0162] In step S650, it is determined whether the core hyperedge queue Q is empty. If so, the process proceeds to step S6130; otherwise, the process proceeds to step S660.

[0163] In step S660 , set core hyperedge e1 = Q.dequeue(), that is, remove the top element of the core hyperedge queue Q from the queue and assign it to the core hyperedge e1;

[0164] In step S670, set counter j=1;

[0165] In step S680, it is determined whether the counter j is greater than the number of hyperedges stored in the structurally similar hyperedge set S(e1) of the core hyperedge e1 in the hypergraph G, where the set S(e1) is a subset of the similar hyperedge set S; if the counter j is greater than the number of hyperedges stored in the structurally similar hyperedge set S(e1) of the core hyperedge e1 in the hypergraph G, then the process returns to step S650, otherwise the j-th similar hyperedge e in the set S(e1) is obtained. j , then proceed to step S690;

[0166] In step S690, determine the jth similar hyperedge e jIs the flag of 1? If so, proceed to step S6120; otherwise, proceed to step S6100;

[0167] In step S6100, the jth similar hyperedge e j Add to the current cluster set C and add the jth similar hyperedge e j The cluster label is marked as l;

[0168] In step S6110, determine the jth similar hyperedge e j Is it a core hyperedge? If so, the jth similar hyperedge e j Add to the core hyperedge queue Q and set the counter i = i + 1, indicating that the jth similar hyperedge e will be expanded later. j Structurally similar neighbors;

[0169] In step S6120, set the counter j=j+1, and return to step S680;

[0170] In step S6130, set the counter i=i+1 and set the set C n =C n ∪C, save the current cluster set C to the cluster set C of multiple clusters n , return to step S630;

[0171] In step S6140, a cluster set C of multiple clusters is formed. n And the definition of bridging hub hyperedges and outlier hyperedges marks all unlabeled hyperedges as bridging hub hyperedges or outlier hyperedges;

[0172] In step S6150, a cluster set C of multiple clusters is returned. n And the mark corresponding to the hyperedge, the process ends.

[0173] according to Figure 6 The technical solution in the example embodiment, on the one hand, by pre-building the hyperedge index structure of the hypergraph, the information required for clustering can be directly selected from the hyperedge index according to the specific values ​​of the query parameters ∈ and μ without recalculation, which reduces the calculation time of clustering and greatly improves the time performance of hypergraph structural clustering; on the other hand, based on the expansion strategy driven by the core hyperedge, through the sequential traversal of the core hyperedge set and the similar hyperedge set and the dynamic expansion of similar hyperedges, a cluster label is assigned to each hyperedge, and multiple clusters can be dynamically generated, thereby realizing efficient, robust and adaptive hypergraph clustering.

[0174] Figure 7 A schematic diagram of parallel clustering provided according to some embodiments of this specification is shown.

[0175] Reference Figure 7 As shown in Figure 2, based on the obtained core hyperedge set H and the similar hyperedge set S corresponding to each core hyperedge, the parallel clustering method is mainly implemented through the following sub-steps:

[0176] In step S710, a cluster set of multiple clusters is set.

[0177] In step S720, set the counter p=1;

[0178] In step S730, it is determined whether the counter p is greater than the number of hyperedges contained in the hypergraph G. If so, the process proceeds to step S750. Otherwise, the pth hyperedge e is set. p The cluster label Label(e p )=p, i.e. using its own number to identify the cluster set it belongs to, and proceeding to step S740;

[0179] In step S740, set the counter p=p+1, and return to step S730;

[0180] In step S750, a first multi-threaded process is started to process core hyperedges in the core hyperedge set H, the thread pool size is set to t, the counter i is set to 1, and each thread obtains and processes hyperedges according to the following sub-steps;

[0181] In step S7510, it is determined whether the counter i is greater than the number of hyperedges in the core hyperedge set H. If so, the process proceeds to step S760. Otherwise, the i-th core hyperedge e in the core hyperedge set H is obtained. i , then proceed to step S7520;

[0182] In step S7520, set counter j=1;

[0183] In step S7530, it is determined whether the counter j is greater than the i-th core hyperedge e i The set of structurally similar hyperedges S(e i ), the number of hyperedges in the set S(e i ) is a subset of the similar hyperedge set S, if so, proceed to step S7570, otherwise obtain the set S(e i ) in the jth similar hyperedge e j , then proceed to step S7540;

[0184] In step S7540, determine the i-th core hyperedge e i Is the identity of greater than the jth similar hyperedge e j The identity of the jth similar hyperedge e jWhether it belongs to the core hyperedge set H (the advantage of this restriction is that the core hyperedges are clustered first and two core hyperedges with similar structures are only processed once). If so, go to step S7550; otherwise, go to step S7560;

[0185] In step S7550, the path compression search function find(e i ) is greater than the return value of the function find(e j ) return value, if it is, execute the merge function union(e i ,e j ), the i-th hyperedge e i The set it is in is merged into the jth hyperedge e j Otherwise, execute the function union(e j ,e i ), the jth hyperedge e j The set it is in is merged into the i-th hyperedge e i The set it is in; for example, if the return value of the path compression search function find(e3) is 3 and the return value of find(e4) is 4, and 3 is less than 4, then the cluster to which the current similar hyperedge e4 belongs is merged into the cluster C3 to which the current core hyperedge e3 belongs, that is, C3{e3, e4}, through the merge function.

[0186] In step S7560, set the counter j=j+1, and return to step S7530;

[0187] In step S7570, set the counter i=i+1, and return to step S7510;

[0188] In step S760, a second multithreaded process is started to process non-core hyperedges in the hypergraph G, the thread pool size is set to t, the counter k is set to 1, and each thread obtains and processes hyperedges according to the following sub-steps;

[0189] In step S7610, it is determined whether the counter k is greater than the number of hyperedges in the core hyperedge set H. If so, the process proceeds to step S770. Otherwise, the kth core hyperedge e in the core hyperedge set H is obtained. k , then proceed to step S7620;

[0190] In step S7620, set the counter m=1;

[0191] In step S7630, it is determined whether the counter m is greater than the kth core hyperedge e k The set of structurally similar hyperedges S(e k ), the number of hyperedges in the set S(e k) is a subset of the similar hyperedge set S, if so, proceed to step S7670, otherwise obtain the set S(e k ) in the mth similar hyperedge e m , then proceed to step S7640;

[0192] In step S7640, determine the mth similar hyperedge e m Whether it belongs to the core hyperedge set H, if yes, go to step S7660, otherwise go to step S7650;

[0193] In step S7650, execute the function union(e m ,e k ), the mth similar hyperedge e m Add the kth core hyperedge e k The collection where

[0194] In step S7660, set the counter m=m+1, and return to step S7630;

[0195] In step S7670, set the counter k=k+1, and return to step S7610;

[0196] In step S770, a third multithread is started to process all hyperedges in the hypergraph G, the thread pool size is set to t, the counter n is set to 1, and each thread obtains and processes hyperedges according to the following substeps;

[0197] In step S7710, determine whether the counter n is greater than the number of hyperedges in the hypergraph G. If so, proceed to step S780. Otherwise, obtain the nth hyperedge e in the hypergraph. n , then proceed to step S7720;

[0198] In step S7720, set the nth hyperedge e n Label(e n )=find(e n ), this step is to set the hyperedge e without setting the label to the minimum number of its set min Label[e min ] is set to Label[e min ];

[0199] In step S7730, set the counter n=n+1, and return to step S7710;

[0200] In step S780, a cluster set C of multiple clusters is set according to the cluster labels of the hyperedges. n , and find the bridging hub hyperedges and outlier hyperedges.

[0201] In step S790, a cluster set C of multiple clusters is returned. n And the cluster label corresponding to the hyperedge, the process ends.

[0202] according to Figure 7 The technical solution in the example embodiment, on the one hand, by pre-building the hyperedge index structure of the hypergraph, the information required for clustering can be directly selected from the hyperedge index according to the specific values ​​of the query parameters ∈ and μ without recalculation, which reduces the calculation time of clustering and greatly improves the time performance of hypergraph structural clustering; on the other hand, by multi-threading and parallel processing of similar core hyperedges and similar non-core hyperedges in the similar hyperedge set of core hyperedges, multiple hyperedges can be clustered at the same time, thereby improving data processing efficiency, so that larger-scale hypergraphs can be clustered more efficiently.

[0203] Figure 8 A schematic flow chart of a graph clustering method provided according to some further embodiments of this specification is shown.

[0204] Reference Figure 8 As shown, the graph clustering method includes offline preprocessing and online clustering. Offline preprocessing is used to establish a hyperedge index of the hypergraph in the offline phase. Online clustering is used to cluster the hypergraph during the online query phase. The offline preprocessing includes steps S810 to S830. The online clustering includes steps S840 to S880. The graph clustering method is described in detail below.

[0205] In step S810, a hypergraph is input.

[0206] In an example embodiment, electronic device 200 obtains a hypergraph to be clustered. For example, electronic device 200 obtains a social network hypergraph. Hyperedges in the social network hypergraph can represent "groups" or "events." For example, if a group contains multiple users, a hyperedge index can be used to quickly find groups in which users participate. Core hyperedges can represent popular "groups" or "events."

[0207] In step S820 , a hyperedge index is constructed.

[0208] In an exemplary embodiment, the hyperedge index includes a core hyperedge index CO (Core Order) and an adjacent hyperedge index NO (Neighbor Order). The electronic device 200 determines the structural similarity between each hyperedge in the hypergraph and each adjacent hyperedge, arranges the adjacent hyperedges of the hyperedge in descending order based on the size of the structural similarity, and generates an adjacent hyperedge index NO corresponding to the hyperedge; and determines the similarity extreme value of each hyperedge under the condition of satisfying the similar neighbor number for each similar neighbor number, arranges each hyperedge in descending order based on the size of the similarity extreme value, and generates a core hyperedge index CO corresponding to the similar neighbor number.

[0209] In step S830 , the hyperedge index is stored.

[0210] In an exemplary embodiment, the data structure of the core hyperedge index CO and the adjacent hyperedge index NO can be an adjacency table, and the electronic device 200 stores the core hyperedge index CO and the adjacent hyperedge index NO through the adjacency table. For example, the adjacency table of the adjacent hyperedge index NO stores (hyperedge id, similarity) pairs. For each hyperedge e∈E, the electronic device 200 arranges the adjacent hyperedges in descending order according to the size of the structural similarity and stores the adjacent hyperedge index through the neighbor table. Figure 5 As shown, NO1 represents the adjacent hyperedge index corresponding to hyperedge e1 (e1: 1.00, e3: 0.71, e4: 0.63, e2: 0.41), NO2 represents the adjacent hyperedge index corresponding to hyperedge e2 (e2: 1.00, e3: 0.87, e4: 0.77, e1: 0.41), and NO3 represents the adjacent hyperedge index corresponding to hyperedge e3 (e3: 1.00, e4: 0.89, e2: 0.87, e1: 0.71).

[0211] In step S840 , a hypergraph, a hyperedge index, and query parameters are input.

[0212] In an exemplary embodiment, during the online query phase, the electronic device 200 obtains a hypergraph and a hyperedge index of the hypergraph from a database, and outputs query parameters on a graphical user interface, where the query parameters include a similar neighbor number parameter μ and a similarity parameter ε.

[0213] In step S850 , a clustering method is selected.

[0214] In an exemplary embodiment, clustering methods include sequential clustering (serial clustering) and parallel clustering. Both sequential and parallel clustering methods can efficiently perform structural clustering on hypergraphs. The parallel method is slightly faster than the serial method on small-scale hypergraphs when running with a large number of threads, and significantly faster than the serial computing method on large-scale hypergraphs. The choice of using the serial or parallel method for structural clustering of the hypergraph can be made based on whether the system operating environment supports parallel computing.

[0215] In step S860, sequential clustering is performed.

[0216] In an exemplary embodiment, the electronic device 200 uses a core hyperedge as a clustering starting point and sequentially clusters each similar hyperedge in the similar hyperedge set of each core hyperedge to obtain multiple clusters. For example, the electronic device 200 traverses the unlabeled core hyperedges in the core hyperedge set to determine the current core hyperedge and the cluster label of the current cluster corresponding to the current core hyperedge; traverses each similar hyperedge in the similar hyperedge set of the current core hyperedge to obtain the current similar hyperedge; if the current similar hyperedge is not labeled as a cluster label, the current similar hyperedge is added to the current cluster and labeled with the cluster label.

[0217] In step S870, parallel clustering is performed.

[0218] In an exemplary embodiment, the electronic device 200 uses a core hyperedge as a clustering starting point and performs parallel clustering on each similar core hyperedge and each similar non-core hyperedge in the similar hyperedge set of each core hyperedge, thereby obtaining multiple clusters. For example, the electronic device 200 traverses each core hyperedge in the core hyperedge set, determines the cluster label of the current core hyperedge and the current cluster corresponding to the current core hyperedge; clusters similar core hyperedges in the similar hyperedge set of the current core hyperedge using a first multithreading process; and performs parallel clustering on similar non-core hyperedges in the similar hyperedge set of the current core hyperedge using a second multithreading process.

[0219] In step S880 , the clustering result is output.

[0220] In an exemplary embodiment, the electronic device 200 outputs a cluster set of a plurality of clusters and a bridging hyperedge or an outlier hyperedge.

[0221] According to the technical solutions in the above-mentioned example embodiments, on the one hand, by pre-building the hyperedge index structure of the hypergraph, the information required for clustering can be directly selected from the hyperedge index according to the specific values ​​of the query parameters ∈ and μ without recalculation, thereby reducing the computational time of clustering and greatly improving the time performance of the structural clustering of the hypergraph; on the other hand, sequential clustering for the hypergraph, namely the serial clustering method and the parallel clustering method, is implemented. Both methods can efficiently perform structural clustering on the hypergraph. The parallel method is slightly faster than the serial method on a small-scale hypergraph when the number of running threads is large, and runs significantly faster than the serial calculation method on a large-scale hypergraph. Whether to use the serial method or the parallel method for structural clustering of the hypergraph can be independently selected according to whether the system operating environment supports parallel computing, thereby improving the adaptability of the above-mentioned graph clustering method.

[0222] On the other hand, this specification provides a non-transitory storage medium storing at least one set of executable instructions for performing graph clustering processing. When the above-mentioned executable instructions are executed by a processor, the above-mentioned executable instructions instruct the above-mentioned processor to implement the steps of the graph clustering method described in this specification. In some possible implementations, the various aspects of this specification can also be implemented in the form of a program product, which includes program code. When the above-mentioned program product is run on an electronic device 200, the above-mentioned program code is used to enable the electronic device 200 to perform the steps of the graph clustering method described in this specification. The program product for implementing the above-mentioned method can use a portable compact disk read-only memory (CD-ROM) to include program code and can be run on the electronic device 200. However, the program product of this specification is not limited to this. In this specification, a readable storage medium can be any tangible medium that contains or stores a program that can be used by or in combination with an instruction execution system. The above-mentioned program product can use any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media include: an electrical connection having one or more conductors, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. The computer-readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. The computer-readable storage medium may also be any readable medium other than a computer-readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing. Program code for performing the operations described herein may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the electronic device 200, partially on the electronic device 200, as a stand-alone software package, partially on the electronic device 200 and partially on a remote computing device, or entirely on the remote computing device.

[0223] The foregoing description of specific embodiments of this specification is intended to be a description of other embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some embodiments, multi-graph clustering and parallel processing are also possible or potentially advantageous.

[0224] In summary, after reading this detailed disclosure, those skilled in the art will appreciate that the foregoing detailed disclosure may be presented by way of example only and may not be limiting. Although not expressly stated herein, those skilled in the art will understand that this specification encompasses various reasonable changes, improvements, and modifications to the embodiments. Such changes, improvements, and modifications are intended to be suggested by this specification and are within the spirit and scope of the exemplary embodiments of this specification.

[0225] Furthermore, certain terms in this specification have been used to describe embodiments of this specification. For example, “one embodiment,” “an embodiment,” and / or “some embodiments” mean that a particular feature, structure, or characteristic described in connection with that embodiment can be included in at least one embodiment of this specification. Therefore, it is emphasized and should be understood that two or more references to “an embodiment,” “one embodiment,” or “an alternative embodiment” in various sections of this specification do not necessarily refer to the same embodiment. Furthermore, particular features, structures, or characteristics may be appropriately combined in one or more embodiments of this specification.

[0226] It should be understood that in the foregoing descriptions of the embodiments of this specification, to facilitate understanding of a feature and to simplify this specification, various features are combined in a single embodiment, figure, or description thereof. However, this does not necessarily mean that these features are combined. When reading this specification, a person skilled in the art may label some of the devices as separate embodiments. In other words, the embodiments of this specification can also be understood as the integration of multiple sub-embodiments. This also applies when each sub-embodiment contains fewer than all the features of a single previously disclosed embodiment.

[0227] Each patent, patent application, patent application publication, and other materials, such as articles, books, specifications, publications, documents, articles, etc., cited herein is hereby incorporated by reference, except for any content of the same that appears in the relevant documents that may be inconsistent or conflicting with this document, or that may have a limiting effect on the broadest scope of the claims. For example, if there is any inconsistency or conflict between the description, definition, and / or use of terms associated with any incorporated material and the terminology, description, definition, and / or use associated with this document, the terminology in this document will control.

[0228] Finally, it should be understood that the embodiments of the application disclosed herein are illustrative of the principles of the embodiments of this specification. Other modified embodiments are also within the scope of this specification. Therefore, the embodiments disclosed in this specification are merely examples and not limitations. Those skilled in the art can adopt alternative configurations based on the embodiments in this specification to implement the application in this specification. Therefore, the embodiments of this specification are not limited to the embodiments precisely described in the application.

Claims

1. A graph clustering method, comprising: Determine a core hyperedge set of a hypergraph and similar hyperedge sets of each core hyperedge in the core hyperedge set based on a preset hyperedge index and a query parameter; Taking the core hyperedge as a clustering starting point, clustering each of the similar hyperedges in the similar hyperedge set of each core hyperedge to obtain a plurality of clusters; as well as Hyperedges of the hypergraph outside the plurality of clusters are classified.

2. The method according to claim 1, wherein The preset hyperedge index includes a core hyperedge index and an adjacent hyperedge index. The core hyperedge index represents an index obtained by arranging the core hyperedges in descending order according to the size of the similarity extreme values ​​corresponding to each core hyperedge. The similarity extreme value represents the maximum value of the structural similarity of the core hyperedge under the condition of satisfying a preset number of similar neighbors. The adjacent hyperedge index represents an index obtained by arranging the adjacent hyperedges of each hyperedge in descending order according to the size of the structural similarity of the two hyperedges of the hypergraph.

3. The method according to claim 2, wherein: The query parameters include a similar neighbor number parameter and a similarity parameter, and determining a core hyperedge set of a hypergraph based on a preset hyperedge index and the query parameters includes: Determining a corresponding target core hyperedge index based on the similar neighbor number parameter; and The core hyperedges whose structural similarity is greater than the similarity parameter are selected from the target core hyperedge indexes to obtain a core hyperedge set of the hypergraph.

4. The method according to claim 3, wherein: The step of determining a similar hyperedge set of each core hyperedge in the core hyperedge set based on a preset hyperedge index and a query parameter includes: Determining a target adjacent hyperedge index corresponding to each core hyperedge in the core hyperedge set; and Hyperedges whose structural similarity is greater than the similarity parameter are selected from the target adjacent hyperedge index to obtain the similar hyperedge set of each core hyperedge.

5. The method according to claim 2, wherein: Before determining the core hyperedge set of the hypergraph and the similar hyperedge set of each core hyperedge in the core hyperedge set, the method further includes: For each hyperedge in the hypergraph, determining the structural similarity between the hyperedge and each adjacent hyperedge, arranging the adjacent hyperedges of the hyperedge in descending order based on the structural similarity, and generating the adjacent hyperedge index corresponding to the hyperedge; and For each of the similar neighbor numbers, determine the similarity extreme value of each of the hyperedges under the condition that the similar neighbor number is satisfied, arrange the hyperedges in descending order based on the size of the similarity extreme value, and generate the core hyperedge index corresponding to the similar neighbor number.

6. The method according to claim 1, wherein The step of clustering each similar hyperedge in the similar hyperedge set of each core hyperedge using the core hyperedge as a clustering starting point includes: Taking the core hyperedge as a clustering starting point, sequentially clustering each similar hyperedge in the similar hyperedge set of each core hyperedge; or, Taking the core hyperedge as a clustering starting point, each similar core hyperedge and each similar non-core hyperedge in the similar hyperedge set of each core hyperedge are clustered in parallel.

7. The method according to claim 6, wherein: The step of taking the core hyperedge as a clustering starting point and sequentially clustering each similar hyperedge in the similar hyperedge set of each core hyperedge comprises: Traversing the unlabeled core hyperedges in the core hyperedge set, determining a current core hyperedge and a cluster label of a current cluster corresponding to the current core hyperedge; Traversing each of the similar hyperedges in the similar hyperedge set of the current core hyperedge to obtain a current similar hyperedge; If the current similar hyperedge is not marked as the cluster label, the current similar hyperedge is added to the current cluster and marked with the cluster label.

8. The method according to claim 7, wherein: The method further comprises: If the current similar hyperedge is a core hyperedge, the current similar hyperedge is added to a core hyperedge queue, which is used to store core hyperedges to be clustered. Determining the current core hyperedge includes: The core hyperedge to be clustered is obtained from the core hyperedge queue, and the obtained core hyperedge to be clustered is used as the current core hyperedge.

9. The method according to claim 6, wherein: The method of taking the core hyperedge as a clustering starting point and performing parallel clustering on similar core hyperedges and similar non-core hyperedges in the similar hyperedge set of each core hyperedge includes: Traversing each core hyperedge in the core hyperedge set, determining a current core hyperedge and a cluster label of a current cluster corresponding to the current core hyperedge; Clustering similar core hyperedges in the similar hyperedge set of the current core hyperedge by a first multithreading; and The similar non-core hyperedges in the similar hyperedge set of the current core hyperedge are clustered in parallel by using the second multithreading.

10. The method according to claim 9, wherein: The clustering of similar core hyperedges in the similar hyperedge set of the current core hyperedge by the first multithreading comprises: Traversing each of the similar hyperedges in the similar hyperedge set of the current core hyperedge by the first multithread to obtain a current similar hyperedge; If the current similar hyperedge belongs to the core hyperedge set and the identifier of the current core hyperedge is greater than the identifier of the current similar hyperedge, the cluster to which the current core hyperedge belongs is merged with the cluster to which the current similar hyperedge belongs.

11. The method according to claim 10, wherein: The merging of the cluster to which the current core hyperedge belongs and the cluster to which the current similar hyperedge belongs includes: Determine, by a path compression lookup function, a first return value of the current core hyperedge and a second return value corresponding to the current similar hyperedge, wherein the first return value represents the cluster label of the smallest-numbered hyperedge of the cluster to which the current core hyperedge belongs, and the second return value represents the cluster label of the smallest-numbered hyperedge of the cluster to which the current similar hyperedge belongs; If the first return value is greater than or equal to the second return value, merging the cluster to which the current core hyperedge belongs into the cluster to which the current similar hyperedge belongs through the merging function; If the first return value is less than the second return value, the cluster to which the current similar hyperedge belongs is merged into the cluster to which the current core hyperedge belongs through a merging function.

12. The method according to claim 9, wherein The parallel clustering of similar non-core hyperedges in the similar hyperedge set of the current core hyperedge by the second multithreading includes: traversing each of the similar hyperedges in the similar hyperedge set of the current core hyperedge by the second multithread to obtain a current similar hyperedge; If the current similar hyperedge does not belong to the core hyperedge set, the current similar hyperedge is added to the cluster to which the current core hyperedge belongs.

13. The method according to claim 9, wherein: The method further comprises: traversing each hyperedge in the hypergraph by a third multithread to obtain a current hyperedge; Determine a third return value corresponding to the current hyperedge by a path compression lookup function, wherein the third return value represents the cluster label of the smallest-numbered hyperedge of the cluster to which the current hyperedge belongs; The cluster label of the current hyperedge is set as the third return value.

14. The method according to claim 1, wherein Classifying the hyperedges of the hypergraph outside the multiple clusters includes: Based on the connection relationship between the hyperedges of the hypergraph and the hyperedges of the cluster, the unlabeled hyperedges of the hypergraph are labeled as outlier hyperedges or bridging hyperedges. The outlier hyperedge means that the hyperedge is not included in the plurality of clusters and is connected to only one more hyperedge of the cluster, and the bridging hyperedge means that the hyperedge is not included in the plurality of clusters and is connected to at least two hyperedges of the cluster.

15. An electronic device comprising: at least one storage medium storing at least one instruction set for performing graph clustering processing; as well as at least one processor, in communication with the at least one storage medium; Wherein, when the electronic device is running, the at least one processor reads the at least one instruction set and executes the graph clustering method according to any one of claims 1-14 according to the instructions of the at least one instruction set.