A method and device for determining an estimated weight matrix of an undirected graph

By cyclically computeing and updating the original weight matrix and grouping information, the problem of inaccurate weight matrix of undirected graph is solved, and the accuracy of undirected graph correlation calculation is improved.

CN113849698BActive Publication Date: 2024-11-08ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202111082304.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-15
Publication Date
2024-11-08
Estimated Expiration
2041-09-15

AI Technical Summary

Technical Problem

In practical applications, due to missing data and dirty data, the constructed undirected graph and its weight matrix are inaccurate, resulting in inaccurate calculation results.

Method used

By obtaining the original weight matrix and grouping information, cyclically calculate and update until the end of the loop is met, the estimated weight matrix close to the real and correct weight matrix is ​​gradually estimated, making the correlation calculation based on the weight matrix more accurate.

Benefits of technology

Based on the relationship between the weight matrix and the grouping information, an estimated weight matrix that is close to the true and correct weight matrix is ​​gradually estimated, which improves the accuracy of undirected graph correlation calculations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113849698B_ABST
    Figure CN113849698B_ABST
Patent Text Reader

Abstract

Provide a method for determining the estimated weight matrix of an undirected graph: Get the original weight matrix W 0 As well as the original grouping information, the current weight matrix W x And the current group information is initialized to W 0 And the original grouping information. Loop through the following steps until the loop end condition is met: x And the current group information, calculate the current total network information #imgabs0# where Q ij is the difference between vertex i and vertex j, which is negatively correlated with the probability that vertex i and vertex j belong to the same group; judge whether the loop end condition is met, if it is met, the loop ends, if not, update W x And the current group information. After the loop ends, the W at the end of the loop x As the estimated weight matrix of the undirected graph.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of graph application technology, and in particular, to a method and device for determining an estimated weight matrix of an undirected graph. Background Art

[0002] The practical application of graph theory is very extensive. As a branch of graph theory, undirected graphs also have very wide applications. When applying undirected graphs in practice, it is necessary to construct undirected graphs according to the actual application scenarios. For example, what does each vertex of the undirected graph represent, what does the edge between vertices represent, what does the weight of the edge represent, etc. Taking social relationships as an example, each vertex represents a user, the edge between vertices represents whether there is a direct friend relationship between the users corresponding to the two vertices, and the weight of the edge represents the closeness of the relationship between the users corresponding to the two vertices.

[0003] In the related technology, when performing relevant calculations based on a constructed undirected graph, it is generally assumed that the constructed graph is accurate, that is, if the undirected graph is constructed based on comprehensive and accurate information in the application scenario, then the relevant calculations based on the constructed undirected graph are also accurate.

[0004] However, in practical applications, due to missing data, dirty data, etc., the constructed undirected graph is not very accurate, and related calculations based on the undirected graph are also inaccurate. Summary of the invention

[0005] In view of this, one or more embodiments of the present specification provide a method and device for determining an estimated weight matrix of an undirected graph.

[0006] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0007] According to a first aspect of one or more embodiments of this specification, a method for determining an estimated weight matrix of an undirected graph is proposed, the method comprising:

[0008] Get the original weight matrix W of the undirected graph 0 And the original grouping information; where, for any element W in any weight matrix W ij represents the weight between vertex i and vertex j, W ij Greater than 0, i≠j, i,j∈{1, 2, 3, …, n}, n is the total number of vertices;

[0009] The original weight matrix is ​​used as the current weight matrix W x , taking the original grouping information as the current grouping information;

[0010] The loop executes the following steps until the loop end condition is met:

[0011] According to the current weight matrix W x and the current grouping information, calculate the current total network information of the undirected graph Among them, Q ij is the difference between vertex i and vertex j, which is negatively correlated with the probability that vertex i and vertex j belong to the same group; the probability that vertex i and vertex j belong to the same group is obtained according to the grouping information;

[0012] If the loop end condition is not met, the current weight matrix W is updated according to the preset update algorithm based on T x And the current group information;

[0013] After the loop ends, the current weight matrix W at the end of the loop is 1 An estimated weight matrix for the undirected graph is determined.

[0014] According to a second aspect of one or more embodiments of this specification, a device for determining an estimated weight matrix of an undirected graph is provided, the device comprising:

[0015] Acquisition module, used to obtain the original weight matrix W of the undirected graph 0 And the original grouping information; where, for any element W in any weight matrix W ij represents the weight between vertex i and vertex j, W ij Greater than 0, i≠j, i, j∈{1, 2, 3, …, n}, n is the total number of vertices;

[0016] Initialization module, used to use the original weight matrix as the current weight matrix W x , taking the original grouping information as the current grouping information;

[0017] The loop execution module includes a calculation unit and an update unit, and is used to loop control the calculation unit and the update unit until a loop end condition is met:

[0018] The calculation unit is used to calculate the weight matrix W according to the current x and the current grouping information, calculate the current total network information of the undirected graph Among them, Q ij is the difference between vertex i and vertex j, which is negatively correlated with the probability that vertex i and vertex j belong to the same group; the probability that vertex i and vertex j belong to the same group is obtained according to the grouping information;

[0019] The updating unit is used to update the current weight matrix W according to a preset updating algorithm based on T if the loop end condition is not met. x And the current group information;

[0020] The estimated weight matrix determination module is used to determine the current weight matrix W at the end of the cycle. 1 An estimated weight matrix for the undirected graph is determined.

[0021] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, including:

[0022] processor;

[0023] a memory for storing processor-executable instructions;

[0024] The processor implements the method for determining the estimated weight matrix of the undirected graph as described above by running the executable instructions.

[0025] According to a fourth aspect of one or more embodiments of the present specification, a computer-readable storage medium is proposed, on which computer instructions are stored, and when the instructions are executed by a processor, the method for determining the estimated weight matrix of the undirected graph as described above is implemented.

[0026] In one or more embodiments of this specification, the original weight matrix W of the undirected graph is obtained. 0 As well as the original grouping information, the original weight matrix W 0 And the original grouping information is initialized to the corresponding current weight matrix W x And the current grouping information, and then loop the following steps until the loop end condition is met: According to the current weight matrix W x and the current grouping information, calculate the current total network information of the undirected graph Among them, Q ij is the difference between vertex i and vertex j, which is negatively correlated with the probability that vertex i and vertex j belong to the same group; determine whether the loop end condition is met, if it is met, then end the loop, if not, update the current weight matrix W according to the preset update algorithm based on T x And the current grouping information. After the loop ends, the current weight matrix W at the end of the loop is x As the estimated weight matrix of the undirected graph.

[0027] Through one or more embodiments of the present specification, based on the relationship between the weight matrix and the grouping information, an estimated weight matrix close to the actual correct weight matrix is ​​gradually estimated, so that related calculations based on the weight matrix are more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 It is a flowchart diagram of a method for determining an estimated weight matrix of an undirected graph provided by an exemplary embodiment.

[0029] Figure 2 It is a block diagram of a device for determining an estimated weight matrix of an undirected graph provided by an exemplary embodiment.

[0030] Figure 3 It is a structural diagram of a computer device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0031] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0032] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0033] In many application scenarios, the weight matrix of the undirected graph obtained based on relevant data is inaccurate, and many further calculations are based on the weight matrix, such as graph clustering and graph segmentation, which all need to be based on the weight matrix of the constructed undirected graph. In many cases, the default data is correct and complete, so the undirected graph constructed by default is also accurate, and further related calculations based on the constructed undirected graph (that is, using the weight matrix of the constructed undirected graph as a hyperparameter) are also accurate. However, the actual situation is that the relevant data obtained is not accurate and complete. Taking the social scenario as an example, the missing or insufficient interaction data between two users represented by two vertices causes the weight representing the closeness of the relationship between the two vertices to be much smaller than the actual value.

[0034] The inventors have found in practice that in many application scenarios, each vertex in an undirected graph will be grouped. The smaller the difference between two vertices (the more similar the relevant information of the two vertices), the more likely they belong to the same group. The grouping information is closely related to the weight. The weight between two vertices belonging to the same group will be relatively larger. Conversely, the weight between two vertices that do not belong to the same group will be relatively smaller. Taking social relationships as an example, each vertex is a user, and a circle of relatives and friends is a group (such as a family is a group). The weight between each two vertices represents the closeness of the relationship between the users represented by the two vertices. The closeness of the relationship between two users belonging to the same circle of relatives and friends will be relatively higher, and the closeness of the relationship between two users belonging to different circles of relatives and friends will be relatively lower, and may even be 0.

[0035] Based on this, this specification proposes a method for determining an estimated weight matrix of an undirected graph in an application scenario where the weight matrix and the grouping information have the above relationship, and obtains the original weight matrix W of the undirected graph. 0 As well as the original grouping information, the original weight matrix W 0 And the original grouping information is initialized to the corresponding current weight matrix W x And the current grouping information, and then loop the following steps until the loop end condition is met: According to the current weight matrix W x and the current grouping information, calculate the current total network information of the undirected graph Among them, Q ij is the difference between vertex i and vertex j, which is negatively correlated with the probability that vertex i and vertex j belong to the same group; determine whether the loop end condition is met, if it is met, then end the loop, if not, update the current weight matrix W according to the preset update algorithm based on T x And the current grouping information. After the loop ends, the current weight matrix W at the end of the loop is x As the estimated weight matrix of the undirected graph.

[0036] Through one or more embodiments of the present specification, based on the relationship between the weight matrix and the grouping information, an estimated weight matrix close to the actual correct weight matrix is ​​gradually estimated, so that related calculations based on the weight matrix are more accurate.

[0037] This specification provides a method for determining an estimated weight matrix of an undirected graph, and provides an apparatus, a device, and a computer storage medium corresponding to the method. Next, the method for determining an estimated weight matrix of an undirected graph is described in detail.

[0038] As mentioned above, in many application scenarios, each vertex in an undirected graph will be grouped, and in general, the grouping information is closely related to the weight. The weight between two vertices belonging to the same group will be relatively larger, and the weight between two vertices that do not belong to the same group will be relatively smaller. The method for determining the estimated weight matrix of an undirected graph in this specification is based on this premise. In other words, if the grouping information and the weight matrix do not have the above relationship, then the method for determining the estimated weight matrix of an undirected graph shown in this specification is not applicable.

[0039] First, the principle of the method for determining the estimated weight matrix of the undirected graph is explained. The weight between two vertices belonging to the same group will be relatively larger, and the difference between two vertices belonging to the same group will be relatively smaller. Conversely, the weight between two vertices not belonging to the same group will be relatively smaller, and the difference between two vertices belonging to different groups will be larger. Based on this understanding, for any two vertices (vertex i and vertex j), use W ij Represents the weight between vertex i and vertex j, with Q ij represents the difference between vertex i and vertex j. Since W ij With Q ij There is always one that is relatively small (between vertex i and vertex j, either the weight is relatively small or the difference is relatively small), then W ij *Q ij The obtained value is always relatively small, so is the total network information of the undirected graph (n is the total number of vertices). The smaller T is, the more the relationship between the weight matrix and the grouping information should be in line with the above understanding. It is believed that the weight matrix at this time is closer to the real and correct weight matrix.

[0040] like Figure 1 As shown, it is a flow chart of a method for determining an estimated weight matrix of an undirected graph shown in this specification, comprising the following steps:

[0041] Step 101: Get the original weight matrix W of the undirected graph 0 And the original grouping information.

[0042] It should be noted that in this specification, for any element W in any weight matrix W ij represents the weight between vertex i and vertex j, W ij Greater than 0, i≠j (that is, vertex i and vertex j are two different vertices), i, j∈{1, 2, 3, ..., n}, n is the total number of vertices.

[0043] In this specification, the original weight matrix is ​​constructed based on the original data, which may be missing or dirty (wrong data), so the constructed original weight matrix may not be accurate. Taking the social scene as an example, each vertex is a user. For any two users, the closeness of the relationship between the two users is determined based on their interaction in the social scene, thereby obtaining a relationship weight matrix.

[0044] It should be noted that this manual is aimed at undirected graphs, so the weight matrices are symmetric matrices (that is, the value of the i row and j column is the same as the value of the j row and i column, and i is not equal to j). In the matrix, there is no weight between each vertex and itself (no value in the i row and i column), which is an illegal value (NAN value).

[0045] As shown in Table 1, it is the weight matrix shown in this specification:

[0046] Table 1 Weight matrix diagram

[0047] \ Vertex A Vertex B Vertex C Vertex D Vertex A / 0.5 0.7 0.1 Vertex B 0.5 / 0.6 0.2 Vertex C 0.7 0.6 / 0.9 Vertex D 0.1 0.2 0.9 /

[0048] Among them, A, B, C, and D represent vertices, and each value represents the weight between any two vertices.

[0049] In practical applications, the weight between any two vertices may be uncertain due to missing data. Therefore, the weight between the two vertices can be set to 0. That is, for any two vertices in the original weight matrix, if there is no weight between the two vertices, 0 is added to the corresponding position in the weight matrix.

[0050] The original grouping information refers to the classification of each vertex. Generally, those with high similarity (i.e., small difference) are grouped together. For example, interest groups and friends and relatives groups in social scenarios all have high similarity in some aspects of information.

[0051] The grouping information of each vertex can be pre-marked or clustered based on similarity. The number of groups is certain, and the probability of each vertex belonging to each group is not certain. An example given in this specification is to use a grouping matrix to represent the probability of each vertex belonging to each group.

[0052] Let the grouping matrix be P. lk represents the probability that vertex l belongs to the kth group, l∈{1, 2, 3, ..., n}, k∈{1, 2, 3, ..., m}, m is the total number of groups,

[0053] As shown in Table 2, it is a schematic diagram of the grouping matrix shown in this specification:

[0054] Table 2 Grouping matrix diagram

[0055] Group 1 Group 2 Group 3 Vertex A 0.2 0.5 0.3 Vertex B 0 1 0 Vertex C 0.5 0.3 0.2 Vertex D 0.2 0.1 0.7 Vertex E 1 0 0

[0056] Step 103: Use the original weight matrix as the current weight matrix W x , taking the original grouping information as the current grouping information.

[0057] Step 105: According to the current weight matrix W x and the current grouping information, calculate the current total network information of the undirected graph

[0058] Among them, Q ij is the difference between vertex i and vertex j, which is negatively correlated with the probability that vertex i and vertex j belong to the same group; the probability that vertex i and vertex j belong to the same group is obtained according to the grouping information.

[0059] When the grouping information is the grouping matrix as described above, When vertices i and j are definitely in the same group, the value is the smallest (0); when they are definitely not in the same group, the value is the largest (2); when it is uncertain whether they are in the same group, the greater the probability of belonging to the same group, the higher the value (Q ij ) is smaller, on the contrary, the probability of belonging to the same group is smaller, and the value (Q ij ) is larger.

[0060] In addition, other influencing factors are generally considered. Among them, ε is other influencing factors, or other uncontrollable factors. This value is generally an empirical value and has uncertainty.

[0061] Step 107 , determine whether the loop end condition is met, if not, jump to step 109 ; if the loop end condition is met, jump to step 111 .

[0062] The loop end condition may be that the total network information T converges, or the number of loop executions reaches a preset number, or the total network information T converges or the number of loop executions reaches a preset number.

[0063] When the loop end condition is the convergence of the total network information T, it is considered that the gap between the total network information at this time and the minimum value of the total network information is negligible. Then, it is considered that the current weight matrix corresponding to this time is closest to the real weight matrix.

[0064] When the loop end condition is that the number of loop executions reaches a preset number of times, it is considered that the difference between the total network information T after the preset number of loop executions and the minimum value of the total network information is negligible, and then it is considered that the current weight matrix corresponding to this time is closest to the real weight matrix.

[0065] When the loop end condition is that the total network information T converges or the number of loop executions reaches a preset number of times, it is considered that after the loop executes the preset number of times or the total network information T converges (satisfies any condition), the difference between the total network information T at this time and the minimum value of the total network information can be ignored, then, it is considered that the current weight matrix corresponding to this time is closest to the real weight matrix.

[0066] Step 109: Update the current weight matrix W according to the preset update algorithm based on T x and current grouping information, and jumps to step 105.

[0067] The current weight matrix W can be adjusted according to the random direction of T. x And the current grouping information is updated. In order to get the result faster, it is generally updated gradually in the direction of the fastest gradient descent.

[0068] When updating the current weight matrix and the current grouping information according to the preset gradient, the update can be performed in the following manner:

[0069] For the current weight matrix W x middle Using the formula renew Update the current weight matrix W x Normalization is performed; γ is the learning rate of the current weight matrix.

[0070] Among them, when normalizing, it can be processed in the following way:

[0071]

[0072] That is, for any weight in the current weight matrix, calculate the weight and the minimum weight in the weight matrix The weight difference between them is used to calculate the maximum weight difference in the weight matrix Compared with the normalized In this way, the normalized current weight matrix is ​​obtained, and the weight value is considered to be between [0, 1].

[0073] For the current grouping matrix P x middle Using the formula renew Update the current grouping matrix Px Normalization is performed; δ is the learning rate of the current grouping matrix.

[0074] Among them, when normalizing, it can be processed in the following way:

[0075]

[0076] That is, for any grouping probability in the grouping matrix, calculate the grouping probability The minimum grouping probability in the grouping matrix The probability difference between them is used to calculate the maximum probability difference in the grouping matrix. Compared with the normalized In this way, the normalized current grouping matrix is ​​obtained, and the value of any current grouping probability is between [0, 1].

[0077] In practical applications, the learning rate γ of the weight matrix and the learning rate δ of the grouping matrix may be the same or different, and are both set based on experience.

[0078] This specification only schematically provides the update formulas for the current weight matrix and the current grouping information. Those skilled in the art can derive more update formulas based on the ideas of this specification, which are not listed one by one in this specification.

[0079] Step 111: The current weight matrix W at the end of the loop x An estimated weight matrix for the undirected graph is determined.

[0080] When the total network information T converges or the number of loop executions reaches the preset number, it is considered that the total network information T at this time can replace the minimum total network information T, then the current weight matrix W is considered x is the true and accurate weight matrix, that is, the estimated weight matrix of the undirected graph.

[0081] Since the estimated weight matrix is ​​considered to be close to the real and correct weight matrix, the estimated weight matrix at this time has a strong guiding significance. By comparing the difference between the estimated weight matrix and the original weight matrix, the constructed original weight matrix is ​​evaluated.

[0082] Let the original weight matrix be W 0 , the estimated weight matrix obtained at the end of the loop is W 1 , then for the vertices i and j with non-zero weights, that is, in the original weight matrix If the vertex i and vertex j of is less than the preset difference θ1, indicating that the original weight matrix With the estimated weight matrix Almost the same, then determine the original weight matrix The confidence level is high. In other words, the confidence level of the correlation data between vertex i and vertex j is high.

[0083] Furthermore, if This means that the estimated weight is greater than the original weight, and the original weight is too low. It is speculated that this is caused by missing data (such as ignoring some social interactions in social relationships), which makes the original weight too low. This means that the estimated weight is smaller than the original weight, and the original weight is too high. It is speculated that this is caused by dirty data (in social relationships, the interaction data is wrong, and weak interactions are regarded as strong interactions, resulting in an inflated relationship closeness), which makes the original weight too high.

[0084] For zero-weight vertices i and j, that is, in the original weight matrix If the vertex i and vertex j of If it is greater than the preset value θ2, it means that there should be a weight between vertex i and vertex j, that is, it is determined that there is a connection between vertex i and vertex j.

[0085] The above is an explanation of the method for determining the estimated weight matrix of an undirected graph. Next, the corresponding device will be explained in detail.

[0086] This specification provides a device for determining an estimated weight matrix of an undirected graph, such as Figure 2 As shown, the device comprises:

[0087] Acquisition module 201, used to obtain the original weight matrix W of the undirected graph 0 And the original grouping information; where, for any element W in any weight matrix W ij represents the weight between vertex i and vertex j, W ij Greater than 0, i≠j, i,j∈{1, 2, 3, …, n}, n is the total number of vertices;

[0088] Initialization module 203, used to use the original weight matrix as the current weight matrix W x , taking the original grouping information as the current grouping information;

[0089] The loop execution module 205 includes a calculation unit 2051 and an update unit 2052, and is used to loop control the calculation unit and the update unit until the loop end condition is met:

[0090] The calculation unit is used to calculate the weight matrix W according to the current x and the current grouping information, calculate the current total network information of the undirected graph Among them, Q ijis the difference between vertex i and vertex j, which is negatively correlated with the probability that vertex i and vertex j belong to the same group; the probability that vertex i and vertex j belong to the same group is obtained according to the grouping information;

[0091] The updating unit is used to update the current weight matrix W according to a preset updating algorithm based on T if the loop end condition is not met. x And the current group information;

[0092] The estimated weight matrix determination module 207 is used to determine the current weight matrix W at the end of the loop after the loop ends. 1 An estimated weight matrix for the undirected graph is determined.

[0093] The loop end condition can be one of the following:

[0094] The total network information T converges;

[0095] The number of loop executions reaches the preset number;

[0096] The total network information T converges or the number of loop executions reaches a preset number.

[0097] The grouping information is the grouping matrix P. lk represents the probability that vertex l belongs to the kth group, l∈{1, 2, 3, ..., n}, k∈{1, 2, 3, ..., m}, m is the total number of groups,

[0098] at this time,

[0099] In addition, when the grouping information is a grouping matrix P, the updating unit may be specifically configured to:

[0100] For the current weight matrix W x middle Using the formula renew Update the current weight matrix W x Perform normalization processing; γ is the learning rate of the current weight matrix;

[0101] For the current grouping matrix P x middle Using the formula renew Update the current grouping matrix P x Normalization is performed; δ is the learning rate of the current grouping matrix.

[0102] In addition, the device may also include:

[0103] A comparison module, used to compare the estimated weight matrix W 1 With the original weight matrix W 0 ;

[0104] Determine the module for Vertex i and vertex j are greater than 0, if is less than the preset difference θ1, then the obtained High confidence.

[0105] In addition, the device may also include:

[0106] A comparison module, used to compare the estimated weight matrix W 1 With the original weight matrix W 0 ;

[0107] Determine the module for Vertex i and vertex j are equal to 0, if If it is greater than the preset value θ2, it is determined that there is a connection between vertex i and vertex j.

[0108] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0109] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiment described above is only schematic, wherein the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. A person of ordinary skill in the art can understand and implement it without paying creative labor.

[0110] This specification also provides an electronic device, including:

[0111] processor;

[0112] a memory for storing processor-executable instructions;

[0113] The processor implements any of the above-described methods for determining an estimated weight matrix of an undirected graph by running the executable instructions.

[0114] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0115] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0116] Figure 3 A more specific hardware structure diagram of a computing device provided in an embodiment of the present specification is shown, and the device may include: a processor 310, a memory 320, an input / output interface 330, a communication interface 340, and a bus 350. The processor 310, the memory 320, the input / output interface 330, and the communication interface 340 are connected to each other in communication within the device through the bus 350.

[0117] The processor 310 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.

[0118] The memory 320 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 320 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 320 and are called and executed by the processor 310.

[0119] The input / output interface 330 is used to connect the input / output module to realize information input and output. The input / output module can be configured as a component in the device (not shown in the figure), or it can be externally connected to the device to provide corresponding functions. The input device may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device may include a display, a speaker, a vibrator, an indicator light, etc.

[0120] The communication interface 340 is used to connect a communication module (not shown) to realize communication interaction between the device and other devices. The communication module can realize communication through a wired mode (such as USB, network cable, etc.) or a wireless mode (such as mobile network, WIFI, Bluetooth, etc.).

[0121] The bus 350 comprises a pathway that transmits information between the various components of the device (eg, the processor 310 , the memory 320 , the input / output interface 330 , and the communication interface 340 ).

[0122] It should be noted that, although the above device only shows the processor 310, the memory 320, the input / output interface 330, the communication interface 340 and the bus 350, in the specific implementation process, the device may also include other components necessary for normal operation. In addition, it can be understood by those skilled in the art that the above device may also only include the components necessary for implementing the embodiments of the present specification, and does not necessarily include all the components shown in the figure.

[0123] The present specification also provides a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method for determining an estimated weight matrix of an undirected graph as described above.

[0124] Computer-readable media include permanent and non-permanent, removable and non-removable media that can be used to store information by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.

[0125] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0126] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0127] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0128] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0129] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A method for determining an estimated weight matrix of an undirected graph, the method include: Get the original weight matrix of an undirected graph and original grouping information; wherein the undirected graph is used to represent the relationship between different users in the social relationship, each vertex of the undirected graph is used to represent a user, and the edge between any two vertices of the undirected graph is used to represent the closeness of the relationship between the users represented by the two vertices. For any weight matrix Any element in represents the weight between vertex i and vertex j, Greater than 0, i≠j, i,j∈{1, 2, 3, ..., n}, n is the total number of vertices, and the closeness of the relationship between two users belonging to the same group in the original grouping information is greater than the closeness of the relationship between two users belonging to different groups; The original weight matrix is ​​used as the current weight matrix , taking the original grouping information as the current grouping information; The loop executes the following steps until the loop end condition is met: According to the current weight matrix and the current grouping information, calculate the current total network information of the undirected graph ;in, is the difference between vertex i and vertex j, which is negatively correlated with the probability that vertex i and vertex j belong to the same group; the probability that vertex i and vertex j belong to the same group is obtained according to the grouping information; If the loop end condition is not met, the current weight matrix is ​​updated according to the preset update algorithm based on T And the current group information; After the loop ends, the current weight matrix at the end of the loop is Determine the estimated weight matrix of the undirected graph , and according to the estimated weight matrix of the undirected graph Determine the closeness of the relationship between different users.

2. The method according to claim 1, wherein the loop end condition is one of the following: The total network information T converges; The number of loop executions reaches the preset number; The total network information T converges or the number of loop executions reaches a preset number.

3. The method according to claim 1, wherein the grouping information is a grouping matrix P, wherein represents the probability that vertex l belongs to the kth group, l∈{1, 2, 3, ..., n}, k∈{1, 2, 3, ..., m}, m is the total number of groups, ; Said .

4. The method according to claim 3, wherein the current weight matrix is ​​updated according to the preset gradient of T and the current group information, include: For the current weight matrix middle , using the formula renew ; Update the current weight matrix Perform normalization processing; is the learning rate of the current weight matrix; For the current group matrix middle , using the formula renew ; Update the current grouping matrix Perform normalization processing; is the learning rate of the current grouping matrix.

5. The method according to claim 1, further comprising: include: Compare the estimated weight matrices With the original weight matrix ; against Vertex i and vertex j are greater than 0, if Less than the preset difference , then determine the obtained High confidence.

6. The method according to claim 1, further comprising: include: Compare the estimated weight matrices With the original weight matrix ; against Vertex i and vertex j are equal to 0, if Greater than the preset value , then it is determined that there is a connection between vertex i and vertex j.

7. A device for determining an estimated weight matrix of an undirected graph, the device include: Get module, used to get the original weight matrix of the undirected graph and original grouping information; wherein the undirected graph is used to represent the relationship between different users in the social relationship, each vertex of the undirected graph is used to represent a user, and the edge between any two vertices of the undirected graph is used to represent the closeness of the relationship between the users represented by the two vertices. For any weight matrix Any element in represents the weight between vertex i and vertex j, Greater than 0, i≠j, i,j∈{1, 2, 3, ..., n}, n is the total number of vertices, and the closeness of the relationship between two users belonging to the same group in the original grouping information is greater than the closeness of the relationship between two users belonging to different groups; Initialization module, used to use the original weight matrix as the current weight matrix , taking the original grouping information as the current grouping information; The loop execution module includes a calculation unit and an update unit, and is used to loop control the calculation unit and the update unit until a loop end condition is met: The calculation unit is used to calculate the weight matrix according to the current and the current grouping information, calculate the current total network information of the undirected graph ;in, is the difference between vertex i and vertex j, which is negatively correlated with the probability that vertex i and vertex j belong to the same group; the probability that vertex i and vertex j belong to the same group is obtained according to the grouping information; The updating unit is used to update the current weight matrix according to a preset updating algorithm based on T if the loop end condition is not met. And the current group information; The estimated weight matrix determination module is used to determine the current weight matrix at the end of the cycle. Determine the estimated weight matrix of the undirected graph , and according to the estimated weight matrix of the undirected graph Determine the closeness of the relationship between different users.

8. The device according to claim 7, wherein the cycle end condition is one of the following: The total network information T converges; The number of loop executions reaches the preset number; The total network information T converges or the number of loop executions reaches a preset number.

9. The device according to claim 7, wherein the grouping information is a grouping matrix P, wherein represents the probability that vertex l belongs to the kth group, l∈{1, 2, 3, ..., n}, k∈{1, 2, 3, ..., m}, m is the total number of groups, ; Said .

10. The device according to claim 9, wherein the updating unit is specifically configured to: For the current weight matrix middle , using the formula renew ; Update the current weight matrix Perform normalization processing; is the learning rate of the current weight matrix; For the current group matrix middle , using the formula renew ; Update the current grouping matrix Perform normalization processing; is the learning rate of the current grouping matrix.

11. The device according to claim 7, further comprising: include: A comparison module for comparing the estimated weight matrices With the original weight matrix ; Determine the module for Vertex i and vertex j are greater than 0, if Less than the preset difference , then determine the obtained High confidence.

12. The device according to claim 7, further comprising: include: A comparison module for comparing the estimated weight matrices With the original weight matrix ; Determine the module for Vertex i and vertex j are equal to 0, if Greater than the preset value , then it is determined that there is a connection between vertex i and vertex j.

13. An electronic device, include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 6 by running the executable instructions.

14. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Friend automatic classification method and device, computer device and storage medium

    CN109933666A

  • Method, apparatus and device for determining compressed sensing measurement matrix

    CN111817723A

  • Social network friend recommendation method based on graph neural network

    CN112507245A

  • Multi-Source Breadth-First Search (Ms-Bfs) Technique And Graph Processing System That Applies It

    US20180307777A1

  • Method for automated scalable co-clustering

    US20190251200A1