Qurak

Degree centrality in social networks

範例 共 3 個步驟,在同一個工作階段中依序執行。每一步都在引擎上實際執行過,下方的輸出就是它產生的結果。

步驟 1
g = ExampleData[{"NetworkGraph", "FamilyGathering"}];

沒有輸出——這個步驟是在為下一步做準備。

步驟 2
Part[VertexList[g], Ordering[EigenvectorCentrality[g], All, Greater]]
輸出
VertexList[ExampleData[{NetworkGraph, FamilyGathering}]]
步驟 3
cc = DegreeCentrality[g];
HighlightGraph[g, Table[Style[VertexList[g][[i]], ColorData["TemperatureMap"][cc[[i]] / Max[cc]]], {i, VertexCount[g]}], ImageSize -> 300]
輸出
HighlightGraph[ExampleData[{NetworkGraph, FamilyGathering}], Table[VertexList[g][[i]], {i, VertexCount[g]}], ImageSize -> 300]

使用到的函式

相關的操作範例

所有操作範例 · 函式參考 · 從 MCP 用戶端使用這個