给出 g 的基本简单图中顶点的顶点度列表.
DegreeCentrality[g,"In"]
给出顶点的入度列表.
DegreeCentrality[g,"Out"]
给出顶点的出度列表.
DegreeCentrality[{vw,…},…]
用规则 vw 指定图 g.
DegreeCentrality
给出 g 的基本简单图中顶点的顶点度列表.
DegreeCentrality[g,"In"]
给出顶点的入度列表.
DegreeCentrality[g,"Out"]
给出顶点的出度列表.
DegreeCentrality[{vw,…},…]
用规则 vw 指定图 g.
更多信息
- DegreeCentrality 对具有较高顶点度的顶点给出高中心度.
- 顶点
的顶点度是与
相关联的边数. - 对于一个有向图,入度是入边的数目,而出度是出边的数目.
- 对于一个无向图,入度和出度一致.
- DegreeCentrality 适用于无向图、有向图、多重图和混合图.
范例
打开所有单元 关闭所有单元基本范例 (2)
g = ExampleData[{"NetworkGraph", "Friendship"}];DegreeCentrality[g]HighlightGraph[g, VertexList[g], VertexSize -> Thread[VertexList[g] -> Rescale[%]]]g = ExampleData[{"NetworkGraph", "Friendship"}];Part[VertexList[g], Ordering[DegreeCentrality[g], All, Greater]]范围 (7)
DegreeCentrality 可用于无向图:
DegreeCentrality[[image]]DegreeCentrality[[image]]DegreeCentrality[[image]]DegreeCentrality[[image]]DegreeCentrality[{1 -> 3, 2 -> 1, 3 -> 6, 4 -> 6, 1 -> 5, 5 -> 4, 6 -> 1}]DegreeCentrality[[image], "In"]DegreeCentrality[[image], "Out"]DegreeCentrality 可用于大规模图:
g = GridGraph[{10, 10, 10, 10}];DegreeCentrality[g]//Short//Timing应用 (8)
g = [image];SortBy[{VertexList[g], DegreeCentrality[g]}, Last]//Reverse突出显示 CycleGraph 的度中心度:
HighlightCentrality[g_, cc_] := HighlightGraph[g, Table[Style[VertexList[g][[i]], ColorData["TemperatureMap"][cc[[i]] / Max[cc]]], {i, VertexCount[g]}]];g = CycleGraph[8, VertexSize -> Large];cc = DegreeCentrality[g];HighlightCentrality[g, cc]g = GridGraph[{10, 10}, VertexSize -> Large];cc = DegreeCentrality[g];HighlightCentrality[g, cc]g = CompleteKaryTree[3, 3, VertexSize -> Large];cc = DegreeCentrality[g];HighlightCentrality[g, cc]g = PathGraph[Range[20], VertexSize -> Large];cc = DegreeCentrality[g];HighlightCentrality[g, cc]g = [image];c = DegreeCentrality[g];Pick[VertexList[g], c, Max[c]]arXiv电子打印存档中的《高能物理现象》部分的引文网络,排名前10位被引用最多的文章:
g = ExampleData[{"NetworkGraph", "HighEnergyPhysicsPhenomenology"}];c = DegreeCentrality[g, "In"];Part[VertexList[g], Ordering[c, -10]]g = ExampleData[{"NetworkGraph", "SimpleFoodWeb"}]With[{d = DegreeCentrality[g, "In"]}, Pick[VertexList[g], d, 0]]With[{d = DegreeCentrality[g, "Out"]}, Pick[VertexList[g], d, 0]]2011年11月发送给 MathGroup 列表的电子邮件列表网络. 构建用户的社交网络,如果
已经发送至少一条回复给
,则构建一条从
到
的边. 求最积极回复邮件的用户:
g = [image];d = DegreeCentrality[g, "Out"];Pick[VertexList[g], d, Max[d]]Length[Pick[VertexList[g], d, 0]]d = DegreeCentrality[g, "In"];Pick[VertexList[g], d, Max[d]]Length[Pick[VertexList[g], d, 0]]g = ExampleData[{"NetworkGraph", "Internet"}];c = DegreeCentrality[g];Histogram[c, {"Log", 30}, {"Log", "SF"}]EstimatedDistribution[Tally[c][[All, -1]], ZipfDistribution[ρ]]PDF[%, k]对于具有
个顶点的图,最中心顶点和所有其他顶点之间的度中心度差值的最大和是
:
n = 10;
g = StarGraph[n];
c = DegreeCentrality[g];{Total[Max[c] - c], (n - 1)(n - 2)}centralization[g_] := With[{c = DegreeCentrality[g], n = VertexCount[g]}, N[Total[Max[c] - c] / ((n - 1)(n - 2))]]centralization[ExampleData[{"NetworkGraph", "ZacharyKarateClub"}]]centralization[ExampleData[{"NetworkGraph", "DolphinSocialNetwork"}]]属性和关系 (5)
g = [image];DegreeCentrality[g]Table[EdgeCount[g, i_], {i, VertexList[g]}]g = WheelGraph[6]DegreeCentrality[g, "In"] == DegreeCentrality[g, "Out"]使用 VertexDegree 来获得特定顶点的度数:
g = ExampleData[{"NetworkGraph", "Friendship"}];VertexDegree[g, "Anna"]对于简单图,DegreeCentrality 等于 VertexDegree:
g = [image];DegreeCentrality[SimpleGraph[g]] == VertexDegree[SimpleGraph[g]]g = Graph[{12, 23, 31, 34}]DegreeCentrality[g, "In"] + DegreeCentrality[g, "Out"]VertexDegree[g]文本
Wolfram Research (2010),DegreeCentrality,Wolfram 语言函数,https://reference.wolfram.com/language/ref/DegreeCentrality.html (更新于 2015 年).
CMS
Wolfram 语言. 2010. "DegreeCentrality." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2015. https://reference.wolfram.com/language/ref/DegreeCentrality.html.
APA
Wolfram 语言. (2010). DegreeCentrality. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/DegreeCentrality.html 年
BibTeX
@misc{reference.wolfram_2026_degreecentrality, author="Wolfram Research", title="{DegreeCentrality}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/DegreeCentrality.html}", note=[Accessed: 08-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_degreecentrality, organization={Wolfram Research}, title={DegreeCentrality}, year={2015}, url={https://reference.wolfram.com/language/ref/DegreeCentrality.html}, note=[Accessed: 08-September-2026]}