社群與小圈圈

Python 網路分析入門

Eric Ma

Data Carpentry instructor and author of nxviz package

Cliques(小圈圈)

  • 社交小圈圈:緊密相連的群體
  • 網路 clique:完全連通的圖

幫派圖。每個節點都連到其他所有節點。

Python 網路分析入門

Cliques(小圈圈)

  • 最簡的複雜 clique:三角形

含三個節點的 clique,看起來像三角形。

Python 網路分析入門

三角形的應用

  • 好友推薦系統

一個含三個節點的圖。一個節點連到另外兩個節點。未連的那兩個節點之間以虛線標示。

Python 網路分析入門

Clique 程式碼

G
<networkx.classes.graph.Graph at 0x10c99ecf8>
from itertools import combinations

for n1, n2 in combinations(G.nodes(), 2): print(n1, n2)
0 1
0 2
0 3
0 4
0 5
...
Python 網路分析入門

一起來練習吧!

Python 網路分析入門

Preparing Video For Download...