资源简介
论文SCAN: A Structural Clustering Algorithm for Networks。 It detects clusters, hubs and outliers in networks.【簇(cluster)、桥节点(hub)、离群节点(outlier)】
代码片段和文件信息
import networkx as nx
import random
from similarity import cal_similarity
‘‘‘
paper : <>
‘‘‘
class SCAN():
def __init__(self G epsilon=0.5 mu=3):
self._G = G
self._epsilon = epsilon
self._mu = mu
def get_epsilon_neighbor(self node):
return [neighbor for neighbor in self._G.neighbors(node) if cal_similarity(self._Gnode neighbor) >= self._epsilon]
def is_core(self node):
return len(self.get_epsilon_neighbor(node)) >= self._mu
def get_hubs_outliers(self communities):
other_nodes = set(self._G.node.keys())
node_community = {}
for ic in enumerate(communities):
for node in c:
other_nodes.discard(node)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3586 2019-05-07 15:17 SCAN.py
文件 719 2017-09-07 10:34 similarity.py
评论
共有 条评论