度數中心性

Python 網路分析入門

Eric Ma

Data Carpentry instructor and author of nxviz package

重要節點

  • 哪些節點很重要?
    • 度數中心性
    • 中介中心性
Python 網路分析入門

重要節點

  • 哪個中心節點可能更重要?

兩個圖形,各有一個中心節點連到所有其他節點。左圖中心節點連到 8 個節點;右圖中心節點連到 3 個節點。

Python 網路分析入門

重要節點

哪個中心節點可能更重要?

與前一張相同的兩個星形圖,左圖被反白標示。

Python 網路分析入門

度數中心性

  • 定義:

$$\frac{\text{我實際擁有的鄰居數}}{\text{我可能擁有的最大鄰居數}}$$

  • 度數中心性高的節點例子:

    • Twitter 擴散者

    • 機場轉運樞紐

    • 疾病超級傳播者

Python 網路分析入門

鄰居數量

G.edges()
EdgeView([(1, 2), (1, 3), (1, 4), (1, 5), (1, 6), (1, 7), (1, 8), (1, 9)])
list(G.neighbors(1))
[2, 3, 4, 5, 6, 7, 8, 9]
list(G.neighbors(8))
[1]
list(G.neighbors(10))
NetworkXError: The node 10 is not in the graph.
Python 網路分析入門

度數中心性

nx.degree_centrality(G)
{1: 1.0,
 2: 0.125,
 3: 0.125,
 4: 0.125,
 5: 0.125,
 6: 0.125,
 7: 0.125,
 8: 0.125,
 9: 0.125}
Python 網路分析入門

一起來練習吧!

Python 網路分析入門

Preparing Video For Download...