CN108960979A - A kind of method that initial user is chosen in product distribution on line - Google Patents
A kind of method that initial user is chosen in product distribution on line Download PDFInfo
- Publication number
- CN108960979A CN108960979A CN201810637291.3A CN201810637291A CN108960979A CN 108960979 A CN108960979 A CN 108960979A CN 201810637291 A CN201810637291 A CN 201810637291A CN 108960979 A CN108960979 A CN 108960979A
- Authority
- CN
- China
- Prior art keywords
- matrix
- node
- rank
- neighbours
- subgraph
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 31
- 239000011159 matrix material Substances 0.000 claims description 319
- 230000008859 change Effects 0.000 claims description 26
- 230000004913 activation Effects 0.000 claims description 9
- 125000004122 cyclic group Chemical group 0.000 claims description 4
- 230000006854 communication Effects 0.000 claims 2
- 238000010586 diagram Methods 0.000 claims 2
- 230000007420 reactivation Effects 0.000 claims 2
- 230000003213 activating effect Effects 0.000 claims 1
- 230000008569 process Effects 0.000 abstract description 7
- 238000004422 calculation algorithm Methods 0.000 description 22
- 238000004364 calculation method Methods 0.000 description 8
- 230000000694 effects Effects 0.000 description 3
- 238000002474 experimental method Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 2
- 230000002068 genetic effect Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000000354 decomposition reaction Methods 0.000 description 1
- 229940050561 matrix product Drugs 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 238000012552 review Methods 0.000 description 1
- 238000010187 selection method Methods 0.000 description 1
- 238000004088 simulation Methods 0.000 description 1
- 230000003612 virological effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/06—Buying, selling or leasing transactions
- G06Q30/0601—Electronic shopping [e-shopping]
- G06Q30/0631—Item recommendations
Landscapes
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Finance (AREA)
- Development Economics (AREA)
- Economics (AREA)
- Marketing (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明公开了一种线上产品推销选取初始用户的方法。首先对线上产品的数据集进行处理,得到真实的拓扑结构图G(V,E),接着计算G中所有节点的t阶邻居,把每个节点当成初始用户对其邻居进行独立级联模型传播,计算节点的影响力,然后为节点选取最佳的t’阶邻居,从节点的t’阶邻居中选取影响力最大的作为初始用户。本发明在节点的t阶邻居中选择初始用户降低了时间复杂度。
The invention discloses a method for selecting initial users for online product promotion. First, process the data set of online products to obtain the real topology graph G(V,E), then calculate the t-order neighbors of all nodes in G, and use each node as the initial user to independently cascade the model to its neighbors Propagate, calculate the influence of the node, and then select the best t'-order neighbor for the node, and select the most influential one from the t'-order neighbor of the node as the initial user. The present invention reduces the time complexity by selecting the initial user in the t-order neighbors of the node.
Description
技术领域technical field
本发明属于复杂网络领域,特别涉及一种线上产品推销选取初始用户的方 法。The invention belongs to the field of complex networks, in particular to a method for selecting initial users for online product promotion.
背景技术Background technique
影响力最大化的目标是在一个在线社交网络中选择一组用户。具有最大影响 的种子集,即在信息传播中,通过种子集的受影响用户的预期数量是最大化的。 影响力最大化的一个众所周知的应用是病毒营销,一个公司可能希望通过用户之 间的社交链接,将新产品的采用从一些最初选择的采用者中传播出去。由于影响 力最大化是一个NP-hard问题,现有的工作集中在近似的解决方案上,而这些影 响力最大化算法研究的重点是贪婪的框架。我们回顾贪婪的框架并提出一个分类 方法,现有基于仿真方法,基于代理和草图方法,基于他们的算法设计实现不同期 望的目标。The goal of influence maximization is to select a group of users in an online social network. A seed set with maximum influence, i.e., in information dissemination, the expected number of affected users passing through the seed set is maximized. A well-known application of influence maximization is viral marketing, where a company may wish to spread the adoption of a new product away from a few initially selected adopters through social links between users. Since influence maximization is an NP-hard problem, existing work focuses on approximate solutions, whereas these influence maximization algorithm studies focus on a greedy framework. We review the greedy framework and propose a taxonomy of existing simulation-based methods, agent-based and sketch methods, based on their algorithmic design to achieve different desired goals.
贪婪算法在每一步都将当前最具有影响力的节点作为候选节点放入种子集 合中,然后不断地进行迭代直到所有的种子节点被选出。然而此算法的局部最优 策略并不能保证最终结果的全局最优,而且算法的效率比较低,时间复杂度较高, 不适用于大规模的实际网络。在此基础上,Tsai等人对贪婪算法进行了改进, 提出了GNG算法(GeneticNewGreedy,GNG)。实验表明该算法结合了遗传算 法的一些特性后可将贪婪算法的性能提高10%左右。Cheng等人为了解决影响 力最大化算法的准确率和可扩展性的两难问题,提出了启发式SG算法 (StaticGreedy,SG)。该算法利用了影响力最大化目标函数的子模特性用于选择 当前最有影响力的节点,以此来降低候选节点选取所花费的时间。Gong等人提出了基于概率转移矩阵的影响力最大化PTMA算法(Probability Transfer MatrixAlgorithm,PTMA),该算法通过矩阵乘积的方法得到某一时刻节点之间的影响 概率,而无需在每个时刻计算所有非活跃节点的边际效益来提高算法运行时的效 率。Cao等人提出了基于核数层次特征和影响半径的启发式算法-核覆盖算法 CCA(Core CoveringAlgorithm,CCA)。该算法首先引入K-核概念,基于K- 核分解求出每个节点的核数,然后根据核数分布的层次性,引入节点的影响半径 参数,最后综合核数和度数两个属性,找出影响力节点集合。陈浩等人基于阈值 提出了一个潜在影响节点数PIN的概念,通过考虑节点本身的初试激活阈值, 节点已激活的入边邻居对其的影响力,以及节点对其邻居节点的影响力。在第一 阶段选择PIN最大的作为种子节点,在第二阶段通过贪心算法选择种子节点,该算法复杂度小,影响力的范围大。此类影响力最大化的算法设计都是基于模型 驱动的,在给定影响力传播模型的基础上,利用启发式的方法进行种子节点的选 取。The greedy algorithm puts the current most influential node as a candidate node into the seed set at each step, and then iterates continuously until all the seed nodes are selected. However, the local optimum strategy of this algorithm cannot guarantee the global optimum of the final result, and the efficiency of the algorithm is relatively low, and the time complexity is high, so it is not suitable for large-scale actual networks. On this basis, Tsai et al. improved the greedy algorithm and proposed the GNG algorithm (Genetic New Greedy, GNG). Experiments show that this algorithm can improve the performance of greedy algorithm by about 10% after combining some characteristics of genetic algorithm. In order to solve the dilemma of the accuracy and scalability of the influence maximization algorithm, Cheng et al. proposed a heuristic SG algorithm (StaticGreedy, SG). The algorithm uses the submodel characteristic of the influence maximization objective function to select the most influential node at present, so as to reduce the time spent on candidate node selection. Gong et al. proposed the Probability Transfer Matrix Algorithm (PTMA) based on the probability transfer matrix. This algorithm obtains the influence probability between nodes at a certain moment by matrix product method, without calculating all nodes at each moment. The marginal benefits of inactive nodes to improve the efficiency of algorithm runtime. Cao et al. proposed a heuristic algorithm based on core number hierarchical features and influence radius - Core Covering Algorithm CCA (Core Covering Algorithm, CCA). The algorithm firstly introduces the concept of K-core, calculates the number of cores of each node based on K-core decomposition, then introduces the influence radius parameter of the node according to the hierarchy of the distribution of the number of cores, and finally combines the two attributes of the number of cores and the degree to find A set of influential nodes. Chen Hao et al. proposed a concept of potential influence node number PIN based on the threshold, by considering the initial activation threshold of the node itself, the influence of the node's activated incoming neighbors on it, and the influence of the node on its neighbor nodes. In the first stage, the one with the largest PIN is selected as the seed node, and in the second stage, the seed node is selected through a greedy algorithm, which has a small complexity and a wide range of influence. The algorithm design of this kind of influence maximization is based on model-driven, and based on the given influence propagation model, heuristic method is used to select the seed nodes.
传统的选取产品推销初始用户是通过人工选择的,人工选择的方法由于消耗 人力资源,且存在一定的片面性,并不能根据产品和对象的特征进行选择,导致 选择初始用户的效果并不可观。The traditional selection of initial users for product promotion is through manual selection. Due to the consumption of human resources and the existence of a certain one-sidedness, the manual selection method cannot be selected according to the characteristics of products and objects, resulting in the effect of selecting initial users is not considerable.
发明内容Contents of the invention
发明目的:针对上述问题,本发明提供一种节约时间和人力成本,并且降低 了时间复杂度的线上产品推销选取初始用户的方法。Purpose of the invention: To address the above problems, the present invention provides a method for selecting initial users for online product promotion that saves time and labor costs and reduces time complexity.
技术方案:本发明提出一种线上产品推销选取初始用户的方法,包括如下步 骤:Technical solution: The present invention proposes a method for selecting initial users for online product promotion, including the following steps:
步骤1:对线上产品的数据集进行处理,得到真实的拓扑结构图G(V,E); 其中,V表示G中的节点集合,E表示G中的边的集合,输入P,P是独立级联 模型中一个被激活节点v激活其未激活的出度邻居节点的概率,输入S,S是选 取种子节点的个数,具体方法为:Step 1: Process the data set of online products to obtain the real topology graph G(V,E); where V represents the set of nodes in G, E represents the set of edges in G, and the input P, P is In the independent cascading model, the probability that an activated node v activates its inactive outgoing neighbor nodes, input S, S is the number of selected seed nodes, the specific method is:
步骤1.1:删除线上产品的数据集中存在的自环,得到真实的拓扑结构图 G(V,E),G是邻接矩阵;Step 1.1: Delete the self-loops existing in the data set of online products to obtain the real topology graph G(V,E), where G is the adjacency matrix;
步骤1.2:节点的势就是G中有多少个节点,边的势就是G中有多少条边, 求得节点的势m和边的势n;Step 1.2: The potential of a node is how many nodes there are in G, the potential of an edge is how many edges there are in G, and the potential m of a node and the potential n of an edge are obtained;
步骤1.3:独立级联是一种概率模型,当一个节点v被激活时,它会以概率P 对它未激活的出边邻居节点w尝试激活,这种尝试仅仅进行一次,而且这些尝试 之间是相互独立的,即v对w的激活不会受到其他节点的影响。概率P是实验一 开始定义的,因此在根据社交网络中用户邻居选取影响力最大化初始节点中, P=1/degree。degree是节点的度,计算邻接矩阵G的每一行的和记为矩阵Degree, 是节点对应的度。Step 1.3: Independent cascading is a probabilistic model. When a node v is activated, it will try to activate its inactive outbound neighbor node w with probability P. This attempt is only made once, and between these attempts are independent of each other, that is, the activation of v on w will not be affected by other nodes. The probability P is defined at the beginning of the experiment, so in selecting the initial nodes to maximize influence based on the user's neighbors in the social network, P=1/degree. degree is the degree of the node, and the sum of each row of the adjacency matrix G is calculated as the matrix Degree, which is the degree corresponding to the node.
步骤2:计算每个节点的t阶邻居,把求得的每个节点的t阶邻居放在一个 大集合SubList里,t=1,2,3,4,5,6,7,8,9,10,具体方法为:Step 2: Calculate the t-order neighbors of each node, and put the obtained t-order neighbors of each node in a large set SubList, t=1, 2, 3, 4, 5, 6, 7, 8, 9 , 10, the specific method is:
步骤2.1:对步骤1.1中的邻接矩阵G的行/列进行编号,第一行/列是1,第 二行/列是2…依次标号;Step 2.1: Number the rows/columns of the adjacency matrix G in step 1.1, the first row/column is 1, the second row/column is 2... and numbered in turn;
步骤2.2:求节点i的1阶邻居,设定一个m行m列的空矩阵D,m是步骤 1.2中求得的节点的势。把矩阵D的第i行第i列的0改为1,计算矩阵D*G, 求得的是节点i的1阶邻居的子图,定义为J1;Step 2.2: Find the first-order neighbors of node i, and set an empty matrix D with m rows and m columns, where m is the potential of the node obtained in step 1.2. Change the 0 in the i-th row and the i-column of the matrix D to 1, calculate the matrix D*G, and obtain the subgraph of the first-order neighbor of the node i, which is defined as J 1 ;
步骤2.3:求节点i的2阶邻居,取邻接矩阵G的第i行,设为矩阵A,把 矩阵A的第i个数改为1,生成一个矩阵B,对角线是矩阵A,其余都为0;计 算矩阵B*G,求得的是节点i的2阶邻居的子图,定义为J2;Step 2.3: Find the second-order neighbors of node i, take the i-th row of the adjacency matrix G, set it as matrix A, change the i-th number of matrix A to 1, and generate a matrix B, the diagonal is matrix A, and the rest Both are 0; calculate the matrix B*G, and obtain the subgraph of the second-order neighbor of node i, which is defined as J 2 ;
步骤2.4:求节点i的3阶邻居,首先计算G+G*G,记为矩阵F1,把矩阵 F1中不是0的数都置为1,并且把对角线上的数都置为0;取矩阵F1的第i行, 设为矩阵C1,把矩阵C1的第i个数改为1,生成一个矩阵E1,对角线是矩阵 C1,其余数都为0;计算矩阵E1*G,求得的是节点i的3阶邻居的子图,定义 为J3;Step 2.4: To find the third-order neighbors of node i, first calculate G+G*G, record it as matrix F1, set all the numbers in matrix F1 that are not 0 to 1, and set all the numbers on the diagonal to 0; Take the i-th row of matrix F1, set it as matrix C1, change the i-th number of matrix C1 to 1, generate a matrix E1, the diagonal line is matrix C1, and the rest are all 0; calculate matrix E1*G, find The obtained subgraph is the third-order neighbor of node i, which is defined as J 3 ;
步骤2.5:求节点i的4阶邻居,首先计算G+G2+G3,设定为矩阵F2,把 矩阵F2中不是0的数都置为1,并且把对角线上的数都置为0;取矩阵F2的第 i行,设为矩阵C2,把矩阵C2的第i个数改为1,生成一个矩阵E2,对角线是 矩阵C2,其余数都为0;计算矩阵E2*G,求得的是节点i的4阶邻居的子图, 定义为J4;Step 2.5: To find the fourth-order neighbor of node i, first calculate G+G 2 +G 3 , set it as matrix F2, set all the numbers in matrix F2 that are not 0 to 1, and set all the numbers on the diagonal to is 0; take the i-th row of matrix F2, set it as matrix C2, change the i-th number of matrix C2 to 1, and generate a matrix E2, the diagonal is matrix C2, and the rest are 0; calculate matrix E2* G, what is obtained is the subgraph of the 4th order neighbor of node i, defined as J 4 ;
步骤2.6:求节点i的5阶邻居,首先计算G+G2+G3+G4,设定为矩阵F3, 把矩阵F3中不是0的数都置为1,并且把对角线上的数都置为0;取矩阵F3的 第i行,设为矩阵C3,把矩阵C3的第i个数改为1,生成一个矩阵E3,对角线 是矩阵C3,其余数都为0;计算矩阵E3*G,求得的是节点i的5阶邻居的子图, 定义为J5;Step 2.6: To find the fifth-order neighbors of node i, first calculate G+G 2 +G 3 +G 4 , set it as matrix F3, set all the numbers in matrix F3 that are not 0 to 1, and set All numbers are set to 0; take the i-th row of matrix F3, set it as matrix C3, change the i-th number of matrix C3 to 1, and generate a matrix E3, the diagonal line is matrix C3, and the rest of the numbers are all 0; calculate The matrix E3*G obtains the subgraph of the fifth-order neighbor of node i, which is defined as J 5 ;
步骤2.7:求节点i的6阶邻居,首先计算G+G2+G3+G4+G5,设定为矩 阵F4,把矩阵F4中不是0的数都置为1,并且把对角线上的数都置为0;取矩 阵F4的第i行,设为矩阵C4,把矩阵C4的第i个数改为1,生成一个矩阵E4, 对角线是矩阵C4,其余数都为0;计算矩阵E4*G,求得的是节点i的6阶邻居 的子图,定义为J6;Step 2.7: Find the 6th-order neighbor of node i, first calculate G+G 2 +G 3 +G 4 +G 5 , set it as matrix F4, set all the numbers in matrix F4 that are not 0 to 1, and set the diagonal The numbers on the line are all set to 0; take the i-th row of matrix F4, set it as matrix C4, change the i-th number of matrix C4 to 1, and generate a matrix E4, the diagonal line is matrix C4, and the rest of the numbers are 0; calculate the matrix E4*G, and obtain the subgraph of the 6th order neighbor of node i, which is defined as J 6 ;
步骤2.8:求节点i的7阶邻居,首先计算G+G2+G3+G4+G5+G6,设定 为矩阵F5,把矩阵F5中不是0的数都置为1,并且把对角线上的数都置为0; 取矩阵F5的第i行,设为矩阵C5,把矩阵C5的第i个数改为1,生成一个矩阵 E5,对角线是矩阵C5,其余数都为0;计算矩阵E5*G,求得的是节点i的7阶 邻居的子图,定义为J7;Step 2.8: To find the 7th-order neighbor of node i, first calculate G+G 2 +G 3 +G 4 +G 5 +G 6 , set it as matrix F5, set all the numbers in matrix F5 that are not 0 to 1, and Set all the numbers on the diagonal to 0; take the i-th row of matrix F5, set it as matrix C5, change the i-th number of matrix C5 to 1, and generate a matrix E5, the diagonal is matrix C5, and the rest The numbers are all 0; the calculation matrix E5*G obtains the subgraph of the 7th order neighbor of node i, which is defined as J 7 ;
步骤2.9:求节点i的8阶邻居,首先计算G+G2+G3+G4+G5+G6+G7, 设定为矩阵F6,把矩阵F6中不是0的数都置为1,并且把对角线上的数都置为 0;取矩阵F6的第i行,设为矩阵C6,把矩阵C6的第i个数改为1,生成一个 矩阵E6,对角线是矩阵C6,其余数都为0;计算矩阵E6*G,求得的是节点i 的8阶邻居的子图,定义为J8;Step 2.9: To find the 8th-order neighbor of node i, first calculate G+G 2 +G 3 +G 4 +G 5 +G 6 +G 7 , set it as matrix F6, and set all the numbers in matrix F6 that are not 0 to 1, and set all the numbers on the diagonal to 0; take the i-th row of matrix F6, set it as matrix C6, change the i-th number of matrix C6 to 1, and generate a matrix E6, and the diagonal is a matrix C6, the remaining numbers are all 0; calculate the matrix E6*G, obtain the subgraph of the 8th order neighbor of node i, defined as J 8 ;
步骤2.10:求节点i的9阶邻居,首先计算 G+G2+G3+G4+G5+G6+G7+G8,设定为矩阵F7,把矩阵F7中不是0的数 都置为1,并且把对角线上的数都置为0;取矩阵F7的第i行,设为矩阵C7, 把矩阵C7的第i个数改为1,生成一个矩阵E7,对角线是矩阵C7,其余数都为 0;计算矩阵E7*G,求得的是节点i的9阶邻居的子图,定义为J9;Step 2.10: Find the 9th-order neighbor of node i, first calculate G+G 2 +G 3 +G 4 +G 5 +G 6 +G 7 +G 8 , set it as matrix F7, and set the number in matrix F7 that is not 0 Set all to 1, and set all numbers on the diagonal to 0; take the i-th row of matrix F7, set it as matrix C7, change the i-th number of matrix C7 to 1, and generate a matrix E7, diagonal The line is the matrix C7, and the remaining numbers are all 0; the calculation matrix E7*G obtains the subgraph of the 9th order neighbor of node i, which is defined as J 9 ;
步骤2.11:求节点i的10阶邻居,首先计算 G+G2+G3+G4+G5+G6+G7+G8+G9设定为矩阵F8,把矩阵F8中不是0的 数都置为1,并且把对角线上的数都置为0;取矩阵F8的第i行,设为矩阵C8, 把矩阵C8的第i个数改为1,生成一个矩阵E8,对角线是矩阵C8,其余数都为 0;计算矩阵E8*G,求得的是节点i的10阶邻居的子图,定义为J10.Step 2.11: To find the 10th-order neighbor of node i, first calculate G+G 2 +G 3 +G 4 +G 5 +G 6 +G 7 +G 8 +G 9 and set it as matrix F8, and set the matrix F8 not to 0 Set all the numbers to 1, and set all the numbers on the diagonal to 0; take the i-th row of matrix F8, set it as matrix C8, change the i-th number of matrix C8 to 1, and generate a matrix E8, The diagonal line is the matrix C8, and the rest are all 0; the calculation matrix E8*G obtains the subgraph of the 10th order neighbor of node i, which is defined as J 10 .
步骤2.12:所有节点i∈V的1阶节点的子图都在J1中,所有节点i∈V的2 阶节点的子图都在J2中,所有节点i∈V的3阶节点的子图都在J3中,所有节点 i∈V的4阶节点的子图都在J4中,所有节点i∈V的5阶节点的子图都在J5中, 所有节点i∈V的6阶节点的子图都在J6中,所有节点i∈V的7阶节点的子图都 在J7中,所有节点i∈V的8阶节点的子图都在J8中,所有节点i∈V的9阶节点 的子图都在J9中,所有节点i∈V的10阶节点的子图都在J10中,把J1、J2、J3、 J4、J5、J6、J7、J8、J9、J10放在矩阵SubList中。Step 2.12: All the subgraphs of nodes i∈V’s order 1 nodes are in J1, all the subgraphs of nodes i∈V’s order 2 nodes are in J2, and all the subgraphs of nodes i∈V’s order 3 nodes The graphs are all in J3, the subgraphs of all nodes i∈V’s order 4 nodes are in J4, all the subgraphs of nodes i∈V’s order 5 nodes are in J5, and all the nodes i∈V’s 6 The subgraphs of order nodes are all in J 6 , the subgraphs of all nodes i ∈ V of order 7 are in J 7 , the subgraphs of all nodes i ∈ V of order 8 are in J 8 , and all nodes i The subgraphs of nodes of order 9 of ∈V are all in J 9 , the subgraphs of nodes of order 10 of all nodes i∈V are in J 10 , put J 1 , J 2 , J 3 , J 4 , J 5 , J 6 , J 7 , J 8 , J 9 , J 10 are placed in the matrix SubList.
步骤3:把每个节点都当成初始用户,把每个节点的t阶邻居都当成是一个 网络,让每个节点对他的t阶邻居进行R次独立级联模型传播,R是自己定义的 正整数,计算每个节点对他的t阶邻居的平均影响力,t=1,2,3,4,5,6,7,8, 9,10,具体方法为:Step 3: Treat each node as an initial user, regard each node's t-order neighbors as a network, and let each node perform R independent cascade model propagation on its t-order neighbors, and R is defined by itself Positive integer, calculate the average influence of each node on its t-order neighbors, t=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, the specific method is:
步骤3.1:定义一个正整数R,空矩阵In;Step 3.1: Define a positive integer R and an empty matrix In;
步骤3.2:计算矩阵G的每一行的和,放在矩阵degree中,矩阵degree中存 放的是每个节点的度;定义循环变量m,m∈[1,R];Step 3.2: Calculate the sum of each row of the matrix G, and put it in the matrix degree, which stores the degree of each node; define the loop variable m,m∈[1,R];
步骤3.3:如果m≤R,则跳转到步骤3.4,不然跳转到步骤3.10;Step 3.3: If m≤R, go to step 3.4, otherwise go to step 3.10;
步骤3.4:把节点i当成活跃节点,对它的邻居节点v产生影响,使v激活 的概率是p,且机会只有一次;p=1/degree,degree是步骤302中求得的节点i的度; v属于节点i的t阶邻居,t=1,2,3,4,5,6,7,8,9,10;Step 3.4: Treat node i as an active node, and have an impact on its neighbor node v, so that the probability of v activation is p, and the chance is only once; p=1/degree, degree is the degree of node i obtained in step 302 ; v belongs to the t-order neighbor of node i, t=1,2,3,4,5,6,7,8,9,10;
步骤3.5:如果节点v被激活成功,那么节点v转为活跃状态,将对其邻接 非活跃节点产生影响;否则,节点v不发生变化;Step 3.5: If node v is successfully activated, then node v becomes active, which will affect its adjacent inactive nodes; otherwise, node v will not change;
步骤3.6:重复步骤3.3和3.4,直到不能再激活新的节点,传播过程结束;Step 3.6: Repeat steps 3.3 and 3.4 until no new nodes can be activated and the propagation process ends;
步骤3.7:每个节点在t阶邻居中激活的节点的个数就是它的影响力;Step 3.7: The number of nodes activated by each node in the t-order neighbors is its influence;
步骤3.8:每个节点在它的1阶邻居中的影响力存在矩阵In1中,在它的2 阶邻居中的影响力存在矩阵In2中,在它的3阶邻居中的影响力存在矩阵In3中, 在它的4阶邻居中的影响力存在矩阵In4中,在它的5阶邻居中的影响力存在矩 阵In5中,在它的6阶邻居中的影响力存在矩阵In6中,在它的7阶邻居中的影 响力存在矩阵In7中,在它的8阶邻居中的影响力存在矩阵In8中,在它的9阶 邻居中的影响力存在矩阵In9中,在它的10阶邻居中的影响力存在矩阵In10中;Step 3.8: The influence of each node in its first-order neighbors exists in the matrix In1, the influence in its second-order neighbors exists in the matrix In2, and the influence in its third-order neighbors exists in the matrix In3 , the influence in its 4th-order neighbor exists in the matrix In4, the influence in its 5th-order neighbor exists in the matrix In5, the influence in its 6th-order neighbor exists in the matrix In6, in its 7 The influence of its neighbors of order 9 exists in the matrix In7, the influence of its neighbors of order 8 exists in matrix In8, the influence of its neighbors of order 9 exists in matrix In9, and the influence of its neighbors of order 10 exists The force exists in the matrix In10;
步骤3.9:m=m+1;Step 3.9: m=m+1;
步骤3.10:把R次求得的影响力累加起来,然后除以R,求每个节点在其t 阶邻居中的平均影响,放在矩阵In中。Step 3.10: Add up the influence obtained R times, and then divide it by R to find the average influence of each node in its t-order neighbors, and put it in the matrix In.
步骤4:把节点t阶邻居按照影响力从大到小进行排序,选取每阶邻居中影 响力最大的50个节点,通过比较,发现节点的t'阶邻居影响力最大,t=1,2,3, 4,5,6,7,8,9,10,且t'∈t,具体方法为:Step 4: Sort the t-order neighbors of nodes according to their influence from large to small, and select 50 nodes with the greatest influence among each-order neighbors. Through comparison, it is found that the t'-order neighbors of nodes have the greatest influence, t=1, 2 , 3, 4, 5, 6, 7, 8, 9, 10, and t'∈t, the specific method is:
步骤4.1:对矩阵In1,In2,In3,In4,In5,In6,In7,In8,In9,In10里面的值进行从大到 小排序;Step 4.1: Sort the values in the matrix In1, In2, In3, In4, In5, In6, In7, In8, In9, In10 from large to small;
步骤4.2:选取矩阵In1,In2,In3,In4,In5,In6,In7,In8,In9,In10中的前50个数值,按顺序放在矩阵Z1,Z2,Z3,Z4,Z5,Z6,Z7,Z8,Z9,Z10中;Step 4.2: Select the first 50 values in the matrix In1, In2, In3, In4, In5, In6, In7, In8, In9, In10, and place them in the matrix Z1, Z2, Z3, Z4, Z5, Z6, Z7, In Z8, Z9, Z10;
步骤4.3:画图,横轴是1到10,是10个数,纵轴是矩阵Z1,Z2,Z3,Z4,Z5,Z6,Z7, Z8,Z9,Z10中的数,发现在t=t'时,纵轴上的数最大,也就是节点的t'邻居影响力 最大;Step 4.3: Draw a graph, the horizontal axis is 1 to 10, which are 10 numbers, and the vertical axis is the numbers in the matrix Z1, Z2, Z3, Z4, Z5, Z6, Z7, Z8, Z9, Z10, found at t=t' When , the number on the vertical axis is the largest, that is, the t' neighbor of the node has the greatest influence;
步骤5:对节点的阶邻居中所有的节点在整个网络中进行K次独立级联模型 传播,t'是步骤5个求到的值,K是自己定义的正整数,在节点的t'阶邻居中选 取最大的S个节点作为初始用户,具体方法为:Step 5: Carry out K independent cascade model propagation for all nodes in the order neighbors of the node in the entire network, t' is the value obtained in step 5, K is a positive integer defined by yourself, and at the t' order of the node Select the largest S nodes in the neighborhood as initial users, the specific method is:
步骤5.1:定义一个正整数M,从步骤2.12中取出矩阵SubList,并从矩阵 SubList中取出矩阵Jt',t'∈[1,10];Step 5.1: Define a positive integer M, take out the matrix SubList from step 2.12, and take out the matrix J t' from the matrix SubList, t'∈[1,10];
步骤5.2:定义循环变量n,n∈[1,M],计算矩阵Jt'每一行的和,记为矩阵De, 矩阵De中存放的是节点t'阶邻居的度;Step 5.2: Define the cyclic variable n,n∈[1,M], calculate the sum of each row of the matrix J t' , and record it as the matrix De, which stores the degree of neighbors of the node t'order;
步骤5.3:如果n≤M,则跳转到步骤5.4,不然跳转到步骤5.9;Step 5.3: If n≤M, then go to step 5.4, otherwise go to step 5.9;
步骤5.4:把矩阵Jt'中的节点当成活跃节点,对它的邻居节点w产生影响, 使w激活的概率是p,且机会只有一次;p=1/degree,degree是步骤5.2中求得的矩 阵De中的数;Step 5.4: Take the node in the matrix J t' as an active node, and have an impact on its neighbor node w, so that the probability of w activation is p, and there is only one chance; p=1/degree, degree is obtained in step 5.2 The number in the matrix De;
步骤5.5:如果节点w被激活成功,那么节点w转为活跃状态,将对其邻接 非活跃节点产生影响;否则,节点w不发生变化;Step 5.5: If the node w is successfully activated, then the node w becomes active, which will affect its adjacent inactive nodes; otherwise, the node w does not change;
步骤5.6:重复步骤5.4和5.5,直到不能再激活新的节点,传播过程结束;Step 5.6: Repeat steps 5.4 and 5.5 until no new nodes can be activated and the propagation process ends;
步骤5.7:每个节点在线上产品的数据集中激活的节点的个数就是它的影响 力,记为矩阵IN;Step 5.7: The number of nodes activated by each node in the data set of online products is its influence, which is recorded as matrix IN;
步骤5.8:n=n+1;Step 5.8: n=n+1;
步骤5.9:把M次求得的影响力累加起来,然后除以M,求每个节点在整个 网络中的平均影响,全部放在矩阵LIN中;Step 5.9: Add up the influence obtained M times, and then divide by M to find the average influence of each node in the entire network, and put them all in the matrix LIN;
步骤5.10:对矩阵LIN中的值进行排序,选取值最大的S个,其对应的节 点即为初始用户。Step 5.10: Sort the values in the matrix LIN, select S with the largest value, and the corresponding node is the initial user.
本发明采用上述技术方案,具有以下有益效果:本发明针对影响力最大化问 题提出基于节点的t阶邻居快速选取种子节点的方法,通过计算节点的t阶邻居, (t=1,2…n)计算节点在其邻居子图中的影响力,通过比较,选择使得影响力较高, 效果较好的。确定后,在节点的阶邻居中选择整体影响力最大的作为种子节点。 本方法可以极大地降低计算开销和存储开销,使得选择种子节点的时间大幅度降 低,降低了时间复杂度。The present invention adopts the above-mentioned technical scheme, and has the following beneficial effects: the present invention proposes a method for quickly selecting seed nodes based on the t-order neighbors of nodes for the problem of influence maximization, by calculating the t-order neighbors of nodes, (t=1,2...n ) to calculate the influence of a node in its neighbor subgraph, and select the one with higher influence and better effect through comparison. After being determined, select the node with the greatest overall influence as the seed node among the first-order neighbors of the node. This method can greatly reduce the calculation overhead and storage overhead, so that the time for selecting seed nodes is greatly reduced, and the time complexity is reduced.
附图说明Description of drawings
图1为本发明的总体流程图Fig. 1 is the overall flow chart of the present invention
图2为图1中处理线上产品数据集的具体流程图;Fig. 2 is a specific flowchart of processing online product data sets in Fig. 1;
图3为图1中计算节点t阶邻居的具体流程图;Fig. 3 is the concrete flow chart of calculating node t order neighbor in Fig. 1;
图4为图1中计算节点平均影响力的具体流程图;Figure 4 is a specific flow chart for calculating the average influence of nodes in Figure 1;
图5为图1中选取最佳节点t’阶邻居的具体流程图;Fig. 5 is the concrete flow chart of selecting optimal node t ' order neighbor among Fig. 1;
图6为图1中选择影响力最大的线上产品推销初始用户的具体流程图;Fig. 6 is a specific flow chart of selecting the most influential online product promotion initial user in Fig. 1;
具体实施方式Detailed ways
下面结合具体实施例,进一步阐明本发明,应理解这些实施例仅用于说明本 发明而不用于限制本发明的范围,在阅读了本发明之后,本领域技术人员对本发 明的各种等价形式的修改均落于本申请所附权利要求所限定的范围。Below in conjunction with specific embodiment, further illustrate the present invention, should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention, after having read the present invention, those skilled in the art will understand various equivalent forms of the present invention All modifications fall within the scope defined by the appended claims of the present application.
如图1-6所述,本发明所述的一种线上产品推销选取初始用户的方法,具体 步骤如下:As shown in Figures 1-6, a method for selecting an initial user for online product promotion according to the present invention, the specific steps are as follows:
步骤1:对线上产品的数据集进行处理,得到真实的拓扑结构图G(V,E); 其中,V表示G中的节点集合,E表示G中的边的集合,输入P,P是独立级联 模型中一个被激活节点v激活其未激活的出度邻居节点的概率,输入S,S是选 取种子节点的个数,具体的如图2所示:Step 1: Process the data set of online products to obtain the real topology graph G(V,E); where V represents the set of nodes in G, E represents the set of edges in G, and the input P, P is In the independent cascading model, the probability that an activated node v activates its unactivated outgoing neighbor nodes, input S, S is the number of selected seed nodes, as shown in Figure 2:
步骤1.1:删除线上产品的数据集中存在的自环,得到真实的拓扑结构图 G(V,E),G是邻接矩阵;Step 1.1: Delete the self-loops existing in the data set of online products to obtain the real topology graph G(V,E), where G is the adjacency matrix;
步骤1.2:节点的势就是G中有多少个节点,边的势就是G中有多少条边, 求得节点的势m;Step 1.2: The potential of a node is how many nodes there are in G, the potential of an edge is how many edges there are in G, and the potential m of a node is obtained;
步骤1.3:独立级联是一种概率模型,当一个节点v被激活时,它会以概率P 对它未激活的出边邻居节点w尝试激活,这种尝试仅仅进行一次,而且这些尝试 之间是相互独立的,即v对w的激活不会受到其他节点的影响。概率P是实验一 开始定义的,因此在根据社交网络中用户邻居选取影响力最大化初始节点中, =1/degree。degree是节点的度,计算邻接矩阵G的每一行的和记为矩阵Degree, 是节点对应的度。Step 1.3: Independent cascading is a probabilistic model. When a node v is activated, it will try to activate its inactive outbound neighbor node w with probability P. This attempt is only made once, and between these attempts are independent of each other, that is, the activation of v on w will not be affected by other nodes. The probability P is defined at the beginning of the experiment, so in the selection of the initial nodes to maximize influence based on the user's neighbors in the social network, =1/degree. degree is the degree of the node, and the sum of each row of the adjacency matrix G is calculated as the matrix Degree, which is the degree corresponding to the node.
步骤2:计算每个节点的t阶邻居,把求得的每个节点的t阶邻居放在一个 大集合SubList里,t=1,2,3,4,5,6,7,8,9,10,具体的如图3所示:Step 2: Calculate the t-order neighbors of each node, and put the obtained t-order neighbors of each node in a large set SubList, t=1, 2, 3, 4, 5, 6, 7, 8, 9 , 10, specifically as shown in Figure 3:
步骤2.1:对步骤1.1中的邻接矩阵G的行/列进行编号,第一行/列是1,第 二行/列是2…依次标号;Step 2.1: Number the rows/columns of the adjacency matrix G in step 1.1, the first row/column is 1, the second row/column is 2... and numbered in turn;
步骤2.2:求节点i的1阶邻居,设定一个m行m列的空矩阵D,m是步骤 1.2中求得的节点的势。把矩阵D的第i行第i列的0改为1,计算矩阵D*G, 求得的是节点i的1阶邻居的子图,定义为J1;Step 2.2: Find the first-order neighbors of node i, and set an empty matrix D with m rows and m columns, where m is the potential of the node obtained in step 1.2. Change the 0 in the i-th row and the i-column of the matrix D to 1, calculate the matrix D*G, and obtain the subgraph of the first-order neighbor of the node i, which is defined as J 1 ;
步骤2.3:求节点i的2阶邻居,取邻接矩阵G的第i行,设为矩阵A,把 矩阵A的第i个数改为1,生成一个矩阵B,对角线是矩阵A,其余都为0;计 算矩阵B*G,求得的是节点i的2阶邻居的子图,定义为J2;Step 2.3: Find the second-order neighbors of node i, take the i-th row of the adjacency matrix G, set it as matrix A, change the i-th number of matrix A to 1, and generate a matrix B, the diagonal is matrix A, and the rest Both are 0; calculate the matrix B*G, and obtain the subgraph of the second-order neighbor of node i, which is defined as J 2 ;
步骤2.4:求节点i的3阶邻居,首先计算G+G*G,记为矩阵F1,把矩阵 F1中不是0的数都置为1,并且把对角线上的数都置为0;取矩阵F1的第i行, 设为矩阵C1,把矩阵C1的第i个数改为1,生成一个矩阵E1,对角线是矩阵 C1,其余数都为0;计算矩阵E1*G,求得的是节点i的3阶邻居的子图,定义 为J3;Step 2.4: To find the third-order neighbors of node i, first calculate G+G*G, record it as matrix F1, set all the numbers in matrix F1 that are not 0 to 1, and set all the numbers on the diagonal to 0; Take the i-th row of matrix F1, set it as matrix C1, change the i-th number of matrix C1 to 1, generate a matrix E1, the diagonal line is matrix C1, and the rest are all 0; calculate matrix E1*G, find The obtained subgraph is the third-order neighbor of node i, which is defined as J 3 ;
步骤2.5:求节点i的4阶邻居,首先计算G+G2+G3,设定为矩阵F2,把 矩阵F2中不是0的数都置为1,并且把对角线上的数都置为0;取矩阵F2的第 i行,设为矩阵C2,把矩阵C2的第i个数改为1,生成一个矩阵E2,对角线是 矩阵C2,其余数都为0;计算矩阵E2*G,求得的是节点i的4阶邻居的子图, 定义为J4;Step 2.5: To find the fourth-order neighbor of node i, first calculate G+G 2 +G 3 , set it as matrix F2, set all the numbers in matrix F2 that are not 0 to 1, and set all the numbers on the diagonal to is 0; take the i-th row of matrix F2, set it as matrix C2, change the i-th number of matrix C2 to 1, and generate a matrix E2, the diagonal is matrix C2, and the rest are 0; calculate matrix E2* G, what is obtained is the subgraph of the 4th order neighbor of node i, defined as J 4 ;
步骤2.6:求节点i的5阶邻居,首先计算G+G2+G3+G4,设定为矩阵F3, 把矩阵F3中不是0的数都置为1,并且把对角线上的数都置为0;取矩阵F3的 第i行,设为矩阵C3,把矩阵C3的第i个数改为1,生成一个矩阵E3,对角线 是矩阵C3,其余数都为0;计算矩阵E3*G,求得的是节点i的5阶邻居的子图, 定义为J5;Step 2.6: To find the fifth-order neighbors of node i, first calculate G+G 2 +G 3 +G 4 , set it as matrix F3, set all the numbers in matrix F3 that are not 0 to 1, and set All numbers are set to 0; take the i-th row of matrix F3, set it as matrix C3, change the i-th number of matrix C3 to 1, and generate a matrix E3, the diagonal line is matrix C3, and the rest of the numbers are all 0; calculate The matrix E3*G obtains the subgraph of the fifth-order neighbor of node i, which is defined as J 5 ;
步骤2.7:求节点i的6阶邻居,首先计算G+G2+G3+G4+G5,设定为矩 阵F4,把矩阵F4中不是0的数都置为1,并且把对角线上的数都置为0;取矩 阵F4的第i行,设为矩阵C4,把矩阵C4的第i个数改为1,生成一个矩阵E4, 对角线是矩阵C4,其余数都为0;计算矩阵E4*G,求得的是节点i的6阶邻居 的子图,定义为J6;Step 2.7: Find the 6th-order neighbor of node i, first calculate G+G 2 +G 3 +G 4 +G 5 , set it as matrix F4, set all the numbers in matrix F4 that are not 0 to 1, and set the diagonal The numbers on the line are all set to 0; take the i-th row of matrix F4, set it as matrix C4, change the i-th number of matrix C4 to 1, and generate a matrix E4, the diagonal line is matrix C4, and the rest of the numbers are 0; calculate the matrix E4*G, and obtain the subgraph of the 6th order neighbor of node i, which is defined as J 6 ;
步骤2.8:求节点i的7阶邻居,首先计算G+G2+G3+G4+G5+G6,设定 为矩阵F5,把矩阵F5中不是0的数都置为1,并且把对角线上的数都置为0; 取矩阵F5的第i行,设为矩阵C5,把矩阵C5的第i个数改为1,生成一个矩阵 E5,对角线是矩阵C5,其余数都为0;计算矩阵E5*G,求得的是节点i的7阶 邻居的子图,定义为J7;Step 2.8: To find the 7th-order neighbor of node i, first calculate G+G 2 +G 3 +G 4 +G 5 +G 6 , set it as matrix F5, set all the numbers in matrix F5 that are not 0 to 1, and Set all the numbers on the diagonal to 0; take the i-th row of matrix F5, set it as matrix C5, change the i-th number of matrix C5 to 1, and generate a matrix E5, the diagonal is matrix C5, and the rest The numbers are all 0; the calculation matrix E5*G obtains the subgraph of the 7th order neighbor of node i, which is defined as J 7 ;
步骤2.9:求节点i的8阶邻居,首先计算G+G2+G3+G4+G5+G6+G7, 设定为矩阵F6,把矩阵F6中不是0的数都置为1,并且把对角线上的数都置为 0;取矩阵F6的第i行,设为矩阵C6,把矩阵C6的第i个数改为1,生成一个 矩阵E6,对角线是矩阵C6,其余数都为0;计算矩阵E6*G,求得的是节点i 的8阶邻居的子图,定义为J8;Step 2.9: To find the 8th-order neighbor of node i, first calculate G+G 2 +G 3 +G 4 +G 5 +G 6 +G 7 , set it as matrix F6, and set all the numbers in matrix F6 that are not 0 to 1, and set all the numbers on the diagonal to 0; take the i-th row of matrix F6, set it as matrix C6, change the i-th number of matrix C6 to 1, and generate a matrix E6, and the diagonal is a matrix C6, the remaining numbers are all 0; calculate the matrix E6*G, obtain the subgraph of the 8th order neighbor of node i, defined as J 8 ;
步骤2.10:求节点i的9阶邻居,首先计算 G+G2+G3+G4+G5+G6+G7+G8,设定为矩阵F7,把矩阵F7中不是0的数 都置为1,并且把对角线上的数都置为0;取矩阵F7的第i行,设为矩阵C7, 把矩阵C7的第i个数改为1,生成一个矩阵E7,对角线是矩阵C7,其余数都为 0;计算矩阵E7*G,求得的是节点i的9阶邻居的子图,定义为J9;Step 2.10: Find the 9th-order neighbor of node i, first calculate G+G 2 +G 3 +G 4 +G 5 +G 6 +G 7 +G 8 , set it as matrix F7, and set the number in matrix F7 that is not 0 Set all to 1, and set all numbers on the diagonal to 0; take the i-th row of matrix F7, set it as matrix C7, change the i-th number of matrix C7 to 1, and generate a matrix E7, diagonal The line is the matrix C7, and the remaining numbers are all 0; the calculation matrix E7*G obtains the subgraph of the 9th order neighbor of node i, which is defined as J 9 ;
步骤2.11:求节点i的10阶邻居,首先计算 G+G2+G3+G4+G5+G6+G7+G8+G9设定为矩阵F8,把矩阵F8中不是0的 数都置为1,并且把对角线上的数都置为0;取矩阵F8的第i行,设为矩阵C8, 把矩阵C8的第i个数改为1,生成一个矩阵E8,对角线是矩阵C8,其余数都为 0;计算矩阵E8*G,求得的是节点i的10阶邻居的子图,定义为J10;Step 2.11: To find the 10th-order neighbor of node i, first calculate G+G 2 +G 3 +G 4 +G 5 +G 6 +G 7 +G 8 +G 9 and set it as matrix F8, and set the matrix F8 not to 0 Set all the numbers to 1, and set all the numbers on the diagonal to 0; take the i-th row of matrix F8, set it as matrix C8, change the i-th number of matrix C8 to 1, and generate a matrix E8, The diagonal line is the matrix C8, and the remaining numbers are all 0; the calculation matrix E8*G obtains the subgraph of the 10th order neighbor of node i, which is defined as J 10 ;
步骤2.12:所有节点i∈V的1阶节点的子图都在J1中,所有节点i∈V的2 阶节点的子图都在J2中,所有节点i∈V的3阶节点的子图都在J3中,所有节点 i∈V的4阶节点的子图都在J4中,所有节点i∈V的5阶节点的子图都在J5中, 所有节点i∈V的6阶节点的子图都在J6中,所有节点i∈V的7阶节点的子图都 在J7中,所有节点i∈V的8阶节点的子图都在J8中,所有节点i∈V的9阶节点 的子图都在J9中,所有节点i∈V的10阶节点的子图都在J10中,把J1、J2、J3、 J4、J5、J6、J7、J8、J9、J10放在矩阵SubList中。Step 2.12: All the subgraphs of nodes i∈V’s order 1 nodes are in J1, all the subgraphs of nodes i∈V’s order 2 nodes are in J2, and all the subgraphs of nodes i∈V’s order 3 nodes The graphs are all in J3, the subgraphs of all nodes i∈V’s order 4 nodes are in J4, all the subgraphs of nodes i∈V’s order 5 nodes are in J5, and all the nodes i∈V’s 6 The subgraphs of order nodes are all in J 6 , the subgraphs of all nodes i ∈ V of order 7 are in J 7 , the subgraphs of all nodes i ∈ V of order 8 are in J 8 , and all nodes i The subgraphs of nodes of order 9 of ∈V are all in J 9 , the subgraphs of nodes of order 10 of all nodes i∈V are in J 10 , and J 1 , J 2 , J 3 , J 4 , J 5 , J 6 , J 7 , J 8 , J 9 , J 10 are placed in the matrix SubList.
步骤3:把每个节点都当成初始用户,把每个节点的t阶邻居都当成是一个 网络,让每个节点对他的t阶邻居进行R次独立级联模型传播,R是自己定义的 正整数,计算每个节点对他的t阶邻居的平均影响力,t=1,2,3,4,5,6,7,8, 9,10,具体的如图4所示:Step 3: Treat each node as an initial user, regard each node's t-order neighbors as a network, and let each node perform R independent cascade model propagation on its t-order neighbors, and R is defined by itself Positive integer, calculate the average influence of each node on its t-order neighbors, t=1, 2, 3, 4, 5, 6, 7, 8, 9, 10, as shown in Figure 4:
步骤3.1:定义一个正整数R,空矩阵In;Step 3.1: Define a positive integer R and an empty matrix In;
步骤3.2:计算矩阵G的每一行的和,放在矩阵degree中,矩阵degree中存 放的是每个节点的度;定义循环变量m,m∈[1,R];Step 3.2: Calculate the sum of each row of the matrix G, and put it in the matrix degree, which stores the degree of each node; define the loop variable m,m∈[1,R];
步骤3.3:如果m≤R,则跳转到步骤3.4,不然跳转到步骤3.10;Step 3.3: If m≤R, go to step 3.4, otherwise go to step 3.10;
步骤3.4:把节点i当成活跃节点,对它的邻居节点v产生影响,使v激活 的概率是p,且机会只有一次;p=1/degree,degree是步骤302中求得的节点i的度; v属于节点i的t阶邻居,t=1,2,3,4,5,6,7,8,9,10;Step 3.4: Treat node i as an active node, and have an impact on its neighbor node v, so that the probability of v activation is p, and the chance is only once; p=1/degree, degree is the degree of node i obtained in step 302 ; v belongs to the t-order neighbor of node i, t=1,2,3,4,5,6,7,8,9,10;
步骤3.5:如果节点v被激活成功,那么节点v转为活跃状态,将对其邻接 非活跃节点产生影响;否则,节点v不发生变化;Step 3.5: If node v is successfully activated, then node v becomes active, which will affect its adjacent inactive nodes; otherwise, node v will not change;
步骤3.6:重复步骤3.3和3.4,直到不能再激活新的节点,传播过程结束;Step 3.6: Repeat steps 3.3 and 3.4 until no new nodes can be activated and the propagation process ends;
步骤3.7:每个节点在t阶邻居中激活的节点的个数就是它的影响力;Step 3.7: The number of nodes activated by each node in the t-order neighbors is its influence;
步骤3.8:每个节点在它的1阶邻居中的影响力存在矩阵In1中,在它的2 阶邻居中的影响力存在矩阵In2中,在它的3阶邻居中的影响力存在矩阵In3中, 在它的4阶邻居中的影响力存在矩阵In4中,在它的5阶邻居中的影响力存在矩 阵In5中,在它的6阶邻居中的影响力存在矩阵In6中,在它的7阶邻居中的影 响力存在矩阵In7中,在它的8阶邻居中的影响力存在矩阵In8中,在它的9阶 邻居中的影响力存在矩阵In9中,在它的10阶邻居中的影响力存在矩阵In10中;Step 3.8: The influence of each node in its first-order neighbors exists in the matrix In1, the influence in its second-order neighbors exists in the matrix In2, and the influence in its third-order neighbors exists in the matrix In3 , the influence in its 4th-order neighbor exists in the matrix In4, the influence in its 5th-order neighbor exists in the matrix In5, the influence in its 6th-order neighbor exists in the matrix In6, in its 7 The influence of its neighbors of order 9 exists in the matrix In7, the influence of its neighbors of order 8 exists in matrix In8, the influence of its neighbors of order 9 exists in matrix In9, and the influence of its neighbors of order 10 exists The force exists in the matrix In10;
步骤3.9:m=m+1;Step 3.9: m=m+1;
步骤3.10:把R次求得的影响力累加起来,然后除以R,求每个节点在其t 阶邻居中的平均影响,放在矩阵In中。Step 3.10: Add up the influence obtained R times, and then divide it by R to find the average influence of each node in its t-order neighbors, and put it in the matrix In.
步骤4:把节点t阶邻居按照影响力从大到小进行排序,选取每阶邻居中影 响力最大的50个节点,通过比较,发现节点的t'阶邻居影响力最大,t=1,2,3, 4,5,6,7,8,9,10,且t'∈t,具体的如图5所示:Step 4: Sort the t-order neighbors of nodes according to their influence from large to small, and select 50 nodes with the greatest influence among each-order neighbors. Through comparison, it is found that the t'-order neighbors of nodes have the greatest influence, t=1, 2 , 3, 4, 5, 6, 7, 8, 9, 10, and t'∈t, specifically as shown in Figure 5:
步骤4.1:对矩阵In1,In2,In3,In4,In5,In6,In7,In8,In9,In10里面的值进行从大到 小排序;Step 4.1: Sort the values in the matrix In1, In2, In3, In4, In5, In6, In7, In8, In9, In10 from large to small;
步骤4.2:选取矩阵In1,In2,In3,In4,In5,In6,In7,In8,In9,In10中的前50个数值,按顺序放在矩阵Z1,Z2,Z3,Z4,Z5,Z6,Z7,Z8,Z9,Z10中;Step 4.2: Select the first 50 values in the matrix In1, In2, In3, In4, In5, In6, In7, In8, In9, In10, and place them in the matrix Z1, Z2, Z3, Z4, Z5, Z6, Z7, In Z8, Z9, Z10;
步骤4.3:画图,横轴是1到10,是10个数,纵轴是矩阵Z1,Z2,Z3,Z4,Z5,Z6,Z7, Z8,Z9,Z10中的数,发现在t=t'时,纵轴上的数最大,也就是节点的t'邻居影响力 最大。Step 4.3: Draw a graph, the horizontal axis is 1 to 10, which are 10 numbers, and the vertical axis is the numbers in the matrix Z1, Z2, Z3, Z4, Z5, Z6, Z7, Z8, Z9, Z10, found at t=t' When , the number on the vertical axis is the largest, that is, the t' neighbors of the node have the greatest influence.
步骤5:对节点的阶邻居中所有的节点在整个网络中进行K次独立级联模型 传播,t'是步骤5个求到的值,K是自己定义的正整数,在节点的t'阶邻居中选 取最大的S个节点作为初始用户,具体的如图6所示:Step 5: Carry out K independent cascade model propagation for all nodes in the order neighbors of the node in the entire network, t' is the value obtained in step 5, K is a positive integer defined by yourself, and at the t' order of the node Select the largest S nodes in the neighborhood as initial users, as shown in Figure 6:
步骤5.1:定义一个正整数M,从步骤2.12中取出矩阵SubList,并从矩阵 SubList中取出矩阵Jt',t'∈[1,10];Step 5.1: Define a positive integer M, take out the matrix SubList from step 2.12, and take out the matrix J t' from the matrix SubList, t'∈[1,10];
步骤5.2:定义循环变量n,n∈[1,M],计算矩阵Jt'每一行的和,记为矩阵De, 矩阵De中存放的是节点t'阶邻居的度;Step 5.2: Define the cyclic variable n,n∈[1,M], calculate the sum of each row of the matrix J t' , and record it as the matrix De, which stores the degree of neighbors of the node t'order;
步骤5.3:如果n≤M,则跳转到步骤5.4,不然跳转到步骤5.9;Step 5.3: If n≤M, then go to step 5.4, otherwise go to step 5.9;
步骤5.4:把矩阵Jt'中的节点当成活跃节点,对它的邻居节点w产生影响, 使w激活的概率是p,且机会只有一次;p=1/degree,degree是步骤5.2中求得的矩 阵De中的数;Step 5.4: Take the node in the matrix J t' as an active node, and have an impact on its neighbor node w, so that the probability of w activation is p, and there is only one chance; p=1/degree, degree is obtained in step 5.2 The number in the matrix De;
步骤5.5:如果节点w被激活成功,那么节点w转为活跃状态,将对其邻接 非活跃节点产生影响;否则,节点w不发生变化;Step 5.5: If the node w is successfully activated, then the node w becomes active, which will affect its adjacent inactive nodes; otherwise, the node w does not change;
步骤5.6:重复步骤5.4和5.5,直到不能再激活新的节点,传播过程结束;Step 5.6: Repeat steps 5.4 and 5.5 until no new nodes can be activated and the propagation process ends;
步骤5.7:每个节点在线上产品的数据集中激活的节点的个数就是它的影响 力,记为矩阵IN;Step 5.7: The number of nodes activated by each node in the data set of online products is its influence, which is recorded as matrix IN;
步骤5.8:n=n+1;Step 5.8: n=n+1;
步骤5.9:把M次求得的影响力累加起来,然后除以M,求每个节点在整个 网络中的平均影响,全部放在矩阵LIN中;Step 5.9: Add up the influence obtained M times, and then divide by M to find the average influence of each node in the entire network, and put them all in the matrix LIN;
步骤5.10:对矩阵LIN中的值进行排序,选取值最大的S个,其对应的节 点即为初始用户。Step 5.10: Sort the values in the matrix LIN, select S with the largest value, and the corresponding node is the initial user.
通过在10个线上产品数据集中计算节点的t阶邻居,然后求节点在t阶邻居 中的影响力,把1,2,3,4,5,6,7,8,9,10作为横轴,表示节点的从1 到10阶邻居;每一阶邻居对应的影响力作为纵轴,进行画图比较。可以发现每 个数据集都有一个最优值,大部分的最优值是3。因此把节点的3阶邻居都作为 种子节点,计算每个节点的影响力,选取其中最大的S个作为初始用户。降低了 算法的时间复杂度和计算开销,效果也很好。By calculating the t-order neighbors of nodes in 10 online product data sets, and then calculating the influence of nodes in t-order neighbors, taking 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10 as horizontal The axis represents the neighbors of the node from order 1 to order 10; the influence corresponding to each order neighbor is used as the vertical axis for drawing comparison. It can be found that each data set has an optimal value, most of which are 3. Therefore, the third-order neighbors of the node are used as seed nodes, the influence of each node is calculated, and the largest S among them is selected as the initial user. It reduces the time complexity and calculation overhead of the algorithm, and the effect is also very good.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810637291.3A CN108960979B (en) | 2018-06-20 | 2018-06-20 | A method for selecting initial users for online product promotion |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810637291.3A CN108960979B (en) | 2018-06-20 | 2018-06-20 | A method for selecting initial users for online product promotion |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108960979A true CN108960979A (en) | 2018-12-07 |
CN108960979B CN108960979B (en) | 2021-08-31 |
Family
ID=64490245
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810637291.3A Active CN108960979B (en) | 2018-06-20 | 2018-06-20 | A method for selecting initial users for online product promotion |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108960979B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108182640A (en) * | 2017-12-29 | 2018-06-19 | 山东浪潮云服务信息科技有限公司 | A kind of method that maximizing influence problem is solved based on user behavior propagation model |
-
2018
- 2018-06-20 CN CN201810637291.3A patent/CN108960979B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108182640A (en) * | 2017-12-29 | 2018-06-19 | 山东浪潮云服务信息科技有限公司 | A kind of method that maximizing influence problem is solved based on user behavior propagation model |
Non-Patent Citations (2)
Title |
---|
刘晓东: "大规模社会网络中影响最大化问题高效处理技术研究", 《中国博士学位论文全文数据库信息科技辑》 * |
马跃华: "基于二阶邻居范围内的社交影响力分析", 《中国优秀硕士论文全文数据库信息科技辑》 * |
Also Published As
Publication number | Publication date |
---|---|
CN108960979B (en) | 2021-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Nseef et al. | An adaptive multi-population artificial bee colony algorithm for dynamic optimisation problems | |
Gong et al. | An efficient memetic algorithm for influence maximization in social networks | |
Mahmoodabadi et al. | HEPSO: high exploration particle swarm optimization | |
Merrikh-Bayat | A numerical optimization algorithm inspired by the strawberry plant | |
Sheikhahmadi et al. | Identifying influential spreaders using multi-objective artificial bee colony optimization | |
Reynolds et al. | Optimization problem solving with auctions in Cultural Algorithms | |
Karakostas | Multi-objective optimization in spatial planning: Improving the effectiveness of multi-objective evolutionary algorithms (non-dominated sorting genetic algorithm II) | |
Hassanat et al. | Enhancing genetic algorithms using multi mutations: Experimental results on the travelling salesman problem | |
Huang et al. | CPO: a crow particle optimization algorithm | |
CN104657901A (en) | Community discovery method based on label propagation in random walk | |
Templier et al. | A geometric encoding for neural network evolution | |
CN108960979A (en) | A kind of method that initial user is chosen in product distribution on line | |
Xu et al. | Discrete brain storm optimization algorithm based on prior knowledge for traveling salesman problems | |
CN114640643B (en) | Information cross-community propagation maximization method and system based on group intelligence | |
Wang et al. | Diversity and efficiency | |
Ghosh et al. | Hierarchical dynamic neighborhood based particle swarm optimization for global optimization | |
Hassanat et al. | Enhancing genetic algorithms using multi mutations | |
Dhawan et al. | Community discovery and behavior prediction in online social networks employing node centrality | |
CN114202609B (en) | Mixed heuristic graph coloring method | |
CN110084714A (en) | Social network influence power maximization approach, device and equipment based on directed tree | |
Ateme-Nguema et al. | Optimization of cellular manufacturing systems design using the hybrid approach based on the ant colony and tabu search techniques | |
Song et al. | A reinforcement learning-driven iterated greedy algorithm for traveling salesman problem | |
Azizi et al. | Satellite broadcast scheduling based on a boosted binary differential evolution | |
Wadhawan et al. | Data driven fuzzy modelling for sugeno and mamdani type fuzzy model using memetic algorithm | |
Nasa-Ngium et al. | Impacts of linnik flight usage patterns on cuckoo search for real-parameter global optimization problems |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230526 Address after: 230000 floor 1, building 2, phase I, e-commerce Park, Jinggang Road, Shushan Economic Development Zone, Hefei City, Anhui Province Patentee after: Dragon totem Technology (Hefei) Co.,Ltd. Address before: 223003 Jiangsu Huaian economic and Technological Development Zone, 1 East Road. Patentee before: HUAIYIN INSTITUTE OF TECHNOLOGY Effective date of registration: 20230526 Address after: Room 1614, No. 30 Huaxia Road, Tianhe District, Guangzhou City, Guangdong Province, 510000 Patentee after: Guangzhou Fenle Information Technology Co.,Ltd. Address before: 230000 floor 1, building 2, phase I, e-commerce Park, Jinggang Road, Shushan Economic Development Zone, Hefei City, Anhui Province Patentee before: Dragon totem Technology (Hefei) Co.,Ltd. |