Algorithms for Local Triangle Counting in Massive Graphs
”对此有介绍。
•
研究
Facebook
社交图的社团结构,比如一些研究人员在一张看起来稀疏的全球社交图
中发现了稠密的用户友邻关系。
•
探测
Web
的主题结构,并且基于网页间的相互链接来发现网页社团的共同主题。更
多相关信息,参见
Jean-Pierre Eckmann
和
Elisha Moses
的文章“
Curvature of Co-Links
Uncovers Hidden Thematic Layers in the World Wide Web
”。
6.2.4
使用
Spark
实现三角形计数算法
准备运行三角形计数算法,实现代码如下:
result = g.triangleCount()
(result.sort("count", ascending=False)
.filter('count > 0')
.show())
在
PySpark
中运行这段代码,输出结果如下所示:
countid
1jupyter
1python-dateutil
1six
1ipykernel
1matplotlib
1jpy-console
结果表明一个节点的两个邻节点也相邻。
6
个库都位于这样的三角形中。
如果还想知道这些三角形中都有哪些节点,就要涉及三角形流了 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.