EdgeCount
范例
打开所有单元 关闭所有单元基本范例 (2)
范围 (7)
EdgeCount 对无向图起作用:
EdgeCount[[image]]EdgeCount[[image]]EdgeCount[[image]]EdgeCount[[image]]EdgeCount[{1 -> 2, 2 -> 3, 3 -> 1}]g = Graph[{12, 21, a1, a2, b1, b2, bb}]EdgeCount[g, _Integer_]EdgeCount[g, a_ | b_]EdgeCount[{1 -> 2, 2 -> 1, a -> 1, a -> 2, b -> 1, b -> 2, b -> b}, _Integer_]g = GridGraph[{10, 10, 10, 10}];Timing[EdgeCount[g]]推广和延伸 (1)
EdgeCount[ButterflyGraph[n, b]]EdgeCount[CompleteGraph[n]]EdgeCount[CompleteKaryTree[level, k]]EdgeCount[CycleGraph[n]]EdgeCount[DeBruijnGraph[m, n]]EdgeCount[GridGraph[{n, m, l}]]EdgeCount[HararyGraph[k, n]]EdgeCount[HypercubeGraph[n]]EdgeCount[KaryTree[n]]EdgeCount[KnightTourGraph[m, n]]EdgeCount[StarGraph[n]]EdgeCount[WheelGraph[n]]应用 (2)
g = PetersenGraph[5, 2]{ConnectedGraphQ[g], EdgeCount[g] ≥ VertexCount[g] - 1}g = PathGraph[Range[20]]{ConnectedGraphQ[g], EdgeCount[g] ≥ VertexCount[g] - 1}在概率为
的 Bernoulli 图中,
个顶点上的边数具有均值
:
{n, p} = {9, 0.7};
data = EdgeCount /@ RandomGraph[BernoulliGraphDistribution[n, p], 2000];{Mean[data]//N, p Binomial[n, 2]}{StandardDeviation[data]//N, Sqrt[p(1 - p)Binomial[n, 2]]}Histogram[data, PlotLabel -> EdgeCount]属性和关系 (7)
CompleteGraph[n] 的边数为:
EdgeCount[CompleteGraph[n]]g = CompleteGraph[5]EdgeCount[g]Length[EdgeList[g]]g = CompleteGraph[5, DirectedEdges -> True]EdgeCount[g]Total[AdjacencyMatrix[g], 2]Dimensions[IncidenceMatrix[g]]g = CompleteGraph[5]EdgeCount[g]Total[Table[Diagonal[AdjacencyMatrix[g], k], {k, 0, 5}], 2]Dimensions[IncidenceMatrix[g]]Total[Diagonal[KirchhoffMatrix[g]]] / 2g = CompleteGraph[5]EdgeCount[g] == VertexCount[LineGraph[g]]g = PetersenGraph[5, 2]Total[VertexDegree[g]] == 2EdgeCount[g]{g = Graph[{12, 23, 31}], UndirectedGraph[g]}EdgeCount /@ %文本
Wolfram Research (2010),EdgeCount,Wolfram 语言函数,https://reference.wolfram.com/language/ref/EdgeCount.html (更新于 2015 年).
CMS
Wolfram 语言. 2010. "EdgeCount." Wolfram 语言与系统参考资料中心. Wolfram Research. 最新版本 2015. https://reference.wolfram.com/language/ref/EdgeCount.html.
APA
Wolfram 语言. (2010). EdgeCount. Wolfram 语言与系统参考资料中心. 追溯自 https://reference.wolfram.com/language/ref/EdgeCount.html 年
BibTeX
@misc{reference.wolfram_2026_edgecount, author="Wolfram Research", title="{EdgeCount}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/EdgeCount.html}", note=[Accessed: 15-September-2026]}
BibLaTeX
@online{reference.wolfram_2026_edgecount, organization={Wolfram Research}, title={EdgeCount}, year={2015}, url={https://reference.wolfram.com/language/ref/EdgeCount.html}, note=[Accessed: 15-September-2026]}