尋找幫派(I)

Python 網路分析入門

Eric Ma

Data Carpentry instructor and author of nxviz package

幫派(Cliques)

  • 定義:
    • 節點群組
    • 完全連通
  • 最簡幫派:邊
  • 最簡複雜幫派:三角形
Python 網路分析入門

極大幫派

  • 定義:
    • 一個幫派
    • 不能再加入節點擴充
Python 網路分析入門

尋找幫派

import networkx as nx
G = nx.erdos_renyi_graph(n=100, p=0.15)

nx.find_cliques(G)
<generator object find_cliques at 0x10ca8bca8>
for clique in nx.find_cliques(G):
    print(len(clique))
Python 網路分析入門

一起來練習吧!

Python 網路分析入門

Preparing Video For Download...