グラフ g 中のすべての頂点ペア間の平均距離を与える.
MeanGraphDistance[{vw,…}]
規則 vw を使ってグラフ g を指定する.
MeanGraphDistance
グラフ g 中のすべての頂点ペア間の平均距離を与える.
MeanGraphDistance[{vw,…}]
規則 vw を使ってグラフ g を指定する.
詳細とオプション
- MeanGraphDistanceは平均経路長としても知られている.
- MeanGraphDistance[g]は,g の頂点間のすべての最短路の平均の長さである.
- MeanGraphDistanceは,以下のオプションを取る.
-
Method Automatic 使用するメソッド WorkingPrecision Automatic 内部計算精度
例題
すべて開く すべて閉じる例 (2)
スコープ (7)
MeanGraphDistanceは無向グラフに使うことができる:
MeanGraphDistance[[image]]MeanGraphDistance[[image]]MeanGraphDistance[[image]]MeanGraphDistance[[image]]MeanGraphDistance[[image]]MeanGraphDistance[{1 -> 2, 2 -> 3, 3 -> 1, 3 -> 4, 4 -> 5, 3 -> 5, 5 -> 2}]MeanGraphDistanceは,大きいグラフに使うことができる:
g = GridGraph[{10, 10, 10, 10}];MeanGraphDistance[g]//Timingオプション (2)
Method (2)
MeanGraphDistance[[image]]Method->"UnitWeight"を使って辺の重みを無視する:
MeanGraphDistance[[image], Method -> "UnitWeight"]アプリケーション (4)
2000年秋期レギュラーシーズンのディヴィジョンIAの大学間のアメリカンフットボールの試合のネットワーク.1つのチームと他のチームを結ぶ平均ゲーム数は2.5である:
ExampleData[{"NetworkGraph", "AmericanCollegeFootball"}]N[MeanGraphDistance[%]]ドキュメントの関連項目で結ばれた,グラフ理論に関連するWolfram言語の1つの関数から他の関数へリンクをたどって行き着くまでに,平均で5回強のクリックとなる:
N[MeanGraphDistance[[image]]]ごく少数の俳優がかかわっているケヴィンベーコンゲームで無作為に選んだ2人の俳優が共演した回数の分布:
g = \!\(\*GraphicsBox[«5»]\);data = Table[GraphDistance[g, RandomChoice[VertexList[g]], RandomChoice[VertexList[g]]], {10000}];Histogram[data]N[MeanGraphDistance[g]]WattsStrogatzGraphDistributionでモデル化されたソーシャルネットワークでモデル中の2人を結びつける関係数の平均の分布:
f[g_] := MeanGraphDistance[g] /. {∞ -> VertexCount[g] + 1}𝒟 = GraphPropertyDistribution[f[g], gWattsStrogatzGraphDistribution[50, 0.1, 3]];Histogram[RandomVariate[𝒟, 1000]]NProbability[x > 3, x𝒟, PrecisionGoal -> 1]特性と関係 (5)
MeanGraphDistance はGraphDistanceMatrixの非対角平均を与える:
g = KnightTourGraph[4, 3]MeanGraphDistance[g]GraphDistanceMatrixの対角が0のときの非対角平均を計算する:
a = GraphDistanceMatrix[g];Diagonal[a]Total[Flatten[a]] / (Length[Flatten[a]] - Length[Diagonal[a]])CirculantGraph[8, {1, 2, 3}]N[MeanGraphDistance[%]]WeightedAdjacencyGraph[(| | | | |
| --- | --- | --- | --- |
| ∞ | 0.1 | 0.2 | 0.1 |
| 0.1 | ∞ | 0.2 | ∞ |
| 0.2 | 0.2 | ∞ | 0.1 |
| 0.1 | ∞ | 0.1 | ∞ |), EdgeLabels -> "EdgeWeight"]MeanGraphDistance[%]g の平均グラフ距離はg が完全グラフであるときかつそのときに限り1である:
{g = Graph[{12, 23, 31}], h = Graph[{12, 13, 21, 31, 32}]}{MeanGraphDistance[g], MeanGraphDistance[h]}CompleteGraphQを使って完全グラフかどうかを調べる:
{CompleteGraphQ[g], CompleteGraphQ[h]}非連結グラフの平均グラフ距離はInfinityである:
g = Graph[{12, 34}]MeanGraphDistance[g]ConnectedGraphQを使って連結グラフかどうかを調べる:
ConnectedGraphQ[g]MeanGraphDistanceを使ってGraphLinkEfficiencyを求めることができる:
g = CompleteKaryTree[3, 3]1 - MeanGraphDistance[g] / EdgeCount[g]% == GraphLinkEfficiency[g]関連するガイド
テキスト
Wolfram Research (2012), MeanGraphDistance, Wolfram言語関数, https://reference.wolfram.com/language/ref/MeanGraphDistance.html (2015年に更新).
CMS
Wolfram Language. 2012. "MeanGraphDistance." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/MeanGraphDistance.html.
APA
Wolfram Language. (2012). MeanGraphDistance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MeanGraphDistance.html
BibTeX
@misc{reference.wolfram_2026_meangraphdistance, author="Wolfram Research", title="{MeanGraphDistance}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/MeanGraphDistance.html}", note=[Accessed: 04-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_meangraphdistance, organization={Wolfram Research}, title={MeanGraphDistance}, year={2015}, url={https://reference.wolfram.com/language/ref/MeanGraphDistance.html}, note=[Accessed: 04-November-2026]}