[go: up one dir, main page]

CN111814944A - Method, device and terminal for allocating vertices to communities - Google Patents

Method, device and terminal for allocating vertices to communities Download PDF

Info

Publication number
CN111814944A
CN111814944A CN201910295949.1A CN201910295949A CN111814944A CN 111814944 A CN111814944 A CN 111814944A CN 201910295949 A CN201910295949 A CN 201910295949A CN 111814944 A CN111814944 A CN 111814944A
Authority
CN
China
Prior art keywords
vertex
distribution
allocation
strategy
vertices
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910295949.1A
Other languages
Chinese (zh)
Inventor
潘剑飞
戴明洋
杨胜文
石逸轩
周俊
许金泉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN201910295949.1A priority Critical patent/CN111814944A/en
Publication of CN111814944A publication Critical patent/CN111814944A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/12Computing arrangements based on biological models using genetic models
    • G06N3/126Evolutionary algorithms, e.g. genetic algorithms or genetic programming

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Evolutionary Biology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Genetics & Genomics (AREA)
  • Physiology (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention provides a vertex-to-community distribution method, a device and a terminal, wherein the method comprises the following steps: distributing the plurality of vertexes to a plurality of communities to obtain a plurality of distribution sequences, wherein each distribution sequence comprises the plurality of vertexes and vertex positions corresponding to the vertexes; selecting a vertex position as a target position, and comparing a target vertex corresponding to the target position with the rest of vertices in each distribution sequence to obtain a plurality of vertex similarities corresponding to each distribution sequence; determining an allocation strategy according to the similarity of the plurality of vertexes; and obtaining the probability of the distribution strategy according to the random distribution probability value and the distribution strategy of the plurality of vertexes distributed to the plurality of communities. The final vertex assignment to the respective communities enables faster and better convergence to the optimal solution.

Description

顶点对社区的分配方法、装置以及终端Method, device and terminal for allocating vertices to communities

技术领域technical field

本发明涉及数据分析技术领域,尤其涉及一种顶点对社区的分配方法、装置以及终端。The present invention relates to the technical field of data analysis, and in particular, to a method, device and terminal for allocating vertices to communities.

背景技术Background technique

人是群居性动物,物体也有类别之分,人以群分,物以类聚,群体的情况可以认为是社区的分布,顶点即表示单个人或者物,为了使物体和人最优的发现群体的信息,可以采用分配奖励机制。强化学习分配策略一般采用马可夫决策过程(Markov DecisionProcess,MDP)作为思想基础,马尔可夫决策过程是指根据每个时刻观察到的状态,从可用的行动集合中选用一个行动作出决策,系统下一步(未来)的状态是随机的,并且其状态转移概率具有马尔可夫性。决策者根据新观察到的状态,再作新的决策,依此反复地进行用来描述各个不同状态下执行各个不同行为的概率。分配策略能使顶点到社区的分配跳出局部解,尽可能的达到全局解,其中核心是策略过程,策略过程决定了顶点到社区分配的概率,优化其分配概率即能优化学习分配的过程。传统的学习策略是随机分配策略,随机分配概率值ε是在一个范围内变化,初始情况随机分配概率值ε比较大,顶点分配到社区的随机性比较高,在随后的过程中随机分配概率值ε变小,稳定到确定的顶点对社区的分布,导致并不能很好的收敛到最优解。Humans are social animals, and objects also have categories. People are divided into groups and objects are clustered together. The situation of groups can be considered as the distribution of communities, and the vertices represent a single person or object. In order to make objects and people optimally discover group information, A distribution reward mechanism can be used. The reinforcement learning allocation strategy generally uses the Markov Decision Process (MDP) as the ideological basis. The Markov decision process refers to selecting an action from the available action set to make a decision according to the state observed at each moment, and the system goes to the next step. The (future) state is random and its state transition probabilities have Markov properties. The decision maker makes new decisions based on the newly observed state, and it is repeated to describe the probability of performing different actions in different states. The allocation strategy can make the allocation of vertices to the community jump out of the local solution and achieve the global solution as much as possible. The core of which is the strategy process. The strategy process determines the probability of apex-community allocation. Optimizing its allocation probability can optimize the process of learning allocation. The traditional learning strategy is a random assignment strategy. The random assignment probability value ε varies within a range. In the initial situation, the random assignment probability value ε is relatively large, and the randomness of vertices to the community is relatively high, and the probability value is randomly assigned in the subsequent process. When ε becomes smaller, it stabilizes to a certain distribution of vertices to the community, resulting in not well converged to the optimal solution.

发明内容SUMMARY OF THE INVENTION

本发明实施例提供一种顶点对社区的分配方法、装置和终端,以解决现有技术中的至少一个或多个技术问题。Embodiments of the present invention provide a method, device, and terminal for allocating vertices to communities, so as to solve at least one or more technical problems in the prior art.

第一方面,本发明实施例提供了一种顶点对社区的分配方法,包括:In a first aspect, an embodiment of the present invention provides a method for allocating vertices to communities, including:

多个顶点分配至多个社区,得到多个分配序列,每个所述分配序列中包括多个所述顶点,以及与各所述顶点对应的顶点位置;A plurality of vertices are allocated to a plurality of communities to obtain a plurality of allocation sequences, each of the allocation sequences includes a plurality of the vertices, and a vertex position corresponding to each of the vertices;

选择一顶点位置作为目标位置,在各所述分配序列中,比较所述目标位置对应的目标顶点与剩余顶点,得到各所述分配序列对应的多个顶点相似度;Selecting a vertex position as the target position, in each of the allocation sequences, comparing the target vertex corresponding to the target position with the remaining vertices to obtain a plurality of vertex similarities corresponding to each of the allocation sequences;

根据多个所述顶点相似度确定分配策略;determining an allocation strategy according to a plurality of the vertex similarities;

根据多个顶点分配至多个社区的随机分配概率值和分配策略得到分配策略的概率。The probability of the assignment strategy is obtained according to the random assignment probability value and assignment strategy of multiple vertices assigned to multiple communities.

在一种实施方式中,多个顶点分配至多个社区,得到多个分配序列集合,包括:In one embodiment, multiple vertices are assigned to multiple communities to obtain multiple sets of assignment sequences, including:

N个顶点分配至K个社区,得到i个分配序列,N个顶点包括x1、x2……xN,i个分配序列包括:

Figure BDA0002026491390000021
其中,N≥1,K≥1,i≥1,N>K。N vertices are allocated to K communities, and i allocation sequences are obtained. The N vertices include x 1 , x 2 ...... x N , and the i allocation sequences include:
Figure BDA0002026491390000021
Among them, N≥1, K≥1, i≥1, N>K.

在一种实施方式中,选择一顶点位置作为目标位置,在各所述分配序列中,比较所述目标位置对应的目标顶点与剩余顶点,得到各所述分配序列对应的多个顶点相似度,包括:In one embodiment, a vertex position is selected as the target position, and in each of the allocation sequences, the target vertex corresponding to the target position and the remaining vertices are compared to obtain a plurality of vertex similarities corresponding to each of the allocation sequences, include:

选择一顶点位置作为目标位置g;Select a vertex position as the target position g;

在分配序列Xi中,比较目标位置g对应的目标顶点

Figure BDA0002026491390000022
与剩余顶点,得到的顶点相似度为
Figure BDA0002026491390000023
其中,i个分配序列对应的i个顶点相似度包括:Y1,Y2...Yi。In the allocation sequence Xi, compare the target vertices corresponding to the target position g
Figure BDA0002026491390000022
With the remaining vertices, the obtained vertex similarity is
Figure BDA0002026491390000023
Wherein, the i vertex similarities corresponding to the i allocation sequences include: Y 1 , Y 2 . . . Y i .

在一种实施方式中,根据多个所述顶点相似度确定分配策略,包括:In one embodiment, the allocation strategy is determined according to a plurality of the vertex similarities, including:

当大于或等于预设阈值的顶点相似度有多个时,其中,所述预设阈值为

Figure BDA0002026491390000024
i为奇数,分配策略X'i是i个分配序列中对应的目标顶点相同。When there are multiple vertex similarities greater than or equal to a preset threshold, the preset threshold is
Figure BDA0002026491390000024
i is an odd number, and the allocation strategy X' i is that the corresponding target vertices in the i allocation sequences are the same.

在一种实施方式中,根据多个所述顶点相似度确定分配策略,包括:In one embodiment, the allocation strategy is determined according to a plurality of the vertex similarities, including:

当小于预设阈值的顶点相似度有多个时,分配策略X'i是将邻接顶点分配至K个社区中。When there are multiple vertex similarities smaller than the preset threshold, the allocation strategy X' i is to allocate adjacent vertices to K communities.

在一种实施方式中,根据多个所述顶点相似度确定分配策略,包括:In one embodiment, the allocation strategy is determined according to a plurality of the vertex similarities, including:

当大于或等于预设阈值的顶点相似度只有一个时,其中,所述预设阈值为

Figure BDA0002026491390000025
i为奇数,分配策略X'i是重新选择所述目标位置。When there is only one vertex similarity greater than or equal to the preset threshold, the preset threshold is
Figure BDA0002026491390000025
i is an odd number, and the allocation strategy X' i is to reselect the target position.

在一种实施方式中,根据多个顶点分配至多个社区的随机分配概率值和分配策略得到分配策略的概率,包括:In one embodiment, the probability of obtaining the assignment strategy is obtained according to the random assignment probability value and assignment strategy of multiple vertices assigned to multiple communities, including:

利用式

Figure BDA0002026491390000031
计算分配策略的概率,其中,多个顶点分配至多个社区的随机分配概率值为ε。Utilization
Figure BDA0002026491390000031
Calculate the probability of the assignment strategy, where the random assignment probability of multiple vertices to multiple communities is ε.

第二方面,本发明实施例提供了一种顶点对社区的分配装置,包括:In a second aspect, an embodiment of the present invention provides an apparatus for allocating vertices to communities, including:

分配序列获取模块,用于多个顶点分配至多个社区,得到多个分配序列,每个所述分配序列中包括多个所述顶点,以及与各所述顶点对应的顶点位置;an allocation sequence acquisition module, configured to allocate a plurality of vertices to a plurality of communities to obtain a plurality of allocation sequences, each of the allocation sequences including a plurality of the vertices, and a vertex position corresponding to each of the vertices;

顶点相似度计算模块,用于选择一顶点位置作为目标位置,在各所述分配序列中,比较所述目标位置对应的目标顶点与剩余顶点,得到各所述分配序列对应的多个顶点相似度;The vertex similarity calculation module is used to select a vertex position as the target position, in each of the allocation sequences, compare the target vertex corresponding to the target position with the remaining vertices, and obtain a plurality of vertex similarities corresponding to each of the allocation sequences ;

分配策略确定模块,用于根据多个所述顶点相似度确定分配策略;an allocation strategy determination module, configured to determine an allocation strategy according to a plurality of the vertex similarities;

分配策略概率计算模块,用于根据多个顶点分配至多个社区的随机分配概率值和分配策略得到分配策略的概率。The distribution strategy probability calculation module is used to obtain the probability of the distribution strategy according to the random distribution probability value and the distribution strategy of the multiple vertices allocated to the multiple communities.

在一种实施方式中,所述分配序列获取模块包括:In one embodiment, the allocation sequence acquisition module includes:

分配单元,用于N个顶点分配至K个社区,得到i个分配序列,N个顶点包括x1、x2……xN,i个分配序列包括:

Figure BDA0002026491390000032
Figure BDA0002026491390000033
其中,N≥1,K≥1,i≥1,N>K。The allocation unit is used to allocate N vertices to K communities, and obtain i allocation sequences. The N vertices include x 1 , x 2 ...... x N , and the i allocation sequences include:
Figure BDA0002026491390000032
Figure BDA0002026491390000033
Among them, N≥1, K≥1, i≥1, N>K.

在一种实施方式中,所述顶点相似度计算模块包括:In one embodiment, the vertex similarity calculation module includes:

目标位置选择单元,用于选择一顶点位置作为目标位置g;a target position selection unit for selecting a vertex position as the target position g;

相似度计算单元,用于在分配序列Xi中,比较目标位置g对应的目标顶点

Figure BDA0002026491390000034
与剩余顶点,得到的顶点相似度为
Figure BDA0002026491390000035
The similarity calculation unit is used to compare the target vertices corresponding to the target position g in the allocation sequence X i
Figure BDA0002026491390000034
With the remaining vertices, the obtained vertex similarity is
Figure BDA0002026491390000035

相似度集合单元,用于i个分配序列对应的i个顶点相似度包括:Y1,Y2...YiThe similarity set unit, used for the similarity of i vertices corresponding to the i allocation sequences, includes: Y 1 , Y 2 . . . Y i .

在一种实施方式中,所述分配策略确定模块包括:In one embodiment, the allocation strategy determination module includes:

第一分配策略单元,用于当大于或等于预设阈值的顶点相似度有多个时,其中,所述预设阈值为

Figure BDA0002026491390000036
i为奇数,分配策略X'i是i个分配序列中对应的目标顶点相同。The first allocation strategy unit is used when there are multiple vertex similarities greater than or equal to a preset threshold, wherein the preset threshold is
Figure BDA0002026491390000036
i is an odd number, and the allocation strategy X' i is that the corresponding target vertices in the i allocation sequences are the same.

在一种实施方式中,所述分配策略确定模块包括:In one embodiment, the allocation strategy determination module includes:

第二分配策略单元,用于当小于预设阈值的顶点相似度有多个时,分配策略X'i是将邻接顶点分配至K个社区中。The second allocation strategy unit is configured to allocate adjacent vertices to K communities when there are multiple vertex similarities less than a preset threshold, the allocation strategy X' i .

在一种实施方式中,所述分配策略确定模块包括:In one embodiment, the allocation strategy determination module includes:

第三分配策略单元,用于当大于或等于预设阈值的顶点相似度只有一个时,其中,所述预设阈值为

Figure BDA0002026491390000041
i为奇数,分配策略X'i是重新选择所述目标位置。The third allocation strategy unit is used when there is only one vertex similarity greater than or equal to a preset threshold, wherein the preset threshold is
Figure BDA0002026491390000041
i is an odd number, and the allocation strategy X' i is to reselect the target position.

在一种实施方式中,所述分配策略概率计算模块包括:In one embodiment, the distribution strategy probability calculation module includes:

概率计算单元,用于利用式

Figure BDA0002026491390000042
计算分配策略的概率,其中,多个顶点分配至多个社区的随机分配概率值为ε。Probability calculation unit for using the formula
Figure BDA0002026491390000042
Calculate the probability of the assignment strategy, where the random assignment probability of multiple vertices to multiple communities is ε.

第三方面,本发明实施例提供了一种顶点对社区的分配装置,所述装置的功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多个与上述功能相对应的模块。In a third aspect, an embodiment of the present invention provides an apparatus for allocating vertices to communities. The functions of the apparatus may be implemented by hardware, or by executing corresponding software in hardware. The hardware or software includes one or more modules corresponding to the above functions.

在一个可能的设计中,所述顶点对社区的分配装置的结构中包括处理器和存储器,所述存储器用于存储支持所述装置执行上述顶点对社区的分配方法的程序,所述处理器被配置为用于执行所述存储器中存储的程序。所述顶点对社区的分配装置还可以包括通信接口,用于与其他设备或通信网络通信。In a possible design, the structure of the vertex-to-community allocation device includes a processor and a memory, and the memory is used to store a program that supports the device to execute the above-mentioned vertex-to-community allocation method, the processor is is configured to execute a program stored in the memory. The apparatus for assigning vertices to communities may further include a communication interface for communicating with other devices or a communication network.

第四方面,本发明实施例提供了一种计算机可读存储介质,用于存储顶点对社区的分配装置所用的计算机软件指令,其包括用于执行上述顶点对社区的分配方法所涉及的程序。In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium for storing computer software instructions used by a vertex-to-community allocation apparatus, which includes a program for executing the above-mentioned vertex-to-community allocation method.

上述技术方案中的一个技术方案具有如下优点或有益效果:针对顶点分配到社区的强化学习的策略过程中,引入遗传算法的顶点分配做指导,使最终顶点分配到各个社区的更快更好的收敛到最优解。One of the above technical solutions has the following advantages or beneficial effects: In the process of the reinforcement learning strategy for assigning vertices to communities, the vertex assignment of the genetic algorithm is introduced as a guide, so that the final vertices are assigned to each community faster and better. converge to the optimal solution.

上述概述仅仅是为了说明书的目的,并不意图以任何方式进行限制。除上述描述的示意性的方面、实施方式和特征之外,通过参考附图和以下的详细描述,本发明进一步的方面、实施方式和特征将会是容易明白的。The above summary is for illustrative purposes only and is not intended to be limiting in any way. In addition to the illustrative aspects, embodiments and features described above, further aspects, embodiments and features of the present invention will become apparent by reference to the accompanying drawings and the following detailed description.

附图说明Description of drawings

在附图中,除非另外规定,否则贯穿多个附图相同的附图标记表示相同或相似的部件或元素。这些附图不一定是按照比例绘制的。应该理解,这些附图仅描绘了根据本发明公开的一些实施方式,而不应将其视为是对本发明范围的限制。In the drawings, unless stated otherwise, the same reference numbers refer to the same or like parts or elements throughout the several figures. The drawings are not necessarily to scale. It should be understood that these drawings depict only some embodiments according to the disclosure and should not be considered as limiting the scope of the invention.

图1示出根据本发明实施例的一种顶点对社区的分配方法的流程图。FIG. 1 shows a flowchart of a method for allocating vertices to communities according to an embodiment of the present invention.

图2示出根据本发明实施例的另一种顶点对社区的分配方法的流程图。FIG. 2 shows a flowchart of another method for allocating vertices to communities according to an embodiment of the present invention.

图3示出根据本发明实施例的康奈尔Cornell社区数据集的加入MOEA的策略和non-MOEA算法的分配曲线图。FIG. 3 shows a strategy of joining MOEA and a distribution curve diagram of a non-MOEA algorithm of the Cornell community data set according to an embodiment of the present invention.

图4示出根据本发明实施例的政治博客数据集Polblogs Dataset的加入MOEA的策略和non-MOEA算法的分配曲线图。FIG. 4 shows a policy of joining MOEA and a distribution curve diagram of a non-MOEA algorithm of the political blog data set Polblogs Dataset according to an embodiment of the present invention.

图5示出根据本发明实施例的华盛顿Washington社区数据集的加入MOEA的策略和non-MOEA算法的分配曲线图。FIG. 5 shows the strategy of joining MOEA and the distribution curve diagram of the non-MOEA algorithm of the Washington Washington community data set according to an embodiment of the present invention.

图6示出根据本发明实施例的威斯康星州Wisconsin社区数据集的加入MOEA的策略和non-MOEA算法的分配曲线图。FIG. 6 shows a strategy of joining MOEA and a distribution curve diagram of a non-MOEA algorithm of the Wisconsin Wisconsin community data set according to an embodiment of the present invention.

图7示出根据本发明实施例的顶点对社区的分配方法的示意图。FIG. 7 shows a schematic diagram of a method for allocating vertices to communities according to an embodiment of the present invention.

图8示出根据本发明实施例的一种顶点对社区的分配装置的结构框图。FIG. 8 shows a structural block diagram of an apparatus for allocating vertices to communities according to an embodiment of the present invention.

图9示出根据本发明实施例的另一种顶点对社区的分配装置的结构框图。FIG. 9 shows a structural block diagram of another apparatus for allocating vertices to communities according to an embodiment of the present invention.

图10示出根据本发明实施例的一种顶点对社区的分配终端的结构框图。FIG. 10 shows a structural block diagram of a terminal for assigning vertices to communities according to an embodiment of the present invention.

具体实施方式Detailed ways

在下文中,仅简单地描述了某些示例性实施例。正如本领域技术人员可认识到的那样,在不脱离本发明的精神或范围的情况下,可通过各种不同方式修改所描述的实施例。因此,附图和描述被认为本质上是示例性的而非限制性的。In the following, only certain exemplary embodiments are briefly described. As those skilled in the art would realize, the described embodiments may be modified in various different ways, all without departing from the spirit or scope of the present invention. Accordingly, the drawings and description are to be regarded as illustrative in nature and not restrictive.

图1示出根据本发明实施例的顶点对社区的分配方法流程图。如图1所示,在一种实施方式中,该方法包括:FIG. 1 shows a flowchart of a method for allocating vertices to communities according to an embodiment of the present invention. As shown in Figure 1, in one embodiment, the method includes:

步骤S10:多个顶点分配至多个社区,得到多个分配序列,每个分配序列中包括多个顶点,以及与各顶点对应的顶点位置;Step S10: multiple vertices are assigned to multiple communities, and multiple assignment sequences are obtained, each assignment sequence includes multiple vertices, and vertex positions corresponding to each vertex;

步骤S20:选择一顶点位置作为目标位置,在各分配序列中,比较目标位置对应的目标顶点与剩余顶点,得到各分配序列对应的多个顶点相似度;Step S20: select a vertex position as the target position, and in each allocation sequence, compare the target vertex corresponding to the target position and the remaining vertices, and obtain a plurality of vertex similarities corresponding to each allocation sequence;

步骤S30:根据多个顶点相似度确定分配策略;Step S30: determining an allocation strategy according to the similarity of multiple vertices;

步骤S40:根据多个顶点分配至多个社区的随机分配概率值和分配策略得到分配策略的概率。Step S40: Obtain the probability of the allocation strategy according to the random allocation probability value and the allocation strategy of the plurality of vertices allocated to the plurality of communities.

在一种实施例中,如图2所示,步骤S10包括:In one embodiment, as shown in FIG. 2 , step S10 includes:

步骤S101:N个顶点分配至K个社区,得到i个分配序列,N个顶点包括x1、x2……xN,i个分配序列包括:

Figure BDA0002026491390000061
Figure BDA0002026491390000062
其中,N≥1,K≥1,i≥1,N>K。Step S101: N vertices are allocated to K communities, i allocation sequences are obtained, the N vertices include x 1 , x 2 ...... x N , and the i allocation sequences include:
Figure BDA0002026491390000061
Figure BDA0002026491390000062
Among them, N≥1, K≥1, i≥1, N>K.

在一种实施例中,如图2所示,步骤S20包括:In one embodiment, as shown in FIG. 2 , step S20 includes:

步骤S201:选择一顶点位置作为目标位置g;Step S201: select a vertex position as the target position g;

步骤S202:在分配序列Xi中,比较目标位置g对应的目标顶点

Figure BDA0002026491390000063
与剩余顶点,若相同,则赋值1,若不同,则赋值0,得到的顶点相似度为
Figure BDA0002026491390000064
其中,i个分配序列对应的i个顶点相似度包括:Y1,Y2...Yi。Step S202: in the allocation sequence Xi, compare the target vertices corresponding to the target position g
Figure BDA0002026491390000063
and the remaining vertices, if they are the same, assign 1, and if they are different, assign 0, and the obtained vertex similarity is
Figure BDA0002026491390000064
Wherein, the i vertex similarities corresponding to the i allocation sequences include: Y 1 , Y 2 . . . Y i .

在一种实施例中,如图2所示,步骤S30包括:In one embodiment, as shown in FIG. 2 , step S30 includes:

S301:当大于或等于预设阈值的顶点相似度有多个时,其中,所述预设阈值为

Figure BDA0002026491390000065
i为奇数,分配策略X'i是所述目标顶点与所述剩余顶点相同。S301: When there are multiple vertex similarities greater than or equal to a preset threshold, wherein the preset threshold is
Figure BDA0002026491390000065
i is an odd number, and the allocation strategy X' i is that the target vertex is the same as the remaining vertex.

在一种实施例中,如图2所示,步骤S30包括:In one embodiment, as shown in FIG. 2 , step S30 includes:

S302:当小于预设阈值的顶点相似度有多个时,分配策略X'i是将邻接顶点分配至K个社区中。S302: When there are multiple vertex similarities smaller than the preset threshold, the allocation strategy X' i is to allocate adjacent vertices to K communities.

在一种实施例中,如图2所示,步骤S30包括:In one embodiment, as shown in FIG. 2 , step S30 includes:

S303:当大于或等于预设阈值的顶点相似度只有一个时,其中,所述预设阈值为

Figure BDA0002026491390000066
i为奇数,分配策略X'i是重新选择所述目标位置。S303: When there is only one vertex similarity greater than or equal to a preset threshold, wherein the preset threshold is
Figure BDA0002026491390000066
i is an odd number, and the allocation strategy X' i is to reselect the target position.

在一种实施例中,如图2所示,步骤S40包括:In one embodiment, as shown in FIG. 2 , step S40 includes:

利用式

Figure BDA0002026491390000067
计算分配策略的概率,其中,多个顶点分配至多个社区的随机分配概率值为ε。Utilization
Figure BDA0002026491390000067
Calculate the probability of the assignment strategy, where the random assignment probability of multiple vertices to multiple communities is ε.

在一种示例中,本实施例提出了针对顶点分配到社区的强化学习的策略过程中,引入遗传算法的顶点分配做指导,使最终顶点分配到各个社区的更快更好的收敛到最优解。In one example, this embodiment proposes a strategy process for the reinforcement learning of vertices assigned to communities, and introduces the vertex assignment of genetic algorithm as a guide, so that the final vertex assignment to each community can converge to the optimal faster and better. untie.

如图7所示,首先,随机获取顶点(对应图7中的顶点编码U)对社区(对应图7中的社区编码)的奇数个分配序列(对应图7中的动作序列),本实施方式中以获取三个分配序列为例进行说明,N个顶点包括x1、x2……xN,N个顶点在分配至K个社区得到的i个分配序列中,选取其中三个分配序列,包括

Figure BDA0002026491390000071
之后,选择目标位置g,三个分配序列中,目标位置g对应的目标顶点包括:
Figure BDA0002026491390000072
每个分配序列中将目标顶点和剩余顶点进行比较。例如,在第一个分配序列中,分别比较
Figure BDA0002026491390000073
Figure BDA0002026491390000074
Figure BDA0002026491390000075
Figure BDA0002026491390000076
……
Figure BDA0002026491390000077
Figure BDA0002026491390000078
若相同,则赋值为1,若不同则赋值为0,得到第一个分配序列对应的第一顶点相似度Y1。同理,在第二个分配序列中,分别比较
Figure BDA0002026491390000079
Figure BDA00020264913900000728
Figure BDA00020264913900000710
Figure BDA00020264913900000711
……
Figure BDA00020264913900000712
Figure BDA00020264913900000713
若相同,则赋值为1,若不同则赋值为0,得到第二个分配序列对应的第二顶点相似度Y2。在第三个分配序列中,分别比较
Figure BDA00020264913900000714
Figure BDA00020264913900000729
Figure BDA00020264913900000715
Figure BDA00020264913900000716
……
Figure BDA00020264913900000717
Figure BDA00020264913900000718
若相同,则赋值为1,若不同则赋值为0,得到第三个分配序列对应的第三顶点相似度Y3。将三个顶点相似度进行集合,可用
Figure BDA00020264913900000719
表示顶点相似度集合。之后,将Y与X1进行如下的操作:X'1=Y∞X1,∞可表示为:当Y中只有一个大于或等于预设阈值的顶点相似度时,将重新选择目标位置;当Y中有多个大于或等于预设阈值的顶点相似度时,三个分配序列中,目标位置对应的目标顶点相同,即
Figure BDA00020264913900000720
Figure BDA00020264913900000721
相同;当Y中有多个小于预设阈值的顶点相似度时,应当将与
Figure BDA00020264913900000722
Figure BDA00020264913900000723
邻接顶点分配至K个社区中。最终的X'1为目标顶点
Figure BDA00020264913900000724
对K个社区的分布;同理,将Y与X2进行如下的操作:X'2=Y∞X2,最终的X'2为目标顶点
Figure BDA00020264913900000725
对K个社区的分布,将Y与X3进行如下的操作:X'3=Y∞X3,最终的X'3为目标顶点
Figure BDA00020264913900000726
对K个社区的分布。通过以上步骤能够得到遗传算法在当前状态给予的顶点对社区的分配的思想(过程对应于图7中的节点分配方案),可以在强化学习的策略阶段引入该指导策略,最终可以在策略的ε-greedy贪婪算法采样阶段引入分配结果的指导,最终的顶点对社区的分配策略的概率(对应于图7中的社区结果)为:As shown in FIG. 7 , first, an odd number of assignment sequences (corresponding to the action sequence in FIG. 7 ) of the vertices (corresponding to the vertex code U in FIG. 7 ) to the community (corresponding to the community code in FIG. 7 ) are randomly obtained. Taking the acquisition of three allocation sequences as an example to illustrate, the N vertices include x 1 , x 2 ...... include
Figure BDA0002026491390000071
After that, select the target position g. In the three allocation sequences, the target vertices corresponding to the target position g include:
Figure BDA0002026491390000072
The target vertex and the remaining vertices are compared in each allocation sequence. For example, in the first assignment sequence, compare
Figure BDA0002026491390000073
and
Figure BDA0002026491390000074
Figure BDA0002026491390000075
and
Figure BDA0002026491390000076
...
Figure BDA0002026491390000077
and
Figure BDA0002026491390000078
If they are the same, assign a value of 1, and if they are different, assign a value of 0 to obtain the first vertex similarity Y 1 corresponding to the first assignment sequence. Similarly, in the second allocation sequence, compare
Figure BDA0002026491390000079
and
Figure BDA00020264913900000728
Figure BDA00020264913900000710
and
Figure BDA00020264913900000711
...
Figure BDA00020264913900000712
and
Figure BDA00020264913900000713
If they are the same, assign a value of 1, and if they are different, assign a value of 0 to obtain the second vertex similarity Y 2 corresponding to the second assignment sequence. In the third assignment sequence, compare
Figure BDA00020264913900000714
and
Figure BDA00020264913900000729
Figure BDA00020264913900000715
and
Figure BDA00020264913900000716
...
Figure BDA00020264913900000717
and
Figure BDA00020264913900000718
If they are the same, assign a value of 1, and if they are different, assign a value of 0 to obtain the third vertex similarity Y 3 corresponding to the third assignment sequence. Set the similarity of three vertices, available
Figure BDA00020264913900000719
Represents the vertex similarity set. After that, perform the following operations on Y and X 1 : X' 1 =Y∞X 1 , ∞ can be expressed as: when there is only one vertex similarity greater than or equal to the preset threshold in Y, the target position will be reselected; when When there are multiple vertex similarities greater than or equal to the preset threshold in Y, in the three assignment sequences, the target vertices corresponding to the target positions are the same, that is,
Figure BDA00020264913900000720
and
Figure BDA00020264913900000721
The same; when there are multiple vertex similarities less than the preset threshold in Y, it should be compared with
Figure BDA00020264913900000722
and
Figure BDA00020264913900000723
Adjacent vertices are assigned to K communities. The final X' 1 is the target vertex
Figure BDA00020264913900000724
The distribution of K communities; similarly, perform the following operations on Y and X 2 : X' 2 =Y∞X 2 , the final X' 2 is the target vertex
Figure BDA00020264913900000725
For the distribution of K communities, perform the following operations on Y and X 3 : X' 3 =Y∞X 3 , the final X' 3 is the target vertex
Figure BDA00020264913900000726
Distribution over K communities. Through the above steps, the idea of assigning the vertices to the community given by the genetic algorithm in the current state can be obtained (the process corresponds to the node assignment scheme in Figure 7). -The greedy algorithm sampling phase introduces the guidance of the distribution result, and the probability of the final vertex-to-community distribution strategy (corresponding to the community result in Figure 7) is:

Figure BDA00020264913900000727
其中,Ai为社区的分配策略的概率,多个顶点分配至多个社区的随机分配概率值为ε。
Figure BDA00020264913900000727
Among them, A i is the probability of the distribution strategy of the community, and the random distribution probability of multiple vertices assigned to multiple communities is ε.

本实施例提供的分配方法更好更优给予顶点对社区的分配,并比较传统的策略能更好的收敛于最优的分配结果。本实施例提供的分配方法还适用于推荐问题,如商品推荐,将物品分配到不同的人群的群体中。本实施例提供的分配方法还适用于分类聚类问题,例如,社交产品是直接发现其人群。The allocation method provided in this embodiment is better and more optimal for the allocation of vertices to the community, and can better converge to the optimal allocation result compared with the traditional strategy. The distribution method provided in this embodiment is also applicable to recommendation problems, such as product recommendation, where items are distributed to different groups of people. The assignment method provided in this embodiment is also applicable to classification and clustering problems, for example, the social product is to directly discover its crowd.

以下是加入一种多目标进化算法(MOEA,a multiobjective evolutionaryalgorithm)的策略和传统的non-MOEA的ε-greedy过程的最终目标的收敛性和收敛效果在四个数据集上。如图3所示,康奈尔Cornell社区数据集的加入MOEA的策略和non-MOEA算法的分配曲线图,如图3所示,康奈尔Cornell社区数据集的加入MOEA的策略和non-MOEA算法的分配曲线图,如图4所示,政治博客数据集Polblogs Dataset的加入MOEA的策略和non-MOEA算法的分配曲线图,如图5所示,华盛顿Washington社区数据集的加入MOEA的策略和non-MOEA算法的分配曲线图。如图6所示,威斯康星州Wisconsin社区数据集的加入MOEA的策略和non-MOEA算法的分配曲线图。从上述的四个数据图中可以看出,加入MOEA的策略比non-MOEA算法的收敛性更好,并且达到更好的T目标。The following are the convergence and convergence effects of the final objective of the strategy of adding a multiobjective evolutionary algorithm (MOEA, a multiobjective evolutionary algorithm) and the traditional non-MOEA ε-greedy process on four datasets. As shown in Figure 3, the strategy of joining MOEA and the distribution curve of the non-MOEA algorithm for the Cornell community dataset are shown in Figure 3. The strategy for joining MOEA and the non-MOEA algorithm for the Cornell community dataset are shown in Figure 3. The allocation curve of the algorithm is shown in Figure 4. The strategy of joining MOEA in the political blog dataset Polblogs Dataset and the allocation curve of the non-MOEA algorithm are shown in Figure 5. The strategy of joining MOEA in the Washington community data set and Distribution plot for the non-MOEA algorithm. As shown in Figure 6, the strategy of joining MOEA and the distribution curve of the non-MOEA algorithm for the Wisconsin community dataset in Wisconsin. It can be seen from the above four data graphs that the strategy of adding MOEA has better convergence than the non-MOEA algorithm and achieves a better T target.

图8示出根据本发明实施例的一种顶点对社区的分配装置的结构框图。如图8所示,在一种实施方式中,该装置包括:FIG. 8 shows a structural block diagram of an apparatus for allocating vertices to communities according to an embodiment of the present invention. As shown in Figure 8, in one embodiment, the device includes:

分配序列获取模块10,用于多个顶点分配至多个社区,得到多个分配序列,每个所述分配序列中包括多个所述顶点,以及与各所述顶点对应的顶点位置;The allocation sequence acquisition module 10 is used to allocate a plurality of vertices to a plurality of communities to obtain a plurality of allocation sequences, and each of the allocation sequences includes a plurality of the vertices and a vertex position corresponding to each of the vertices;

顶点相似度计算模块20,用于选择一顶点位置作为目标位置,在各所述分配序列中,比较所述目标位置对应的目标顶点与剩余顶点,得到各所述分配序列对应的多个顶点相似度;The vertex similarity calculation module 20 is used to select a vertex position as the target position, and in each of the allocation sequences, compare the target vertex corresponding to the target position with the remaining vertices, and obtain a plurality of vertices corresponding to each of the allocation sequences that are similar Spend;

分配策略确定模块30,用于根据多个所述顶点相似度确定分配策略;an allocation strategy determination module 30, configured to determine an allocation strategy according to a plurality of the vertex similarities;

分配策略概率计算模块40,用于根据多个顶点分配至多个社区的随机分配概率值和分配策略得到分配策略的概率。The allocation strategy probability calculation module 40 is configured to obtain the probability of the allocation strategy according to the random allocation probability values of the plurality of vertices allocated to the plurality of communities and the allocation strategy.

在一种实施方式中,如图9所示,所述分配序列获取模块10包括:In one embodiment, as shown in FIG. 9 , the allocation sequence acquisition module 10 includes:

分配单元101,用于N个顶点分配至K个社区,得到i个分配序列,N个顶点包括x1、x2……xN,i个分配序列包括:

Figure BDA0002026491390000081
Figure BDA0002026491390000082
其中,N≥1,K≥1,i≥1,N>K。The allocation unit 101 is used for allocating N vertices to K communities to obtain i allocation sequences, the N vertices include x 1 , x 2 ...... x N , and the i allocation sequences include:
Figure BDA0002026491390000081
Figure BDA0002026491390000082
Among them, N≥1, K≥1, i≥1, N>K.

在一种实施方式中,如图9所示,所述顶点相似度计算模块20包括:In one embodiment, as shown in FIG. 9 , the vertex similarity calculation module 20 includes:

目标位置选择单元201,用于选择一顶点位置作为目标位置g;a target position selection unit 201 for selecting a vertex position as the target position g;

相似度计算单元202,用于在分配序列Xi中,比较目标位置g对应的目标顶点

Figure BDA0002026491390000083
与剩余顶点,得到的顶点相似度为
Figure BDA0002026491390000084
其中,i个分配序列对应的i个顶点相似度包括:Y1,Y2...Yi。The similarity calculation unit 202 is used to compare the target vertices corresponding to the target position g in the allocation sequence X i
Figure BDA0002026491390000083
With the remaining vertices, the obtained vertex similarity is
Figure BDA0002026491390000084
Wherein, the i vertex similarities corresponding to the i allocation sequences include: Y 1 , Y 2 . . . Y i .

在一种实施方式中,如图9所示,所述分配策略确定模块30包括:In one embodiment, as shown in FIG. 9 , the allocation strategy determination module 30 includes:

第一分配策略单元301,用于当大于或等于预设阈值的顶点相似度有多个时,其中,所述预设阈值为

Figure BDA0002026491390000091
i为奇数,分配策略X'i是i个分配序列中对应的目标顶点相同。The first allocation strategy unit 301 is used when there are multiple vertex similarities greater than or equal to a preset threshold, wherein the preset threshold is
Figure BDA0002026491390000091
i is an odd number, and the allocation strategy X' i is that the corresponding target vertices in the i allocation sequences are the same.

在一种实施方式中,如图9所示,所述分配策略确定模块30包括:In one embodiment, as shown in FIG. 9 , the allocation strategy determination module 30 includes:

第二分配策略单元302,用于当小于预设阈值的顶点相似度有多个时,分配策略X'i是将邻接顶点分配至K个社区中。The second allocation strategy unit 302 is configured to allocate adjacent vertices to K communities when there are multiple vertex similarities smaller than the preset threshold, the allocation strategy X' i .

在一种实施方式中,如图9所示,所述分配策略确定模块30包括:In one embodiment, as shown in FIG. 9 , the allocation strategy determination module 30 includes:

第三分配策略单元303,用于当大于或等于预设阈值的顶点相似度只有一个时,其中,所述预设阈值为

Figure BDA0002026491390000092
i为奇数,分配策略X'i是重新选择所述目标位置。The third allocation strategy unit 303 is used for when there is only one vertex similarity greater than or equal to a preset threshold, wherein the preset threshold is
Figure BDA0002026491390000092
i is an odd number, and the allocation strategy X' i is to reselect the target position.

在一种实施方式中,如图9所示,所述分配策略概率计算模块40包括:In one embodiment, as shown in FIG. 9 , the distribution strategy probability calculation module 40 includes:

概率计算单元401,用于利用式

Figure BDA0002026491390000093
计算分配策略的概率,其中,多个顶点分配至多个社区的随机分配概率值为ε。Probability calculation unit 401 for using the formula
Figure BDA0002026491390000093
Calculate the probability of the assignment strategy, where the random assignment probability of multiple vertices to multiple communities is ε.

本发明实施例各装置中的各模块的功能可以参见上述方法中的对应描述,在此不再赘述。For the functions of each module in each apparatus in this embodiment of the present invention, reference may be made to the corresponding description in the foregoing method, and details are not described herein again.

图10示出根据本发明实施例的顶点对社区的分配终端的结构框图。如图10所示,该终端包括:存储器910和处理器920,存储器910内存储有可在处理器920上运行的计算机程序。所述处理器920执行所述计算机程序时实现上述实施例中的顶点对社区的分配方法。所述存储器910和处理器920的数量可以为一个或多个。FIG. 10 shows a structural block diagram of a terminal for assigning vertices to communities according to an embodiment of the present invention. As shown in FIG. 10 , the terminal includes: a memory 910 and a processor 920 , and a computer program that can be executed on the processor 920 is stored in the memory 910 . When the processor 920 executes the computer program, the method for allocating vertices to communities in the above embodiments is implemented. The number of the memory 910 and the processor 920 may be one or more.

该终端还包括:The terminal also includes:

通信接口930,用于与外界设备进行通信,进行数据交互传输。The communication interface 930 is used to communicate with external devices and perform data interactive transmission.

存储器910可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。The memory 910 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk memory.

如果存储器910、处理器920和通信接口930独立实现,则存储器910、处理器920和通信接口930可以通过总线相互连接并完成相互间的通信。所述总线可以是工业标准体系结构(ISA,Industry Standard Architecture)总线、外部设备互连(PCI,PeripheralComponent Interconnect)总线或扩展工业标准体系结构(EISA,Extended IndustryStandard Architecture)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。If the memory 910, the processor 920 and the communication interface 930 are independently implemented, the memory 910, the processor 920 and the communication interface 930 may be connected to each other through a bus and complete communication with each other. The bus may be an Industry Standard Architecture (ISA, Industry Standard Architecture) bus, a Peripheral Component Interconnect (PCI, Peripheral Component Interconnect) bus, or an Extended Industry Standard Architecture (EISA, Extended Industry Standard Architecture) bus or the like. The bus can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in FIG. 10, but it does not mean that there is only one bus or one type of bus.

可选的,在具体实现上,如果存储器910、处理器920及通信接口930集成在一块芯片上,则存储器910、处理器920及通信接口930可以通过内部接口完成相互间的通信。Optionally, in specific implementation, if the memory 910, the processor 920 and the communication interface 930 are integrated on one chip, the memory 910, the processor 920 and the communication interface 930 can communicate with each other through an internal interface.

本发明实施例提供了一种计算机可读存储介质,其存储有计算机程序,该程序被处理器执行时实现上述实施例中任一所述的方法。An embodiment of the present invention provides a computer-readable storage medium, which stores a computer program, and when the program is executed by a processor, implements any of the methods described in the foregoing embodiments.

在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。而且,描述的具体特征、结构、材料或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。In the description of this specification, description with reference to the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples", etc., mean specific features described in connection with the embodiment or example , structure, material or feature is included in at least one embodiment or example of the present invention. Furthermore, the particular features, structures, materials or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, those skilled in the art may combine and combine the different embodiments or examples described in this specification, as well as the features of the different embodiments or examples, without conflicting each other.

此外,术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或隐含地包括至少一个该特征。在本发明的描述中,“多个”的含义是两个或两个以上,除非另有明确具体的限定。In addition, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implying the number of indicated technical features. Thus, a feature delimited with "first", "second" may expressly or implicitly include at least one of that feature. In the description of the present invention, "plurality" means two or more, unless otherwise expressly and specifically defined.

流程图中或在此以其他方式描述的任何过程或方法描述可以被理解为,表示包括一个或更多个用于实现特定逻辑功能或过程的步骤的可执行指令的代码的模块、片段或部分,并且本发明的优选实施方式的范围包括另外的实现,其中可以不按所示出或讨论的顺序,包括根据所涉及的功能按基本同时的方式或按相反的顺序,来执行功能,这应被本发明的实施例所属技术领域的技术人员所理解。Any description of a process or method in the flowcharts or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing a specified logical function or step of the process , and the scope of the preferred embodiments of the invention includes alternative implementations in which the functions may be performed out of the order shown or discussed, including performing the functions substantially concurrently or in the reverse order depending upon the functions involved, which should It is understood by those skilled in the art to which the embodiments of the present invention belong.

在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,“计算机可读介质”可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。The logic and/or steps represented in flowcharts or otherwise described herein, for example, may be considered an ordered listing of executable instructions for implementing the logical functions, may be embodied in any computer-readable medium, For use with, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processor, or other system that can fetch instructions from and execute instructions from an instruction execution system, apparatus, or apparatus) or equipment. For the purposes of this specification, a "computer-readable medium" can be any device that can contain, store, communicate, propagate, or transport the program for use by or in connection with an instruction execution system, apparatus, or apparatus. More specific examples (non-exhaustive list) of computer readable media include the following: electrical connections with one or more wiring (electronic devices), portable computer disk cartridges (magnetic devices), random access memory (RAM), Read Only Memory (ROM), Erasable Editable Read Only Memory (EPROM or Flash Memory), Fiber Optic Devices, and Portable Read Only Memory (CDROM). In addition, the computer readable medium may even be paper or other suitable medium on which the program may be printed, as the paper or other medium may be optically scanned, for example, followed by editing, interpretation, or other suitable medium as necessary process to obtain the program electronically and then store it in computer memory.

应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或他们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that various parts of the present invention may be implemented in hardware, software, firmware or a combination thereof. In the above-described embodiments, various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one or a combination of the following techniques known in the art: Discrete logic circuits, application specific integrated circuits with suitable combinational logic gates, Programmable Gate Arrays (PGA), Field Programmable Gate Arrays (FPGA), etc.

本技术领域的普通技术人员可以理解实现上述实施例方法携带的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,该程序在执行时,包括方法实施例的步骤之一或其组合。Those skilled in the art can understand that all or part of the steps carried by the methods of the above embodiments can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the program can be stored in a computer-readable storage medium. When executed, one or a combination of the steps of the method embodiment is included.

此外,在本发明各个实施例中的各功能单元可以集成在一个处理模块中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。所述集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读存储介质中。所述存储介质可以是只读存储器,磁盘或光盘等。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing module, or each unit may exist physically alone, or two or more units may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware, and can also be implemented in the form of software function modules. If the integrated modules are implemented in the form of software functional modules and sold or used as independent products, they may also be stored in a computer-readable storage medium. The storage medium may be a read-only memory, a magnetic disk or an optical disk, and the like.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到其各种变化或替换,这些都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited to this. Any person skilled in the art who is familiar with the technical field disclosed in the present invention can easily think of various changes or Replacement, these should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (16)

1. A vertex-to-community allocation method, comprising:
distributing a plurality of vertexes to a plurality of communities to obtain a plurality of distribution sequences, wherein each distribution sequence comprises a plurality of vertexes and vertex positions corresponding to the vertexes;
selecting a vertex position as a target position, and comparing a target vertex corresponding to the target position with the rest of vertices in each distribution sequence to obtain a plurality of vertex similarities corresponding to each distribution sequence;
determining an allocation strategy according to the similarity of the vertexes;
and obtaining the probability of the distribution strategy according to the random distribution probability value and the distribution strategy of the plurality of vertexes distributed to the plurality of communities.
2. The method of claim 1, wherein assigning vertices to communities results in a plurality of sets of assigned sequences, comprising:
distributing N vertexes to K communities to obtain i distribution sequences, wherein the N vertexes comprise x1、x2……xNThe i allocation sequences include:
Figure FDA0002026491380000011
wherein N is more than or equal to 1, K is more than or equal to 1, i is more than or equal to 1, and N is more than K.
3. The method of claim 2, wherein selecting a vertex position as a target position, and in each of the distribution sequences, comparing the target vertex corresponding to the target position with the remaining vertices to obtain a plurality of vertex similarities corresponding to each of the distribution sequences comprises:
selecting a vertex position as a target position g;
in the distribution sequence XiIn (1), comparing the target vertex corresponding to the target position g
Figure FDA0002026491380000012
With the remaining vertices, the resulting vertex similarity is
Figure FDA0002026491380000013
Wherein, i vertex similarities corresponding to the i distribution sequences include: y is1,Y2...Yi
4. The method of claim 3, wherein determining an allocation policy based on the plurality of vertex similarities comprises:
when the vertex similarity greater than or equal to a preset threshold value is multiple, wherein the preset threshold value is
Figure FDA0002026491380000014
i is odd, strategy X 'is assigned'iThe corresponding target vertices in the i assignment sequences are the same.
5. The method of claim 3, wherein determining an allocation policy based on the plurality of vertex similarities comprises:
when the vertex similarity smaller than the preset threshold value is multiple, distributing strategy X'iContiguous vertices are assigned to K communities.
6. The method of claim 3, wherein determining an allocation policy based on the plurality of vertex similarities comprises:
when the vertex similarity greater than or equal to a preset threshold value is only one, wherein the preset threshold value is
Figure FDA0002026491380000021
i is odd, strategy X 'is assigned'iIs to reselect the target location.
7. The method of any one of claims 4-6, wherein deriving the probability of the allocation policy based on the random allocation probability values of the vertices to the communities and the allocation policy comprises:
by using
Figure FDA0002026491380000022
And calculating the probability of the distribution strategy, wherein the random distribution probability values of the plurality of vertexes distributed to the plurality of communities are.
8. An apparatus for vertex-to-community assignment, comprising:
the distribution sequence acquisition module is used for distributing a plurality of vertexes to a plurality of communities to obtain a plurality of distribution sequences, and each distribution sequence comprises a plurality of vertexes and vertex positions corresponding to the vertexes;
the vertex similarity calculation module is used for selecting a vertex position as a target position, and comparing a target vertex corresponding to the target position with the rest of vertices in each distribution sequence to obtain a plurality of vertex similarities corresponding to each distribution sequence;
the distribution strategy determining module is used for determining a distribution strategy according to the similarity of the vertexes;
and the distribution strategy probability calculation module is used for obtaining the probability of the distribution strategy according to the random distribution probability values distributed to the communities by the vertexes and the distribution strategy.
9. The apparatus of claim 8, wherein the allocation sequence obtaining module comprises:
an allocation unit for allocating N vertexes to K communities to obtain i allocation sequences, wherein the N vertexes include x1、x2……xNThe i allocation sequences include:
Figure FDA0002026491380000023
Figure FDA0002026491380000024
wherein N is more than or equal to 1, K is more than or equal to 1, i is more than or equal to 1, and N is more than K.
10. The apparatus of claim 9, wherein the vertex similarity calculation module comprises:
a target position selection unit for selecting a vertex position as a target position g;
a similarity calculation unit for calculating a similarity between the assigned sequence X and the assigned sequence XiIn (1), comparing the target position g withTarget vertex
Figure FDA0002026491380000025
With the remaining vertices, the resulting vertex similarity is
Figure FDA0002026491380000026
The similarity set unit is used for i vertex similarities corresponding to the i distribution sequences and comprises the following steps: y is1,Y2...Yi
11. The apparatus of claim 10, wherein the allocation policy determination module comprises:
a first allocation strategy unit, configured to apply to a case where there are multiple vertex similarities greater than or equal to a preset threshold, where the preset threshold is
Figure FDA0002026491380000031
i is odd, strategy X 'is assigned'iThe corresponding target vertices in the i assignment sequences are the same.
12. The apparatus of claim 10, wherein the allocation policy determination module comprises:
a second distribution strategy unit for distributing strategy X 'when there are more vertex similarities less than the preset threshold'iContiguous vertices are assigned to K communities.
13. The apparatus of claim 10, wherein the allocation policy determination module comprises:
a third allocation policy unit, configured to, when there is only one vertex similarity greater than or equal to a preset threshold, where the preset threshold is
Figure FDA0002026491380000032
i is odd, strategy X 'is assigned'iIs to reselect the target location.
14. The apparatus according to any of claims 10-13, wherein the allocation policy probability calculation module comprises:
probability calculation unit for using
Figure FDA0002026491380000033
And calculating the probability of the distribution strategy, wherein the random distribution probability values of the plurality of vertexes distributed to the plurality of communities are.
15. A vertex-to-community distribution terminal, comprising:
one or more processors;
storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method of any of claims 1-7.
16. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 7.
CN201910295949.1A 2019-04-12 2019-04-12 Method, device and terminal for allocating vertices to communities Pending CN111814944A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910295949.1A CN111814944A (en) 2019-04-12 2019-04-12 Method, device and terminal for allocating vertices to communities

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910295949.1A CN111814944A (en) 2019-04-12 2019-04-12 Method, device and terminal for allocating vertices to communities

Publications (1)

Publication Number Publication Date
CN111814944A true CN111814944A (en) 2020-10-23

Family

ID=72844537

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910295949.1A Pending CN111814944A (en) 2019-04-12 2019-04-12 Method, device and terminal for allocating vertices to communities

Country Status (1)

Country Link
CN (1) CN111814944A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080052263A1 (en) * 2006-08-24 2008-02-28 Yahoo! Inc. System and method for identifying web communities from seed sets of web pages
CN101944218A (en) * 2010-01-27 2011-01-12 北京大学 Personalized recommended method based on picture under social network and system thereof
US20140149430A1 (en) * 2012-11-28 2014-05-29 Korea Advanced Institute Of Science And Technology Method of detecting overlapping community in network
CN105183780A (en) * 2015-08-12 2015-12-23 中国工程物理研究院计算机应用研究所 Improved AGNES algorithm based protocol classification method
CN107292701A (en) * 2017-05-25 2017-10-24 北京小度信息科技有限公司 Order group technology and device
CA2941604A1 (en) * 2016-09-12 2018-03-12 Ebrahim BAGHERI System and method for temporal identification of latent communities using electronic content
CN108053268A (en) * 2017-12-29 2018-05-18 广州品唯软件有限公司 A kind of commercial articles clustering confirmation method and device
CN108846543A (en) * 2018-04-26 2018-11-20 深圳大学 A kind of calculation method and device of non-overlap community set quality Measure Indexes
CN109408722A (en) * 2018-11-06 2019-03-01 腾讯科技(深圳)有限公司 Community division method, calculates equipment and storage medium at device
CN109543107A (en) * 2018-11-21 2019-03-29 网易无尾熊(杭州)科技有限公司 Data processing method, medium, device and calculating equipment
US20190179615A1 (en) * 2016-10-27 2019-06-13 Tencent Technology (Shenzhen) Company Limited Community discovery method, device, server and computer storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080052263A1 (en) * 2006-08-24 2008-02-28 Yahoo! Inc. System and method for identifying web communities from seed sets of web pages
CN101944218A (en) * 2010-01-27 2011-01-12 北京大学 Personalized recommended method based on picture under social network and system thereof
US20140149430A1 (en) * 2012-11-28 2014-05-29 Korea Advanced Institute Of Science And Technology Method of detecting overlapping community in network
CN105183780A (en) * 2015-08-12 2015-12-23 中国工程物理研究院计算机应用研究所 Improved AGNES algorithm based protocol classification method
CA2941604A1 (en) * 2016-09-12 2018-03-12 Ebrahim BAGHERI System and method for temporal identification of latent communities using electronic content
US20190179615A1 (en) * 2016-10-27 2019-06-13 Tencent Technology (Shenzhen) Company Limited Community discovery method, device, server and computer storage medium
CN107292701A (en) * 2017-05-25 2017-10-24 北京小度信息科技有限公司 Order group technology and device
CN108053268A (en) * 2017-12-29 2018-05-18 广州品唯软件有限公司 A kind of commercial articles clustering confirmation method and device
CN108846543A (en) * 2018-04-26 2018-11-20 深圳大学 A kind of calculation method and device of non-overlap community set quality Measure Indexes
CN109408722A (en) * 2018-11-06 2019-03-01 腾讯科技(深圳)有限公司 Community division method, calculates equipment and storage medium at device
CN109543107A (en) * 2018-11-21 2019-03-29 网易无尾熊(杭州)科技有限公司 Data processing method, medium, device and calculating equipment

Non-Patent Citations (7)

* Cited by examiner, † Cited by third party
Title
XIAOYE MIAO等: "Optimizing Quality for Probabilistic Skyline Computation and Probabilistic Similarity Search", 《IEEE TRANSACTIONS ON KNOWLEDGE AND DATA ENGINEERING 》, 13 February 2018 (2018-02-13) *
付饶;孟凡荣;邢艳;: "基于节点重要性与相似性的重叠社区发现算法", 计算机工程, no. 09, 15 September 2018 (2018-09-15) *
余琨;伍孝金;: "基于KL散度矩阵迹的潜映射半监督社区发现", 计算机工程, no. 12, 15 December 2017 (2017-12-15) *
杨春燕等: "《可拓数据挖掘方法及其计算机实现》", 31 August 2010 *
祝奇伟;陈家琪;: "一种改进相似度计算方法的协同过滤推荐算法", 信息技术, no. 03, 25 March 2015 (2015-03-25) *
郑天宇;吴爱华;: "基于变长马尔科夫模型的用户购物行为分析", 现代计算机(专业版), no. 21, 25 July 2016 (2016-07-25) *
郝梓琳;李雷;施化吉;: "基于节点综合相似度的多标签传播社区划分算法", 计算机应用研究, no. 06, 8 April 2018 (2018-04-08) *

Similar Documents

Publication Publication Date Title
US20190279088A1 (en) Training method, apparatus, chip, and system for neural network model
CN113506035B (en) A method, device and equipment for determining approval process
US20170344881A1 (en) Information processing apparatus using multi-layer neural network and method therefor
Rehbach et al. Expected improvement versus predicted value in surrogate-based optimization
CN107402745B (en) Mapping method and device of data flow graph
WO2022227217A1 (en) Text classification model training method and apparatus, and device and readable storage medium
JP2021517295A (en) High-efficiency convolutional network for recommender systems
CN113821332B (en) Method, device, equipment and medium for optimizing efficiency of automatic machine learning system
CN108701250A (en) Data fixed point method and device
CN110633786A (en) Techniques for Determining the Topology of Artificial Neural Networks
KR20220013896A (en) Method and apparatus for determining the neural network architecture of a processor
EP3367310A1 (en) Method and apparatus for parallelizing layers of deep neural networks onto parallel computing systems
CN110705889A (en) Enterprise screening method, device, equipment and storage medium
WO2021009618A1 (en) Group specific decision tree
CN116992253A (en) Method for determining the value of hyperparameters in the target prediction model associated with the target business
US20200387811A1 (en) Systems and methods for neighbor frequency aggregation of parametric probability distributions with decision trees
CN111814944A (en) Method, device and terminal for allocating vertices to communities
CN117435516B (en) Test case priority ordering method and system
CN112989047A (en) Text clustering method and device, computer equipment and storage medium
CN118313445A (en) A federated incremental learning method and system based on constrained gradient updating
Goldsztajn et al. Utility maximizing load balancing policies
CN115082955B (en) Deep learning global optimization method, recognition method, device and medium
CN116610574A (en) Test case generation method, device, equipment and medium
JP2020107185A (en) Image recognition device, image recognition method and program
CN114969636A (en) Model recommendation method and device and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination