A method, device and related products for determining the maximum group of a knowledge graph

By coding the undirected graph and complementary graph of the knowledge graph and solving the MAXSAT, the maximum group determination strategy is generated, and the problem of low efficiency of large-scale knowledge graph maximum group determination in the existing technology is solved, and faster and more efficient maximum group determination is achieved.

CN119783783APending Publication Date: 2025-04-08NEUSOFT CORP
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411858012.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-16
Publication Date
2025-04-08

AI Technical Summary

Technical Problem

The prior art is less efficient in determining the maximum cluster in large-scale knowledge graphs, especially when the number of nodes and edges increases dramatically, resulting in too long run time and huge search space.

Method used

By obtaining the undirected graph of the target knowledge graph and its complementary graph, encoding is performed to obtain the soft clause set and the hard clause set, and solving these clause sets is used by the MAXSAT solver to generate a maximum clump determination strategy to quickly determine the maximum clump.

Benefits of technology

It improves the efficiency of determining the maximum cluster of knowledge graphs, avoids problems such as long running time and huge search space, and can extract valuable information in the knowledge graph more quickly.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119783783A_ABST
    Figure CN119783783A_ABST
Patent Text Reader

Abstract

The present application discloses a method, device and related products for determining the maximum clique of a knowledge graph. Obtain a target undirected graph corresponding to the target knowledge graph and a target complement graph corresponding to the target undirected graph; encode the vertex set of the undirected graph and the edge set of the complement graph to obtain a soft clause set corresponding to the vertex set of the undirected graph and a hard clause set corresponding to the edge set of the complement graph; solve the soft clause set and the hard clause set to obtain a maximum clique determination strategy corresponding to the target knowledge graph; determine the maximum clique of the graph corresponding to the target knowledge graph according to the maximum clique determination strategy. In this way, the maximum clique of the target knowledge graph can be quickly determined in the present application by solving the soft clause set and the hard clause set, thereby improving the efficiency of determining the maximum clique of the knowledge graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of knowledge graph technology, and in particular to a method, device and related products for determining the maximum clique of a knowledge graph. Background Art

[0002] With the continuous growth of data volume and the continuous changes in business needs, more and more enterprises usually achieve data integration and fast query by building and applying knowledge graphs, and can also integrate knowledge graphs in different fields to form a more complete large-scale knowledge graph. The largest group in the knowledge graph can indicate the valuable information in the knowledge graph, so as to improve decision-making efficiency and business competitiveness based on the largest group.

[0003] Based on this, in the related art, the determination of the maximum cluster of the knowledge graph is mainly based on the maximum depth search method, that is, first the maximum cluster is set to be an empty cluster, and then the graph vertices of the knowledge graph are added to the empty cluster one by one to determine whether the added graph vertices can form a cluster, and this cycle is repeated until all the graph vertices of the knowledge graph are traversed. As the scale of the knowledge graph expands, this method of determining the maximum cluster may lead to a low efficiency in determining the maximum cluster of the knowledge graph.

[0004] Therefore, how to improve the efficiency of determining the maximum cluster of the knowledge graph is a key issue that technical personnel in this field are concerned about. Summary of the invention

[0005] Based on the above problems, the present application provides a method, device and related products for determining the maximum clique of a knowledge graph to improve the efficiency of determining the maximum clique of a knowledge graph.

[0006] The embodiments of the present application disclose the following technical solutions:

[0007] The first aspect of the present application provides a method for determining the maximum clique of a knowledge graph. The method for determining the maximum clique of a knowledge graph comprises:

[0008] Obtain a target undirected graph corresponding to a target knowledge graph and a target complement graph corresponding to the target undirected graph, wherein the undirected graph vertex set corresponding to the target undirected graph is the same as the complement graph vertex set corresponding to the target complement graph, and the undirected graph edge set corresponding to the target undirected graph and the complement graph edge set corresponding to the target complement graph are in a complementary relationship;

[0009] Encoding the undirected graph vertex set and the complement graph edge set to obtain a soft clause set corresponding to the undirected graph vertex set and a hard clause set corresponding to the complement graph edge set, wherein one undirected graph vertex corresponds to one soft clause, and one complement graph edge corresponds to one hard clause;

[0010] Solving the soft clause set and the hard clause set to obtain a maximum clique determination strategy corresponding to the target knowledge graph, wherein the maximum clique determination strategy is used to indicate that a maximum clique is determined according to n undirected graph vertices in the undirected graph vertex set, the sum of the weights of the n undirected graph vertices is the largest, and n is greater than or equal to 3;

[0011] According to the maximum cluster determination strategy, the maximum cluster of the graph corresponding to the target knowledge graph is determined.

[0012] In an achievable implementation, before encoding the undirected graph vertex set and the complement graph edge set to obtain a soft clause set corresponding to the undirected graph vertex set and a hard clause set corresponding to the complement graph edge set, the method further includes:

[0013] Obtain a vertex weight set corresponding to the undirected graph vertex set, wherein one undirected graph vertex corresponds to one vertex weight;

[0014] The encoding process of the undirected graph vertex set and the complement graph edge set to obtain a soft clause set corresponding to the undirected graph vertex set and a hard clause set corresponding to the complement graph edge set includes:

[0015] Performing clause encoding on the vertex weight set and the undirected graph vertex set to obtain a soft clause set corresponding to the undirected graph vertex set, wherein one soft clause is obtained corresponding to one vertex weight and one undirected graph vertex;

[0016] Clause encoding is performed on the complement graph edge set to obtain a hard clause set corresponding to the complement graph edge set.

[0017] In an achievable implementation, before solving the soft clause set and the hard clause set to obtain the maximum clique determination strategy corresponding to the target knowledge graph, the method further includes:

[0018] Obtaining a MAXSAT solver, wherein the MAXSAT solver is used to perform a solving operation on the soft clause set and the hard clause set;

[0019] The solving process of the soft clause set and the hard clause set to obtain the maximum clique determination strategy corresponding to the target knowledge graph includes:

[0020] The soft clause set and the hard clause set are solved by the MAXSAT solver to obtain the maximum clique determination strategy corresponding to the target knowledge graph.

[0021] In an achievable implementation, the solving of the soft clause set and the hard clause set by the MAXSAT solver to obtain the maximum clique determination strategy corresponding to the target knowledge graph includes:

[0022] Performing assignment processing on the soft clause set by the MAXSAT solver to obtain a soft clause variable set corresponding to the soft clause set, wherein one soft clause corresponds to one soft clause variable;

[0023] For each hard clause, performing clause solving on the hard clause according to the soft clause variable set by the MAXSAT solver to obtain a clause solving result corresponding to the hard clause;

[0024] For the hard clause set, if each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is a true value, determine the weight calculation result corresponding to the soft clause set, wherein the weight calculation result indicates that the sum of the weights of the undirected graph vertices corresponding to the n soft clauses whose soft clause variables in the soft clause set are true values ​​is the largest;

[0025] According to the weight calculation result, a maximum clique determination strategy corresponding to the target knowledge graph is generated.

[0026] In an achievable implementation, if each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is a true value, determining the weight calculation result corresponding to the soft clause set includes:

[0027] If each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is true, clause screening is performed on the soft clause set according to the soft clause variable set to obtain n soft clauses whose soft clause variables are true in the soft clause set;

[0028] Weight calculation is performed on the n soft clauses to obtain a weight calculation result corresponding to the soft clause set.

[0029] In an achievable implementation, the soft clause variable includes a soft clause true value or a soft clause false value, wherein the soft clause true value indicates that the undirected graph vertex corresponding to the soft clause will exist in the maximum graph cluster of the target knowledge graph, and the soft clause false value indicates that the undirected graph vertex corresponding to the soft clause will not exist in the maximum graph cluster of the target knowledge graph.

[0030] In an achievable implementation, the step of obtaining a target undirected graph corresponding to a target knowledge graph and a target complement graph corresponding to the target undirected graph includes:

[0031] Obtain the target undirected graph corresponding to the target knowledge graph;

[0032] Analyze the target undirected graph to obtain an undirected graph vertex set and an undirected graph edge set corresponding to the target undirected graph;

[0033] A target complement graph corresponding to the target undirected graph is obtained according to the undirected graph vertex set and the undirected graph edge set.

[0034] The second aspect of the present application provides a device for determining the maximum clique of a knowledge graph. The device for determining the maximum clique of a knowledge graph comprises:

[0035] An undirected graph complement acquisition unit, used for acquiring a target undirected graph corresponding to a target knowledge graph and a target complement graph corresponding to the target undirected graph, wherein the undirected graph vertex set corresponding to the target undirected graph is the same as the complement graph vertex set corresponding to the target complement graph, and the undirected graph edge set corresponding to the target undirected graph and the complement graph edge set corresponding to the target complement graph are in a complementary relationship;

[0036] An undirected graph complement coding unit, used for coding the undirected graph vertex set and the complement edge set to obtain a soft clause set corresponding to the undirected graph vertex set and a hard clause set corresponding to the complement edge set, wherein one undirected graph vertex corresponds to one soft clause, and one complement edge corresponds to one hard clause;

[0037] A determination strategy obtaining unit, used for solving the soft clause set and the hard clause set to obtain a maximum clique determination strategy corresponding to the target knowledge graph, wherein the maximum clique determination strategy is used to indicate that a maximum clique is determined according to n undirected graph vertices in the undirected graph vertex set, the sum of the weights of the n undirected graph vertices is the largest, and n is greater than or equal to 3;

[0038] The graph maximum cluster determination unit is used to determine the graph maximum cluster corresponding to the target knowledge graph according to the maximum cluster determination strategy.

[0039] In one feasible embodiment, the device further includes:

[0040] A vertex weight set acquisition unit, used to acquire a vertex weight set corresponding to the undirected graph vertex set, wherein one undirected graph vertex corresponds to one vertex weight;

[0041] The undirected graph complement coding unit is specifically used for:

[0042] Performing clause encoding on the vertex weight set and the undirected graph vertex set to obtain a soft clause set corresponding to the undirected graph vertex set, wherein one soft clause is obtained corresponding to one vertex weight and one undirected graph vertex;

[0043] Clause encoding is performed on the complement graph edge set to obtain a hard clause set corresponding to the complement graph edge set.

[0044] In one feasible embodiment, the device further includes:

[0045] Obtaining a MAXSAT solver, wherein the MAXSAT solver is used to perform a solving operation on the soft clause set and the hard clause set;

[0046] The determination strategy obtaining unit includes:

[0047] A solver solving unit is used to solve the soft clause set and the hard clause set through the MAXSAT solver to obtain the maximum clique determination strategy corresponding to the target knowledge graph.

[0048] In an achievable implementation, the solver solving unit includes:

[0049] A soft clause set assignment unit, configured to perform assignment processing on the soft clause set through the MAXSAT solver to obtain a soft clause variable set corresponding to the soft clause set, wherein one soft clause corresponds to one soft clause variable;

[0050] A solution result obtaining unit, used for performing clause solution on each hard clause according to the soft clause variable set by the MAXSAT solver to obtain a clause solution result corresponding to the hard clause;

[0051] A calculation result determination unit is used to determine, for a hard clause set, a weight calculation result corresponding to the soft clause set if each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is a true value, wherein the weight calculation result indicates that the sum of the weights of the undirected graph vertices corresponding to the n soft clauses in the soft clause set whose soft clause variables are true values ​​is the largest;

[0052] A determination strategy generation unit is used to generate a maximum clique determination strategy corresponding to the target knowledge graph based on the weight calculation result.

[0053] In an achievable implementation manner, the calculation result determination unit is specifically used to:

[0054] If each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is true, clause screening is performed on the soft clause set according to the soft clause variable set to obtain n soft clauses whose soft clause variables are true in the soft clause set;

[0055] Weight calculation is performed on the n soft clauses to obtain a weight calculation result corresponding to the soft clause set.

[0056] In an achievable implementation, the soft clause variable includes a soft clause true value or a soft clause false value, wherein the soft clause true value indicates that the undirected graph vertex corresponding to the soft clause will exist in the maximum graph cluster of the target knowledge graph, and the soft clause false value indicates that the undirected graph vertex corresponding to the soft clause will not exist in the maximum graph cluster of the target knowledge graph.

[0057] In an achievable implementation, the undirected graph complement acquisition unit is specifically used to:

[0058] Obtain the target undirected graph corresponding to the target knowledge graph;

[0059] Analyze the target undirected graph to obtain an undirected graph vertex set and an undirected graph edge set corresponding to the target undirected graph;

[0060] A target complement graph corresponding to the target undirected graph is obtained according to the undirected graph vertex set and the undirected graph edge set.

[0061] A third aspect of the present application provides a computer device. The computer device includes:

[0062] a memory having a computer program stored thereon;

[0063] A processor is used to execute the computer program in the memory to implement the steps of the method for determining the maximum clique of the knowledge graph provided in the first aspect.

[0064] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the method for determining the maximum clique of a knowledge graph provided in the first aspect are implemented.

[0065] Compared with the prior art, this application has the following beneficial effects:

[0066] In the present application, the target undirected graph corresponding to the target knowledge graph and the target complement graph corresponding to the target undirected graph can be first obtained, and then the undirected graph vertex set and the complement graph edge set can be encoded to obtain the soft clause set corresponding to the undirected graph vertex set and the hard clause set corresponding to the complement graph edge set, and the soft clause set and the hard clause set can be solved to obtain the maximum clique determination strategy corresponding to the target knowledge graph, and finally the maximum clique of the graph corresponding to the target knowledge graph can be determined according to the maximum clique determination strategy. It should be noted that the undirected graph vertex set corresponding to the target undirected graph is the same as the complement graph vertex set corresponding to the target complement graph, and the undirected graph edge set corresponding to the target undirected graph is in a complementary relationship with the complement graph edge set corresponding to the target complement graph. One undirected graph vertex corresponds to a soft clause, and one complement graph edge corresponds to a hard clause. The maximum clique determination strategy is used to indicate that the maximum clique is determined according to n undirected graph vertices in the undirected graph vertex set, and the sum of the weights of the n undirected graph vertices is the largest, and n is greater than or equal to 3.

[0067] It can be seen that in the present application, the soft clause set corresponding to the undirected graph vertex set in the target undirected graph corresponding to the target knowledge graph can be obtained, and the hard clause set corresponding to the complement graph edge set in the target complement graph corresponding to the target undirected graph can be obtained, so that the soft clause set and the hard clause set can be solved to obtain the maximum clique determination strategy, and the maximum clique of the target knowledge graph can be determined based on the maximum clique determination strategy. In this way, the maximum clique of the target knowledge graph can be quickly determined by solving the soft clause set and the hard clause set in the present application, thereby improving the efficiency of determining the maximum clique of the knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0069] Figure 1 A schematic diagram of a knowledge graph provided in the related art;

[0070] Figure 2 A schematic diagram of determining the maximum cluster provided in the related art;

[0071] Figure 3 A flowchart of a method for determining the maximum clique of a knowledge graph provided in an embodiment of the present application;

[0072] Figure 4 A schematic diagram of determining a target complement graph in a method for determining a maximum clique of a knowledge graph provided in an embodiment of the present application;

[0073] Figure 5 A flow chart for obtaining a determination strategy in a method for determining a maximum clique of a knowledge graph provided in an embodiment of the present application;

[0074] Figure 6 A full flow chart of determining the maximum clique in a method for determining the maximum clique of a knowledge graph provided in an embodiment of the present application;

[0075] Figure 7 A schematic diagram of the structure of a device for determining the maximum clique of a knowledge graph provided in an embodiment of the present application. DETAILED DESCRIPTION

[0076] As described above, with the continuous growth of data volume and the continuous changes in business needs, more and more companies usually achieve data integration and rapid query by building and applying knowledge graphs, and can also integrate knowledge graphs in different fields to form a more complete large-scale knowledge graph. The largest group in the knowledge graph can indicate valuable information in the knowledge graph, so that enterprise personnel can improve decision-making efficiency and business competitiveness based on the largest group.

[0077] Based on this, in related technologies, the determination of the maximum cluster of the knowledge graph is mainly based on the maximum depth search method, such as Figure 1 As shown, Figure 1 This is a schematic diagram of the knowledge graph provided in the related art. It can be understood that Figure 1 The knowledge graph shown can be composed of node 1, node 2, node 3, node 4 and node 5. At this time, it is necessary to determine the largest group of the knowledge graph from node 1, node 2, node 3, node 4 and node 5.

[0078] Specifically, in the related technology, the largest cluster can be set as an empty cluster first, and then nodes of the knowledge graph are added to the empty cluster one by one to determine whether the added nodes can form a cluster, and this cycle is repeated until all nodes of the knowledge graph are traversed. Figure 2 As shown, Figure 2 A schematic diagram of determining the maximum group provided in the related art. Figure 2 The process of determining the maximum clique is shown in the form of a backtracking space tree, where light circles indicate joining the current clique, dark circles indicate not joining the current clique, and slash circles indicate that the node pointed to by the current traversal path cannot support the formation of a clique, and the node pointed to by the current traversal path is discarded. In this way, a clique based on node 1, node 2 and node 5, a clique based on node 1, node 4 and node 5, and a clique based on node 2, node 3 and node 5 can be obtained.

[0079] As the scale of the knowledge graph expands, the number of nodes and edges in the knowledge graph will also increase dramatically, which may lead to long running time and huge search space for nodes, which may lead to low efficiency in determining the maximum group of the knowledge graph. Therefore, how to improve the efficiency of determining the maximum group of the knowledge graph is a key issue of concern to those skilled in the art. In addition, since the nodes in the knowledge graph often have different weights, it may be difficult to determine the maximum group of the knowledge graph based on the relevant technical solutions.

[0080] In view of the above problems, a solution is provided in the embodiments of the present application, and a method, device and related products for determining the maximum clique of a knowledge graph are proposed, aiming to improve the efficiency of determining the maximum clique of a knowledge graph. In the technical solution of the present application, the target undirected graph corresponding to the target knowledge graph and the target complement graph corresponding to the target undirected graph can be first obtained, after which the undirected graph vertex set and the complement graph edge set can be encoded to obtain the soft clause set corresponding to the undirected graph vertex set and the hard clause set corresponding to the complement graph edge set, and the soft clause set and the hard clause set can be solved to obtain the maximum clique determination strategy corresponding to the target knowledge graph, and finally, the maximum clique of the graph corresponding to the target knowledge graph can be determined according to the maximum clique determination strategy.

[0081] It should be noted that the undirected graph vertex set corresponding to the target undirected graph is the same as the complement graph vertex set corresponding to the target complement graph, the undirected graph edge set corresponding to the target undirected graph is complementary to the complement graph edge set corresponding to the target complement graph, one undirected graph vertex corresponds to a soft clause, and one complement graph edge corresponds to a hard clause. The maximum clique determination strategy is used to indicate that the maximum clique is determined based on the n undirected graph vertices in the undirected graph vertex set, the sum of the weights of the n undirected graph vertices is the largest, and n is greater than or equal to 3.

[0082] It can be seen that in the present application, the soft clause set corresponding to the undirected graph vertex set in the target undirected graph corresponding to the target knowledge graph can be obtained, and the hard clause set corresponding to the complement graph edge set in the target complement graph corresponding to the target undirected graph can be obtained, so that the soft clause set and the hard clause set can be solved to obtain the maximum clique determination strategy, and the maximum clique of the target knowledge graph can be determined based on the maximum clique determination strategy. In this way, the maximum clique of the target knowledge graph can be quickly determined by solving the soft clause set and the hard clause set in the present application, so as to avoid the problems of long running time and huge search space of nodes in the related technical solutions, thereby improving the efficiency of determining the maximum clique of the knowledge graph.

[0083] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0084] Next, the technical terms that may appear in this application are explained.

[0085] Clique: refers to a subset of vertices in a graph where any two vertices in the subset are connected by an edge.

[0086] Maximum clique: refers to the largest subset of vertices in the graph, that is, the clique containing the largest number of vertices.

[0087] MAXSAT: MAXSAT is the maximum Boolean satisfaction problem, which is an NP-hard combinatorial optimization problem.

[0088] See also Figure 3 , which is a flowchart of a method for determining the maximum clique of a knowledge graph provided in an embodiment of the present application.

[0089] like Figure 3 The method for determining the maximum clique of the knowledge graph shown includes:

[0090] S301: Obtain a target undirected graph corresponding to a target knowledge graph and a target complementary graph corresponding to the target undirected graph.

[0091] In this step, first, a target knowledge graph can be obtained. The target knowledge graph can be a knowledge graph in one field, or a knowledge graph obtained by merging knowledge subgraphs in multiple fields. For example, knowledge subgraph a in field A and knowledge subgraph b in field B can be merged to obtain the target knowledge graph. The target knowledge graph is not specifically limited in this application, and the target knowledge graph can also be selected in actual applications to perform the subsequent maximum clique determination process of the knowledge graph.

[0092] Specifically, in the present application, the target knowledge graph can first be converted into a graph to obtain a target undirected graph corresponding to the target knowledge graph, which can characterize the relationship between each node in the target knowledge graph, and the target undirected graph can also be better used to determine the complementary graph. After that, the target undirected graph can be parsed to obtain an undirected graph vertex set corresponding to the target undirected graph and an undirected graph edge set corresponding to the target undirected graph, the undirected graph vertex set includes all vertices in the target undirected graph, and the undirected graph edge set includes all edges in the target undirected graph.

[0093] Finally, in the present application, the undirected graph vertex set and the undirected graph edge set can be calculated and processed to obtain the target complement graph corresponding to the target undirected graph. It should be noted that the undirected graph vertex set corresponding to the target undirected graph is the same as the complement graph vertex set corresponding to the target complement graph, that is, all vertices in the undirected graph vertex set are the same as all vertices in the complement graph vertex set; the undirected graph edge set corresponding to the target undirected graph is in a complementary relationship with the complement graph edge set corresponding to the target complement graph, that is, all edges in the undirected graph edge set are different from all edges in the complement graph edge set.

[0094] It can be understood that, based on the target undirected graph, the remaining edge set after removing the undirected graph edge set in the target undirected graph can be used as the complement edge set of the target complement graph. It can be further understood that for an undirected graph with k vertices, the undirected graph has k*(k-1) / 2 edges, and the number of complement edges of the complement graph corresponding to the undirected graph is k*(k-1) / 2 minus the number of undirected graph edges corresponding to the undirected graph, where k is greater than or equal to 3.

[0095] like Figure 4 As shown, Figure 4 A schematic diagram of determining a target complement graph in a method for determining a maximum clique of a knowledge graph provided in an embodiment of the present application, wherein Figure 4 The process of determining the target complement graph corresponding to the target knowledge graph according to the target undirected graph corresponding to the target knowledge graph is shown in FIG. Figure 4 The target undirected graph and target complement graph shown in are only some examples and are not specifically limited in this application. In practical applications, the target undirected graph and target complement graph can change with the change of the target knowledge graph.

[0096] exist Figure 4 In the target undirected graph, there are undirected graph vertex 1, undirected graph vertex 2, undirected graph vertex 3, undirected graph vertex 4 and undirected graph vertex 5. There is an undirected graph edge formed by undirected graph vertex 1 and undirected graph vertex 2, there is an undirected graph edge formed by undirected graph vertex 2 and undirected graph vertex 3, there is an undirected graph edge formed by undirected graph vertex 3 and undirected graph vertex 5, there is an undirected graph edge formed by undirected graph vertex 5 and undirected graph vertex 4, there is an undirected graph edge formed by undirected graph vertex 4 and undirected graph vertex 1, there is an undirected graph edge formed by undirected graph vertex 1 and undirected graph vertex 5, and there is an undirected graph edge formed by undirected graph vertex 2 and undirected graph vertex 5.

[0097] exist Figure 4 In the target complement graph, there are complement vertex 1, complement vertex 2, complement vertex 3, complement vertex 4 and complement vertex 5, there is a complement edge formed by complement vertex 1 and complement vertex 3, there is a complement edge formed by complement vertex 2 and complement vertex 4, and there is a complement edge formed by complement vertex 3 and complement vertex 4. It can be understood that if vertex u and vertex v are connected by an edge in the undirected graph, then there is no edge connecting these two vertices in the complement graph. In this way, it is convenient to perform encoding operations on the undirected graph vertex set and the complement edge set in the future to determine the maximum group of the knowledge graph.

[0098] S302: Encoding the undirected graph vertex set and the complement graph edge set to obtain a soft clause set corresponding to the undirected graph vertex set and a hard clause set corresponding to the complement graph edge set.

[0099] It should be noted that before executing step S302, the present application can also obtain a vertex weight set corresponding to an undirected graph vertex set, where one undirected graph vertex corresponds to a vertex weight, the vertex weight can be a positive value, and the vertex weight can also be a negative value. It should also be noted that each vertex weight in the vertex weight set can be different (when each vertex weight in the vertex weight set is a positive value, each vertex weight is different; or when each vertex weight in the vertex weight set is a negative value, each vertex weight is different), and each vertex weight in the vertex weight set can also be the same.

[0100] It is understandable that for a social knowledge graph, the undirected graph vertices in the undirected graph corresponding to the knowledge graph can be used to represent enterprise personnel, and the undirected graph edges in the undirected graph corresponding to the knowledge graph can be used to represent the relationship between enterprise personnel. At this time, due to the different importance of enterprise personnel, the vertex weights corresponding to the enterprise personnel are also different. It is also understandable that if the importance of enterprise personnel is the same, the vertex weights corresponding to the enterprise personnel are also the same.

[0101] In some examples, the vertex weight corresponding to undirected graph vertex 1 may be 1, the vertex weight corresponding to undirected graph vertex 2 may be 2, the vertex weight corresponding to undirected graph vertex 3 may be 3, the vertex weight corresponding to undirected graph vertex 4 may be 4, and the vertex weight corresponding to undirected graph vertex 5 may be 5. It should be noted that the vertex weights shown in this application are only some examples, and in actual applications, they may also be based on the acquired vertex weights.

[0102] Specifically, in the present application, clause encoding can be performed on the vertex weight set and the undirected graph vertex set to obtain a soft clause set corresponding to the undirected graph vertex set, wherein a soft clause can be correspondingly encoded according to a vertex weight in the vertex weight set and an undirected graph vertex in the undirected graph vertex set. For example: for undirected graph vertex 1, undirected graph vertex 2, undirected graph vertex 3, undirected graph vertex 4 and undirected graph vertex 5, the soft clause corresponding to the undirected graph vertex 1 can be embodied as S1=1*X1, the soft clause corresponding to the undirected graph vertex 2 can be embodied as S2=2*X2, the soft clause corresponding to the undirected graph vertex 3 can be embodied as S3=3*X3, the soft clause corresponding to the undirected graph vertex 4 can be embodied as S4=4*X4, and the soft clause corresponding to the undirected graph vertex 5 can be embodied as S5=5*X5. In this way, each soft clause carries the vertex weight of the undirected graph vertex, which facilitates the subsequent calculation of the weight.

[0103] And in the present application, the complement graph edge set can be clause-encoded to obtain the hard clause set corresponding to the complement graph edge set, and one complement graph edge corresponding to the encoding obtains a hard clause. For example: for the complement graph edge formed by complement graph vertex 1 and complement graph vertex 3 existing in the target complement graph, the complement graph edge formed by complement graph vertex 2 and complement graph vertex 4 existing, and the complement graph edge formed by complement graph vertex 3 and complement graph vertex 4 existing, these complement graph edges constitute the complement graph edge set of the target complement graph. At this time, the hard clause of the complement graph edge formed by complement graph vertex 1 and complement graph vertex 3 can be expressed as The hard clause of the complement edge formed by complement vertex 2 and complement vertex 4 can be expressed as The hard clause of the complement edge formed by complement vertex 3 and complement vertex 4 can be expressed as

[0104] It can be understood that in this application, the complement graph edge set in the target complement graph of the target undirected graph corresponding to the knowledge graph is encoded to obtain the hard sub-clause set corresponding to the complement graph edge set, the purpose of which is to ensure that the vertices of the final maximum cluster of the graph are interconnected, so as to ensure the accuracy of the determination of the maximum cluster of the graph to a certain extent. And in this application, the undirected graph vertex set and the complement graph edge set are encoded into a soft sub-clause set and a hard sub-clause set, which is actually to encode them into a problem that can be solved by the MAXSAT solver, so as to facilitate the subsequent rapid solution of the soft sub-clause set and the hard sub-clause set.

[0105] S303: Solve the soft clause set and the hard clause set to obtain the maximum clique determination strategy corresponding to the target knowledge graph.

[0106] It should be noted that before executing step S303, the present application can also obtain a MAXSAT solver, where the MAXSAT solver is used to perform solving operations on the soft clause set and the hard clause set, that is, in the present application, the optimal strategy can be solved based on the MAXSAT solver (that is, it can ensure that each hard clause in the hard clause set is true while maximizing / minimizing the sum of the weights of the soft clauses).

[0107] Specifically, in the present application, the soft clause set and the hard clause set can be solved by the MAXSAT solver to obtain the maximum clique determination strategy corresponding to the target knowledge graph, wherein the maximum clique determination strategy is used to indicate that the maximum clique is determined according to the n undirected graph vertices in the undirected graph vertex set, the sum of the weights of the n undirected graph vertices is the largest, and n is greater than or equal to 3. In this way, in the present application, based on the solving operation of the soft clause set and the hard clause set, a strategy that satisfies the conditions for determining the maximum clique can be solved, thereby improving the efficiency of determining the maximum clique to a certain extent.

[0108] like Figure 5 As shown, Figure 5A flowchart of obtaining a strategy for determining a maximum clique in a knowledge graph provided in an embodiment of the present application, Figure 5 The method includes steps S3031 to S3034, and the steps S3031 to S3034 are specifically embodied as follows:

[0109] S3031: Performing assignment processing on the soft clause set through the MAXSAT solver to obtain a soft clause variable set corresponding to the soft clause set.

[0110] In this step, a soft clause in the soft clause set can be assigned a soft clause variable in the soft clause variable set. It should be noted that in order to facilitate the subsequent solution of the hard clause set, in this application, only the soft clauses corresponding to the vertices of the undirected graph are actually assigned (at this time, only the soft clauses are assigned, that is, the vertex weights they carry are not assigned, and the vertex weights are used for weight calculation in the subsequent process).

[0111] It should also be noted that the soft clause variable includes a soft clause truth value (i.e., 1), which indicates that the undirected graph vertex corresponding to the soft clause will exist in the maximum graph cluster of the target knowledge graph. It is understandable that in the subsequently determined maximum graph cluster, there will be an undirected graph vertex corresponding to the soft clause truth value of the soft clause variable; the soft clause variable also includes a soft clause truth value (i.e., 0), which indicates that the undirected graph vertex corresponding to the soft clause does not exist in the maximum graph cluster of the target knowledge graph. It is understandable that in the subsequently determined maximum graph cluster, there will not be an undirected graph vertex corresponding to the soft clause false value of the soft clause variable. In this way, in this application, each soft clause is assigned a clause value, and the soft clause variable corresponding to each soft clause is obtained, so that it is convenient for the subsequent solution of the hard clause set.

[0112] In some examples, X1 in the soft clause S1=1*X1 can be assigned a value to obtain the soft clause variable true (i.e., X1 is assigned to true), X2 in the soft clause S2=2*X2 can be assigned a value to obtain the soft clause variable false (i.e., X2 is assigned to false), X3 in the soft clause S3=3*X3 can be assigned a value to obtain the soft clause variable false (i.e., X3 is assigned to false), X4 in the soft clause S4=4*X4 can be assigned a value to obtain the soft clause variable true (i.e., X4 is assigned to true), and X5 in the soft clause S5=5*X5 can be assigned a value to obtain the soft clause variable true (i.e., X5 is assigned to true).

[0113] In other examples, X1 in the soft clause S1=1*X1 can be assigned a value to obtain a soft clause variable false (i.e., X1 is assigned to false), X2 in the soft clause S2=2*X2 can be assigned a value to obtain a soft clause variable true (i.e., X2 is assigned to true), X3 in the soft clause S3=3*X3 can be assigned a value to obtain a soft clause variable true (i.e., X3 is assigned to true), X4 in the soft clause S4=4*X4 can be assigned a value to obtain a soft clause variable false (i.e., X4 is assigned to false), and X5 in the soft clause S5=5*X5 can be assigned a value to obtain a soft clause variable true (i.e., X5 is assigned to true).

[0114] S3032: For each hard clause, the MAXSAT solver performs clause solving on the hard clause according to the soft clause variable set to obtain a clause solving result corresponding to the hard clause.

[0115] It should be noted that the premise for this application to generate the maximum clique determination strategy is that each hard clause in the hard clause set is true, and the sum of the weights of the corresponding soft clauses when the soft clause variables in the soft clause variable set are true is the largest. It can be understood that during the solving process, the MAXSAT solver needs to make the soft clause variable set obtained after assigning values ​​to the soft clause set meet the requirement that each hard clause in the hard clause set is true, and in the case of meeting the requirement that each hard clause in the hard clause set is true, it is also necessary to make the sum of the weights of the corresponding soft clauses when the soft clause variables in the soft clause variable set are true be the largest, so that the maximum clique determination strategy can be generated.

[0116] At this time, each hard clause in the hard clause can be solved one by one based on the soft clause variable set to obtain the clause solution result corresponding to each hard clause, and the clause solution result can indicate that the hard clause corresponding to the clause solution result is a true value, and the clause solution result can also indicate that the hard clause corresponding to the clause solution result is a false value. In some examples, the quasi-hard clause is H1=!X1or!X3, X1 is assigned to true, and X3 is assigned to false. At this time, the clause solution result corresponding to the hard clause can indicate that the hard clause corresponding to the clause solution result is a true value.

[0117] S3033: For the hard clause set, if each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is a true value, determine the weight calculation result corresponding to the soft clause set.

[0118] In this step, for a hard clause set, a clause solution result set corresponding to the hard clause set can be obtained, and one clause solution result is obtained corresponding to one hard clause. At this time, it can be judged whether each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is a true value. If each clause solution result in the clause solution result set does not indicate that the hard clause corresponding to the clause solution result is a true value, the above clause solution process is repeated. If the number of repetitions is greater than the preset number of times and each clause solution result in the clause solution result set does not indicate that the hard clause corresponding to the clause solution result is a true value, the subsequent process is not executed.

[0119] If each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is true, then the soft clause set can be clause screened according to the soft clause variable set to obtain n soft clauses whose soft clause variables are true in the soft clause set. At this time, the n soft clauses can be weighted to obtain the weight calculation result corresponding to the soft clause set, wherein the weight calculation result indicates that the sum of the weights of the undirected graph vertices corresponding to the n soft clauses whose soft clause variables are true in the soft clause set is the largest. It can be understood that when the hard clause set is all true, the maximum weight of the soft clause (i.e., the undirected graph vertex) can be directly determined based on the soft clause variable set, thereby improving the efficiency of determining the maximum group of the knowledge graph.

[0120] S3034: Generate a maximum clique determination strategy corresponding to the target knowledge graph based on the weight calculation result.

[0121] Since the weight calculation result can indicate that the sum of the weights of the undirected graph vertices corresponding to the n soft clauses in the soft clause set is the largest, and based on the weight calculation result, it can be determined that the hard clause set is true, then the maximum clique determination strategy corresponding to the target knowledge graph can be generated. The maximum clique determination strategy can indicate the determination of the graph maximum clique corresponding to the target knowledge graph based on the undirected graph vertices corresponding to the n soft clauses, wherein the n undirected graph vertices in the undirected graph vertex set can be determined based on the undirected graph vertices corresponding to the n soft clauses. It should be noted that the positions corresponding to the n soft clauses can be marked in the maximum clique determination strategy to facilitate the subsequent rapid finding of the n soft clauses.

[0122] S304: Determine the maximum cluster of the graph corresponding to the target knowledge graph according to the maximum cluster determination strategy.

[0123] In this step, the maximum cluster determination strategy can indicate that the maximum cluster is determined based on n undirected graph vertices in the undirected graph vertex set. At this time, the n undirected graph vertices can be connected to determine the maximum cluster of the graph corresponding to the target knowledge graph.

[0124] like Figure 6 As shown, Figure 6 A full flow chart of determining the maximum clique in a method for determining the maximum clique of a knowledge graph provided in an embodiment of the present application, Figure 6 First, the target undirected graph corresponding to the target knowledge graph can be obtained, and the target complement graph corresponding to the target undirected graph can be obtained based on the target undirected graph; after that, the undirected graph vertex set in the target undirected graph and the complement graph edge set in the target complement graph can be encoded to obtain the soft clause set corresponding to the undirected graph vertex set and the hard clause set corresponding to the complement graph edge set, and the soft clause set and the hard clause set can be solved to obtain the maximum group determination strategy corresponding to the target knowledge graph; finally, the maximum group of the graph corresponding to the target knowledge graph can be generated based on the maximum group determination strategy. The maximum group of the graph can be generated by vertex 1, vertex 4 and vertex 5 in the undirected graph vertex set, or the maximum group of the graph can be generated by vertex 2, vertex 3 and vertex 5 in the undirected graph vertex set. In this way, in this application, the maximum group of the target knowledge graph can be quickly determined by solving the soft clause set and the hard clause set.

[0125] In summary, in this embodiment, by solving the soft clause set and the hard clause set, the maximum group of the target knowledge graph can be quickly determined, thereby avoiding the problems of long running time and huge node search space in the related technical solutions, thereby improving the efficiency of determining the maximum group of the knowledge graph. And in this application, the weight of the vertex in the knowledge graph can be used to solve, so that the maximum group of the target knowledge graph can be well determined.

[0126] In addition, the larger the node scale of the knowledge graph in the related technical scheme, the higher the time complexity of finding the maximum cluster based on the maximum depth search method, while the time complexity of obtaining the target complement graph in the present application is O(q^2), where q represents the number of complement vertices of the target complement graph, so the technical scheme of the present application can significantly reduce the time complexity, and the space complexity of obtaining the target complement graph in the present application is O(V+E), where V represents the number of complement vertices of the target complement graph, and E represents the number of complement edges of the target complement graph, so the technical scheme of the present application can significantly reduce the space complexity.

[0127] And the application of the technical solution of this application in the social knowledge graph can enable enterprises to extract valuable information from complex social network knowledge graphs more quickly, thereby improving enterprise decision-making efficiency and business competitiveness. Enterprises and researchers can better understand and utilize the structural characteristics in social networks and make more informed decisions in information dissemination, marketing, and public relations management.

[0128] Based on the method for determining the maximum clique of a knowledge graph provided in the aforementioned embodiment, the present application also provides a device for determining the maximum clique of a knowledge graph accordingly. Figure 7A schematic diagram of the structure of a device for determining the maximum clique of a knowledge graph provided in an embodiment of the present application. Figure 7 As shown, the maximum group determination device of the knowledge graph includes:

[0129] An undirected graph complement acquisition unit 701 is used to acquire a target undirected graph corresponding to a target knowledge graph and a target complement graph corresponding to the target undirected graph, wherein the undirected graph vertex set corresponding to the target undirected graph is the same as the complement graph vertex set corresponding to the target complement graph, and the undirected graph edge set corresponding to the target undirected graph and the complement graph edge set corresponding to the target complement graph are in a complementary relationship;

[0130] An undirected graph complement coding unit 702 is used to encode the undirected graph vertex set and the complement edge set to obtain a soft clause set corresponding to the undirected graph vertex set and a hard clause set corresponding to the complement edge set, wherein one undirected graph vertex corresponds to one soft clause, and one complement edge corresponds to one hard clause;

[0131] A determination strategy obtaining unit 703 is used to solve the soft clause set and the hard clause set to obtain a maximum clique determination strategy corresponding to the target knowledge graph, wherein the maximum clique determination strategy is used to indicate that a maximum clique is determined according to n undirected graph vertices in the undirected graph vertex set, the sum of the weights of the n undirected graph vertices is the largest, and n is greater than or equal to 3;

[0132] The graph maximum cluster determination unit 704 is used to determine the graph maximum cluster corresponding to the target knowledge graph according to the maximum cluster determination strategy.

[0133] In one feasible embodiment, the device further includes:

[0134] A vertex weight set acquisition unit, used to acquire a vertex weight set corresponding to the undirected graph vertex set, wherein one undirected graph vertex corresponds to one vertex weight;

[0135] The undirected graph complement coding unit 702 is specifically used for:

[0136] Performing clause encoding on the vertex weight set and the undirected graph vertex set to obtain a soft clause set corresponding to the undirected graph vertex set, wherein one soft clause is obtained corresponding to one vertex weight and one undirected graph vertex;

[0137] Clause encoding is performed on the complement graph edge set to obtain a hard clause set corresponding to the complement graph edge set.

[0138] In one feasible embodiment, the device further includes:

[0139] Obtaining a MAXSAT solver, wherein the MAXSAT solver is used to perform a solving operation on the soft clause set and the hard clause set;

[0140] The determination strategy obtaining unit 703 includes:

[0141] A solver solving unit is used to solve the soft clause set and the hard clause set through the MAXSAT solver to obtain the maximum clique determination strategy corresponding to the target knowledge graph.

[0142] In an achievable implementation, the solver solving unit includes:

[0143] A soft clause set assignment unit, configured to perform assignment processing on the soft clause set through the MAXSAT solver to obtain a soft clause variable set corresponding to the soft clause set, wherein one soft clause corresponds to one soft clause variable;

[0144] A solution result obtaining unit, used for performing clause solution on each hard clause according to the soft clause variable set by the MAXSAT solver to obtain a clause solution result corresponding to the hard clause;

[0145] A calculation result determination unit is used to determine, for a hard clause set, a weight calculation result corresponding to the soft clause set if each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is a true value, wherein the weight calculation result indicates that the sum of the weights of the undirected graph vertices corresponding to the n soft clauses in the soft clause set whose soft clause variables are true values ​​is the largest;

[0146] A determination strategy generation unit is used to generate a maximum clique determination strategy corresponding to the target knowledge graph based on the weight calculation result.

[0147] In an achievable implementation manner, the calculation result determination unit is specifically used to:

[0148] If each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is true, clause screening is performed on the soft clause set according to the soft clause variable set to obtain n soft clauses whose soft clause variables are true in the soft clause set;

[0149] Weight calculation is performed on the n soft clauses to obtain a weight calculation result corresponding to the soft clause set.

[0150] In an achievable implementation, the soft clause variable includes a soft clause true value or a soft clause false value, wherein the soft clause true value indicates that the undirected graph vertex corresponding to the soft clause will exist in the maximum graph cluster of the target knowledge graph, and the soft clause false value indicates that the undirected graph vertex corresponding to the soft clause will not exist in the maximum graph cluster of the target knowledge graph.

[0151] In an achievable implementation, the undirected graph complement acquiring unit 701 is specifically used for:

[0152] Obtain the target undirected graph corresponding to the target knowledge graph;

[0153] Analyze the target undirected graph to obtain an undirected graph vertex set and an undirected graph edge set corresponding to the target undirected graph;

[0154] A target complement graph corresponding to the target undirected graph is obtained according to the undirected graph vertex set and the undirected graph edge set.

[0155] The device for determining the maximum clique of a knowledge graph provided in the embodiment of the present application has the same beneficial effects as the method for determining the maximum clique of a knowledge graph provided in the above-mentioned embodiment, and can improve the efficiency of determining the maximum clique of a knowledge graph, which will not be repeated here.

[0156] The present application also provides a computer device. The computer device includes:

[0157] A memory having a computer program stored therein.

[0158] A processor is used to execute a computer program in a memory to implement some or all of the steps in the method for determining the maximum clique of a knowledge graph introduced in the aforementioned embodiment.

[0159] The present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, some or all of the steps in the method for determining the maximum clique of a knowledge graph described in the above embodiment are implemented.

[0160] It should be noted that the "first" and "second" (if any) in the names such as "first" and "second" mentioned in the embodiments of the present application are only used as name identifiers and do not represent the first or second in order.

[0161] It should also be noted that the various embodiments in this specification are described in a progressive manner, and the same and similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and equipment embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments. The device and equipment embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components indicated as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0162] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A method for determining the maximum clique of a knowledge graph, characterized in that: include: Obtain a target undirected graph corresponding to a target knowledge graph and a target complement graph corresponding to the target undirected graph, wherein the undirected graph vertex set corresponding to the target undirected graph is the same as the complement graph vertex set corresponding to the target complement graph, and the undirected graph edge set corresponding to the target undirected graph and the complement graph edge set corresponding to the target complement graph are in a complementary relationship; Encoding the undirected graph vertex set and the complement graph edge set to obtain a soft clause set corresponding to the undirected graph vertex set and a hard clause set corresponding to the complement graph edge set, wherein one undirected graph vertex corresponds to one soft clause, and one complement graph edge corresponds to one hard clause; Solving the soft clause set and the hard clause set to obtain a maximum clique determination strategy corresponding to the target knowledge graph, wherein the maximum clique determination strategy is used to indicate that a maximum clique is determined according to n undirected graph vertices in the undirected graph vertex set, the sum of the weights of the n undirected graph vertices is the largest, and n is greater than or equal to 3; According to the maximum cluster determination strategy, the maximum cluster of the graph corresponding to the target knowledge graph is determined.

2. The method according to claim 1, characterized in that Before encoding the undirected graph vertex set and the complement graph edge set to obtain a soft clause set corresponding to the undirected graph vertex set and a hard clause set corresponding to the complement graph edge set, the method further includes: Obtain a vertex weight set corresponding to the undirected graph vertex set, wherein one undirected graph vertex corresponds to one vertex weight; The encoding process of the undirected graph vertex set and the complement graph edge set to obtain a soft clause set corresponding to the undirected graph vertex set and a hard clause set corresponding to the complement graph edge set includes: Performing clause encoding on the vertex weight set and the undirected graph vertex set to obtain a soft clause set corresponding to the undirected graph vertex set, wherein one soft clause is obtained corresponding to one vertex weight and one undirected graph vertex; Clause encoding is performed on the complement graph edge set to obtain a hard clause set corresponding to the complement graph edge set.

3. The method according to claim 2, characterized in that Before solving the soft clause set and the hard clause set to obtain the maximum clique determination strategy corresponding to the target knowledge graph, the method further includes: Obtaining a MAXSAT solver, wherein the MAXSAT solver is used to perform a solving operation on the soft clause set and the hard clause set; The solving process of the soft clause set and the hard clause set to obtain the maximum clique determination strategy corresponding to the target knowledge graph includes: The soft clause set and the hard clause set are solved by the MAXSAT solver to obtain the maximum clique determination strategy corresponding to the target knowledge graph.

4. The method according to claim 3, characterized in that: The step of solving the soft clause set and the hard clause set by the MAXSAT solver to obtain the maximum clique determination strategy corresponding to the target knowledge graph includes: Performing assignment processing on the soft clause set by the MAXSAT solver to obtain a soft clause variable set corresponding to the soft clause set, wherein one soft clause corresponds to one soft clause variable; For each hard clause, performing clause solving on the hard clause according to the soft clause variable set by the MAXSAT solver to obtain a clause solving result corresponding to the hard clause; For the hard clause set, if each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is a true value, determine the weight calculation result corresponding to the soft clause set, wherein the weight calculation result indicates that the sum of the weights of the undirected graph vertices corresponding to the n soft clauses whose soft clause variables in the soft clause set are true values ​​is the largest; According to the weight calculation result, a maximum clique determination strategy corresponding to the target knowledge graph is generated.

5. The method according to claim 4, characterized in that If each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is a true value, determining the weight calculation result corresponding to the soft clause set includes: If each clause solution result in the clause solution result set indicates that the hard clause corresponding to the clause solution result is true, clause screening is performed on the soft clause set according to the soft clause variable set to obtain n soft clauses whose soft clause variables are true in the soft clause set; Weight calculation is performed on the n soft clauses to obtain a weight calculation result corresponding to the soft clause set.

6. The method according to claim 4, characterized in that The soft clause variable includes a soft clause true value or a soft clause false value, wherein the soft clause true value indicates that the undirected graph vertex corresponding to the soft clause will exist in the maximum graph cluster of the target knowledge graph, and the soft clause false value indicates that the undirected graph vertex corresponding to the soft clause will not exist in the maximum graph cluster of the target knowledge graph.

7. The method according to claim 1, characterized in that The step of obtaining a target undirected graph corresponding to a target knowledge graph and a target complement graph corresponding to the target undirected graph includes: Obtain the target undirected graph corresponding to the target knowledge graph; Analyze the target undirected graph to obtain an undirected graph vertex set and an undirected graph edge set corresponding to the target undirected graph; A target complement graph corresponding to the target undirected graph is obtained according to the undirected graph vertex set and the undirected graph edge set.

8. A device for determining the maximum clique of a knowledge graph, characterized in that: include: An undirected graph complement acquisition unit, used for acquiring a target undirected graph corresponding to a target knowledge graph and a target complement graph corresponding to the target undirected graph, wherein the undirected graph vertex set corresponding to the target undirected graph is the same as the complement graph vertex set corresponding to the target complement graph, and the undirected graph edge set corresponding to the target undirected graph and the complement graph edge set corresponding to the target complement graph are in a complementary relationship; An undirected graph complement coding unit, used for coding the undirected graph vertex set and the complement edge set to obtain a soft clause set corresponding to the undirected graph vertex set and a hard clause set corresponding to the complement edge set, wherein one undirected graph vertex corresponds to one soft clause, and one complement edge corresponds to one hard clause; A determination strategy obtaining unit, used for solving the soft clause set and the hard clause set to obtain a maximum clique determination strategy corresponding to the target knowledge graph, wherein the maximum clique determination strategy is used to indicate that a maximum clique is determined according to n undirected graph vertices in the undirected graph vertex set, the sum of the weights of the n undirected graph vertices is the largest, and n is greater than or equal to 3; The graph maximum cluster determination unit is used to determine the graph maximum cluster corresponding to the target knowledge graph according to the maximum cluster determination strategy.

9. A computer device, characterized in that: include: a memory having a computer program stored thereon; A processor, used to execute the computer program in the memory to implement the steps of the method for determining the maximum clique of the knowledge graph described in claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method for determining the maximum clique of the knowledge graph described in claims 1-7 are implemented.

Citation Information

Cited By

  • Mine structure stability evaluation method based on knowledge graph

    CN121072717A