TuranGraph[n,k]
n 個の頂点を持つ k 個に分裂したTuránグラフ
を与える.
TuranGraph
TuranGraph[n,k]
n 個の頂点を持つ k 個に分裂したTuránグラフ
を与える.
詳細とオプション
- TuranGraphは,最大限の飽和グラフとしても知られている.
- Turánグラフ
は n 個の頂点を持つ完全 k 部グラフである.グラフの分割集合は可能な限り等しい濃度である. - Turánグラフ
は完全 k 部グラフCompleteGraph[{n1,…,nk}]に等しい.ただし,ni は
または
である. - TuranGraphにはGraphと同じオプションが使える.
全オプションのリスト
例題
すべて開く すべて閉じる例 (1)
オプション (80)
AnnotationRules (3)
TuranGraph[5, 2, AnnotationRules -> {1 -> {VertexLabels -> "hello"}}]TuranGraph[5, 2, AnnotationRules -> {14 -> {EdgeLabels -> "hello"}}]TuranGraph[5, 2, AnnotationRules -> {"GraphProperties" -> {"Message" -> "hello"}}]AnnotationValue[%, "Message"]EdgeLabels (7)
TuranGraph[5, 2, EdgeLabels -> {14 -> "Hello"}]el = EdgeList[TuranGraph[5, 3]]TuranGraph[5, 3, EdgeLabels -> Table[el[[i]] -> Subscript["e", i], {i, Length[el]}]]TuranGraph[5, 2, EdgeLabels -> {14 -> [image], 24 -> [image], 35 -> [image]}]Placedを記号位置と一緒に使って辺に沿ったラベルの置き方を制御する:
Table[TuranGraph[5, 2, EdgeLabels -> {35 -> Placed["■■■", p]}, PlotLabel -> p], {p, {"Start", "Middle", "End"}}]Table[TuranGraph[5, 2, EdgeLabels -> {14 -> Placed["■■■", p]}, PlotLabel -> p, BaselinePosition -> Bottom], {p, {0, 1 / 4, 1 / 3}}]Table[TuranGraph[5, 2, EdgeLabels -> {14 -> Placed["■■■", {1 / 2, p}]}, PlotLabel -> p, BaselinePosition -> Bottom], {p, {{0, 0}, {1 / 2, 1 / 2}, {1, 1}}}]TuranGraph[5, 2, EdgeLabels -> {14 -> Placed[{"lbl1", "lbl2"}, {"Start", "End"}]}]TuranGraph[5, 2, EdgeLabels -> {14 -> Placed[{"lbl1", "lbl2", "lbl3"}, {"Start", "Middle", "End"}]}]TooltipとStatusAreaからの値で自動的にラベルを付ける:
TuranGraph[5, 2, EdgeLabels -> Placed["Name", Tooltip]]TuranGraph[5, 2, EdgeLabels -> Placed["Name", StatusArea]]EdgeShapeFunction (6)
EdgeShapeFunctionの組込み設定のリストを得る:
ResourceData["EdgeShapeFunction"]TuranGraph[5, 2, EdgeShapeFunction -> "Line"]Table[TuranGraph[5, 2, EdgeShapeFunction -> {{ef, "ArrowSize" -> 0.1}}, PlotLabel -> ef], {ef, {"BoxLine", "DiamondLine", "DotLine"}}]Table[TuranGraph[5, 2, EdgeShapeFunction -> {{ef, "ArrowSize" -> 0.1}}, PlotLabel -> ef], {ef, ResourceData["EdgeShapeFunction", "FilledArrow"]}]Table[TuranGraph[5, 2, EdgeShapeFunction -> {{ef, "ArrowSize" -> 0.1}}, PlotLabel -> ef], {ef, ResourceData["EdgeShapeFunction", "UnfilledArrow"]}]Table[TuranGraph[5, 2, EdgeShapeFunction -> {{ef, "ArrowSize" -> 0.1}}, PlotLabel -> ef], {ef, ResourceData["EdgeShapeFunction", "CarvedArrow"]}]TuranGraph[5, 2, EdgeShapeFunction -> {14 -> "DotLine"}]TuranGraph[5, 2, EdgeShapeFunction -> {14 -> "BoxLine", "DotLine"}]ef[pts_List, e_] :=
Block[{s = 0.015, g = [image]}, {Arrowheads[{{s, 0.33, g}, {s, 0.67, g}}], Arrow[pts]}]TuranGraph[5, 2, EdgeShapeFunction -> ef]EdgeShapeFunctionはEdgeStyleと組み合せることができる:
TuranGraph[5, 2, EdgeStyle -> Blue, EdgeShapeFunction -> (Line[#1]&)]EdgeShapeFunctionはEdgeStyleより優先順位が高い:
TuranGraph[5, 2, EdgeStyle -> Blue, EdgeShapeFunction -> ({Red, Line[#1]}&)]EdgeStyle (2)
EdgeWeight (2)
TuranGraph[5, 2, EdgeWeight -> RandomInteger[5, 6]]WeightedAdjacencyMatrix[%]//MatrixFormTuranGraph[5, 2, EdgeWeight -> {a, b, c, d, e, f}]WeightedAdjacencyMatrix[%]//MatrixFormGraphHighlight (3)
GraphHighlightStyle (2)
GraphHighlightStyleの組込み設定のリストを得る:
ResourceData["GraphHighlightStyle"]GraphHighlightStyleの組込み設定を使う:
TuranGraph[5, 2, GraphHighlight -> {1, 14}, VertexSize -> Small, GraphHighlightStyle -> #, PlotLabel -> #]& /@ Select[ResourceData["GraphHighlightStyle"], # =!= Automatic&]GraphLayout (5)
TuranGraph[5, 3, GraphLayout -> Automatic]Table[TuranGraph[10, 4, GraphLayout -> l, PlotLabel -> l], {l, {"CircularEmbedding", "SpiralEmbedding"}}]Table[TuranGraph[10, 4, GraphLayout -> l, PlotLabel -> l], {l, {"SpringEmbedding", "SpringElectricalEmbedding", "HighDimensionalEmbedding"}}]VertexCoordinatesはGraphLayoutの座標を無効にする:
{TuranGraph[5, 3, GraphLayout -> "SpringElectricalEmbedding"],
TuranGraph[5, 3, GraphLayout -> "SpringElectricalEmbedding", VertexCoordinates -> Table[{i, i}, {i, 0, 4}]]}AbsoluteOptionsを使ってレイアウトアルゴリズムで計算されたVertexCoordinatesを抽出する:
TuranGraph[5, 3]AbsoluteOptions[%, VertexCoordinates]PlotTheme (4)
基本的なテーマ (2)
VertexCoordinates (3)
TuranGraph[5, 3]AbsoluteOptionsを使って結果の頂点座標を抽出する:
AbsoluteOptions[%, VertexCoordinates]ellipseLayout[n_, {a_, b_}] := Table[{a Cos[2Pi / n u], b Sin[2Pi / n u]}, {u, 1, n}]Graphics[Point[ellipseLayout[10, {2, 1}]]]TuranGraph[10, 3, VertexCoordinates -> ellipseLayout[10, {2, 1}]]VertexCoordinatesはGraphLayoutより優先順位が高い:
TuranGraph[5, 3, VertexCoordinates -> Table[{i, i}, {i, 5}], GraphLayout -> "CircularEmbedding"]VertexLabels (13)
TuranGraph[5, 3, VertexLabels -> "Name"]TuranGraph[5, 3, VertexLabels -> {2 -> "one"}]TuranGraph[5, 3, VertexLabels -> Table[i -> Subscript[v, i], {i, 5}]]TuranGraph[5, 3, VertexLabels -> {1 -> [image], 2 -> [image], 3 -> [image]}]Placedを記号位置と一緒に使って外側位置を含むラベルの置き方を制御する:
Table[TuranGraph[5, 2, VertexSize -> 0.1, VertexShapeFunction -> "Square", VertexLabels -> Table[i -> Placed["■■■", p], {i, 5}], PlotLabel -> p, ImagePadding -> 20], {p, {Before, After, Below, Above}}]pl = {{Before, Below}, {After, Below}, {Before, Above}, {After, Above}};Table[TuranGraph[5, 2, VertexSize -> 0.1, VertexShapeFunction -> "Square", ImagePadding -> 20, VertexLabels -> Table[i -> Placed["■■■", p], {i, 5}], PlotLabel -> p], {p, pl}]Table[TuranGraph[5, 2, VertexSize -> 0.55, VertexLabels -> Table[i -> Placed["■■■", p], {i, 5}], VertexShapeFunction -> "Square", PlotLabel -> p], {p, {Left, Top, Right, Bottom}}]pl = {{Left, Bottom}, {Right, Bottom}, {Left, Top}, {Right, Top}};Table[TuranGraph[5, 2, VertexSize -> 0.55, VertexShapeFunction -> "Square", VertexLabels -> Table[i -> Placed["■■■", p], {i, 5}], PlotLabel -> p], {p, pl}]Table[TuranGraph[5, 2, VertexSize -> 0.35, VertexShapeFunction -> "Square", VertexLabels -> Table[i -> Placed[[image], p], {i, 5}], PlotLabel -> p, BaselinePosition -> Bottom], {p, {{0, 0}, {1 / 2, 1 / 2}, {1, 1}}}]すべてのラベルを頂点の右上コーナー位置に置き,ラベル内の座標を変化させる:
Table[TuranGraph[5, 2, VertexSize -> 0.35, VertexShapeFunction -> "Square", VertexLabels -> Table[i -> Placed[[image], {{1, 1}, p}], {i, 5}], PlotLabel -> p, BaselinePosition -> Bottom], {p, {{0, 0}, {1 / 2, 1 / 2}, {1, 1}}}]TuranGraph[5, 3, VertexLabels -> {1 -> Placed[{"lbl1", "lbl2"}, {Above, Below}]}]TuranGraph[5, 3, VertexLabels -> {1 -> Placed[{"lbl1", "lbl2", "lbl3", "lbl4"}, {Above, After, Below, Before}]}]Placedの引数を使ってTooltipを含むフォーマットを制御する:
TuranGraph[5, 3, VertexLabels -> Placed["Name", Tooltip]]あるいはStatusAreaを含むフォーマットを制御する:
TuranGraph[5, 3, VertexLabels -> Placed["Name", StatusArea]]rotateLabel[lab_] := Rotate[lab, 45Degree]TuranGraph[5, 3, VertexLabels -> Table[i -> Placed["xxx", Below, rotateLabel], {i, 5}]]panelLabel[lab_] := Panel[lab, FrameMargins -> 0, Background -> Lighter[Yellow, 0.7]]TuranGraph[5, 3, VertexLabels -> Table[i -> Placed["xxx", Center, panelLabel], {i, 5}]]hyperlinkLabel[lab_] := Hyperlink[lab, "http://www.wolfram.com"]TuranGraph[5, 3, VertexLabels -> Table[i -> Placed["xxx", Center, hyperlinkLabel], {i, 5}]]VertexShape (5)
Graphics,ImageあるいはGraphics3Dを頂点の形に使う:
Table[TuranGraph[5, 3, VertexShape -> s, VertexSize -> Medium], {s, {[image], [image], [image]}}]TuranGraph[5, 3, VertexShape -> {2 -> [image]}, VertexSize -> Medium]VertexShapeはVertexSizeと組み合せることができる:
Table[TuranGraph[5, 3, VertexSize -> s, VertexShape -> [image], PlotLabel -> s], {s, {Small, Large}}]VertexShapeはVertexStyleの影響を受けない:
TuranGraph[5, 3, VertexSize -> 0.2, VertexShape -> [image], VertexStyle -> Blue]VertexShapeFunctionはVertexShapeより優先順位が高い:
TuranGraph[5, 3, VertexSize -> 0.2, VertexShapeFunction -> "Square", VertexShape -> [image]]VertexShapeFunction (10)
組込みのVertexShapeFunctionコレクションのリストを得る:
ResourceData["VertexShapeFunction"]"Basic"コレクションのVertexShapeFunctionの組込み設定を使う:
ResourceData["VertexShapeFunction", "Basic"]Table[TuranGraph[5, 3, VertexShapeFunction -> vf, VertexSize -> 0.2, PlotLabel -> vf], {vf, {"Triangle", "Square", "Rectangle", "Pentagon", "Hexagon", "Octagon"}}]Table[TuranGraph[5, 3, VertexShapeFunction -> vf, VertexSize -> 0.2, PlotLabel -> vf], {vf, {"DownTrapezoid", "UpTrapezoid", "Parallelogram", "FiveDown", "Circle", "Diamond", "Star", "Capsule"}}]"Rounded"コレクションのVertexShapeFunctionの組込み設定を使う:
ResourceData["VertexShapeFunction", "Rounded"]Table[TuranGraph[5, 3, VertexShapeFunction -> vf, VertexSize -> 0.2, PlotLabel -> vf], {vf, ResourceData["VertexShapeFunction", "Rounded"]}]"Concave"コレクションのVertexShapeFunctionの組込み設定を使う:
ResourceData["VertexShapeFunction", "Concave"]Table[TuranGraph[5, 3, VertexShapeFunction -> vf, VertexSize -> 0.2, PlotLabel -> vf], {vf, ResourceData["VertexShapeFunction", "Concave"]}]TuranGraph[5, 3, VertexShapeFunction -> { 1 -> "Square"}, VertexSize -> 0.2]TuranGraph[5, 3, VertexShapeFunction -> { 1 -> "Square", "Triangle"}, VertexSize -> 0.2]TuranGraph[5, 3, VertexShapeFunction -> (Inset[[image], #]&)]vf[{xc_, yc_}, name_, {w_, h_}] :=
Block[{xmin = xc - w, xmax = xc + w, ymin = yc - h, ymax = yc + h},
Polygon[{{xmin, ymin}, {xmax, ymax}, {xmin, ymax}, {xmax, ymin}}]
];TuranGraph[5, 3, VertexShapeFunction -> vf, VertexSize -> 0.2]VertexShapeFunctionはVertexStyleと組み合せることができる:
vf1[{xc_, yc_}, name_, {w_, h_}] := Rectangle[{xc - w, yc - h}, {xc + w, yc + h}]TuranGraph[5, 3, VertexSize -> 0.2, VertexStyle -> Blue, VertexShapeFunction -> vf1]VertexShapeFunctionはVertexStyleより優先順位が高い:
vf2[{xc_, yc_}, name_, {w_, h_}] := {Red, Rectangle[{xc - w, yc - h}, {xc + w, yc + h}]}TuranGraph[5, 3, VertexSize -> 0.2, VertexStyle -> Blue, VertexShapeFunction -> vf2]VertexShapeFunctionはVertexSizeと組み合せることができる:
TuranGraph[5, 3, VertexShapeFunction -> "Star", VertexSize -> {1 -> Small, Medium}]VertexShapeFunctionはVertexShapeより優先順位が高い:
TuranGraph[5, 3, VertexSize -> 0.3, VertexShapeFunction -> "Star", VertexShape -> [image]]VertexSize (8)
TuranGraph[5, 3, VertexSize -> Automatic]Table[TuranGraph[5, 3, VertexSize -> s, PlotLabel -> s], {s, {Tiny, Small, Medium, Large}}]Table[TuranGraph[5, 3, VertexSize -> s, PlotLabel -> s], {s, 0.1, 1, 0.3}]Table[TuranGraph[5, 3, VertexSize -> {"Scaled", s}, PlotLabel -> {"Scaled", s}], {s, 0.1, 1, 0.3}]Table[TuranGraph[5, 3, VertexSize -> s, PlotLabel -> s], {s, {{0.1, 0.2}, {0.2, 0.1}}}]TuranGraph[5, 3, VertexSize -> {1 -> 0.1, 2 -> 0.2}]VertexSizeはVertexShapeFunctionと組み合せることができる:
Table[TuranGraph[5, 3, VertexSize -> s, VertexShapeFunction -> "Square", PlotLabel -> s], {s, {0.05, 0.1, 0.2}}]VertexSizeはVertexShapeと組み合せることができる:
Table[TuranGraph[5, 3, VertexSize -> s, VertexShape -> [image], PlotLabel -> s], {s, {0.1, 0.2, 0.4}}]VertexStyle (5)
Table[TuranGraph[5, 3, VertexStyle -> style, VertexSize -> 0.2, PlotLabel -> style], {style, {Yellow, EdgeForm[Dashed]}}]TuranGraph[5, 3, VertexStyle -> {1 -> Blue, 2 -> Red}, VertexSize -> Medium]VertexShapeFunctionはVertexStyleと組み合せることができる:
vf1[{xc_, yc_}, name_, {w_, h_}] := Rectangle[{xc - w, yc - h}, {xc + w, yc + h}]TuranGraph[5, 3, VertexSize -> 0.2, VertexStyle -> Blue, VertexShapeFunction -> vf1]VertexShapeFunctionはVertexStyleより優先順位が高い:
vf2[{xc_, yc_}, name_, {w_, h_}] := {Red, Rectangle[{xc - w, yc - h}, {xc + w, yc + h}]}TuranGraph[5, 3, VertexSize -> 0.2, VertexStyle -> Blue, VertexShapeFunction -> vf2]VertexStyleはBaseStyleと組み合せることができる:
TuranGraph[5, 3, VertexStyle -> LightBlue, BaseStyle -> EdgeForm[Dotted], VertexSize -> 0.2]VertexStyleはBaseStyleより優先順位が高い:
TuranGraph[5, 3, VertexStyle -> LightBlue, BaseStyle -> Gray, VertexSize -> 0.2]VertexShapeはVertexStyleの影響を受けない:
TuranGraph[5, 3, VertexSize -> 0.2, VertexShape -> [image], VertexStyle -> Blue]VertexWeight (2)
アプリケーション (7)
n 組のカップルがパーティーに行くとする.各人が自分のパートナー以外のすべての人と握手をするとすると,TuranGraph[2n,n]で行われる握手の回数が説明できる:
{TuranGraph[4, 2], TuranGraph[6, 3]}TuránグラフのGraphCenter:
Table[HighlightGraph[#, GraphCenter[#]]&[TuranGraph[5, i, VertexSize -> 0.2]], {i, 2, 4}]Table[HighlightGraph[#, GraphPeriphery[#]]&[TuranGraph[5, i, VertexSize -> 0.2]], {i, 2, 4}]VertexEccentricity[TuranGraph[5, 3], #]& /@ VertexList[CycleGraph[5]]FindVertexEccentricityPath[g_ ? UndirectedGraphQ, u_] /; MemberQ[VertexList[g], u] := Module[{d = GraphDistanceMatrix[g], posu, posv, vl = VertexList[g]}, posu = VertexIndex[g, u];
posv = First@First@Position[d[[posu]], Max[d[[posu]]]];
PathGraph[FindShortestPath[g, u, vl[[posv]]]]]Table[HighlightGraph[g = TuranGraph[5, 3], FindVertexEccentricityPath[g, u]], {u, Range[3]}]Table[GraphRadius[TuranGraph[5, i]], {i, 2, 4}]FindRadiusPath[g_ ? UndirectedGraphQ] := Module[{c = First@GraphCenter[g], d, v, pos}, d = Table[GraphDistance[g, c, u], {u, VertexList[g]}];
pos = First@Position[d, Max[d]];
v = First@Part[VertexList[g], pos];
PathGraph[FindShortestPath[g, c, v]]]Table[HighlightGraph[#, FindRadiusPath[#]]&[TuranGraph[5, i, VertexSize -> Tiny]], {i, 2, 4}]Table[GraphDiameter[TuranGraph[5, i]], {i, 2, 4}]FindDiameterPath[g_ ? UndirectedGraphQ] := Module[{d = GraphDistanceMatrix[g], u, v, pos}, pos = First@Position[d, Max[d]];
{u, v} = Part[VertexList[g], pos];
PathGraph[FindShortestPath[g, u, v]]]Table[HighlightGraph[#, FindDiameterPath[#]]&[TuranGraph[5, i, VertexSize -> Tiny]], {i, 2, 4}]TuranGraphの頂点次数をハイライトする:
HighlightCentrality[g_, cc_] := HighlightGraph[g, Table[Style[VertexList[g][[i]], ColorData["TemperatureMap"][cc[[i]] / Max[cc]]], {i, VertexCount[g]}]];g = TuranGraph[8, 3, VertexSize -> Large];HighlightCentrality[g, VertexDegree[g]]HighlightCentrality[g, ClosenessCentrality[g]]HighlightCentrality[g, EigenvectorCentrality[g]]特性と関係 (4)
TuranGraph[n,r]には n 頂点ある:
VertexCount[TuranGraph[n, r]]DiscretePlot[EdgeCount[TuranGraph[n, 5]], {n, 3, 25}, AxesOrigin -> {0, 0}]CompleteGraphはTuranGraphの特殊ケースである:
Table[TuranGraph[5, i], {i, 2, 5}]{ CompleteGraph[{3, 2}], CompleteGraph[{2, 2, 1}], CompleteGraph[{2, 1, 1, 1}], CompleteGraph[5]}TuranGraph[n,2]は完全二部グラフである:
TuranGraph[7, 2]BipartiteGraphQ[%]関連項目
関連するガイド
テキスト
Wolfram Research (2010), TuranGraph, Wolfram言語関数, https://reference.wolfram.com/language/ref/TuranGraph.html.
CMS
Wolfram Language. 2010. "TuranGraph." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/TuranGraph.html.
APA
Wolfram Language. (2010). TuranGraph. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/TuranGraph.html
BibTeX
@misc{reference.wolfram_2026_turangraph, author="Wolfram Research", title="{TuranGraph}", year="2010", howpublished="\url{https://reference.wolfram.com/language/ref/TuranGraph.html}", note=[Accessed: 03-November-2026]}
BibLaTeX
@online{reference.wolfram_2026_turangraph, organization={Wolfram Research}, title={TuranGraph}, year={2010}, url={https://reference.wolfram.com/language/ref/TuranGraph.html}, note=[Accessed: 03-November-2026]}