Exemplo n.º 1
0
 def getMvalueByAdd(self,seedKey,cliqueDic,node):
         oldLC = self.cliqueLCvalueDic[seedKey]
         oldDC = self.cliqueDCvalueDic[seedKey]
         clique = cliqueDic[seedKey]
         addLC = len(self.interestDic[node] & clique) + len(self.fanDic[node] & clique)
         addDC = len(self.interestDic[node]) + len(self.fanDic[node]) - addLC
         M = graphTool.calModularityOfOneClique(float(self.m),oldLC+addLC,oldDC+addDC)
         return M/float(len(clique)+1)
Exemplo n.º 2
0
 def getMvalueByAdd(self, seedKey, cliqueDic, node):
     oldLC = self.cliqueLCvalueDic[seedKey]
     oldDC = self.cliqueDCvalueDic[seedKey]
     clique = cliqueDic[seedKey]
     addLC = len(self.interestDic[node] & clique) + len(self.fanDic[node]
                                                        & clique)
     addDC = len(self.interestDic[node]) + len(self.fanDic[node]) - addLC
     M = graphTool.calModularityOfOneClique(float(self.m), oldLC + addLC,
                                            oldDC + addDC)
     return M / float(len(clique) + 1)
Exemplo n.º 3
0
	def getCliqueDic(self,cliqueList):
		count = 1
		cliqueDic = {}
		cliqueMvalueDic = {}
                self.cliqueLCvalueDic = {}
                self.cliqueDCvalueDic = {}
		for i in cliqueList:
			cliqueDic[count] = i
                        interestNumInCliqueDic = graphTool.getConnectNumDicJoiningClique(i,self.interestDic)
                        lc = graphTool.calLC(interestNumInCliqueDic)
                        self.cliqueLCvalueDic[count] = lc
                        dc = graphTool.calDC(i,self.interestNumDic,self.fanNumDic,lc)
                        self.cliqueDCvalueDic[count] = dc
			cliqueMvalueDic[count] = graphTool.calModularityOfOneClique(self.m,lc,dc)/float(len(i))
			count += 1
		return cliqueDic,cliqueMvalueDic
Exemplo n.º 4
0
 def getCliqueDic(self, cliqueList):
     count = 1
     cliqueDic = {}
     cliqueMvalueDic = {}
     self.cliqueLCvalueDic = {}
     self.cliqueDCvalueDic = {}
     for i in cliqueList:
         cliqueDic[count] = i
         interestNumInCliqueDic = graphTool.getConnectNumDicJoiningClique(
             i, self.interestDic)
         lc = graphTool.calLC(interestNumInCliqueDic)
         self.cliqueLCvalueDic[count] = lc
         dc = graphTool.calDC(i, self.interestNumDic, self.fanNumDic, lc)
         self.cliqueDCvalueDic[count] = dc
         cliqueMvalueDic[count] = graphTool.calModularityOfOneClique(
             self.m, lc, dc) / float(len(i))
         count += 1
     return cliqueDic, cliqueMvalueDic