GraphUnion[g1,g2]
グラフ g1とグラフ g2のグラフ和集合を与える.
GraphUnion[g1,g2,…]
g1, g2, …のグラフ和集合を与える.
GraphUnion[{vw,…},…]
規則 vw を使ってグラフ g を指定する.
GraphUnion
GraphUnion[g1,g2]
グラフ g1とグラフ g2のグラフ和集合を与える.
GraphUnion[g1,g2,…]
g1, g2, …のグラフ和集合を与える.
GraphUnion[{vw,…},…]
規則 vw を使ってグラフ g を指定する.
詳細とオプション
- グラフ和集合Graph[v1,e1]⋃Graph[v2,e2]はGraph[v1⋃v2,e1⋃e2]で与えられる.
- GraphUnionは,無向グラフ,有向グラフ,多重グラフ,混合グラフに使うことができる.
予備知識
- GraphUnionは,2つ以上の有向グラフあるいは無向グラフの集合によって与えられた新たなグラフを与える.このグラフ集合は,もとの頂点集合および辺集合の和集合を別々に取ることで与えられたものである.GraphUnionは,異なるグラフ中で同じ頂点ラベルを持つ辺の1つしか保存しない.結果のグラフは,一意的なもとの辺の頂点ラベルを保つ.
- 関連する関数には,GraphDisjointUnion,GraphIntersection,GraphDifferenceがある.GraphUnionとは異なり,GraphDisjointUnionは,たとえ複数のグラフに同じ頂点ラベルを持つ辺が存在しても,すべての辺を保つ.GraphIntersectionは,もとのグラフの頂点集合の和集合と辺集合の交点から得られたグラフを与える.GraphDifferenceは,2つのグラフの頂点集合の和集合と最初のグラフに対する2番目のグラフの辺集合の補集合から得られたグラフを与える.GraphComplementは,与えられたグラフと同じ頂点集合を持ってはいるが,辺はもとのグラフには不在であるものに対応するグラフを与える(逆もまた真なり).
例題
すべて開く すべて閉じる例 (1)
スコープ (6)
GraphUnionは無向グラフに使うことができる:
GraphUnion[[image], [image]]GraphUnion[[image], [image]]GraphUnion[[image], [image]]GraphUnion[[image], [image]]GraphUnion[{1 -> 2, 2 -> 3, 3 -> 4, 4 -> 1}, {1 -> 2, 1 -> 3, 1 -> 4}]GraphUnionは2つより多くのグラフに使うことができる:
GraphUnion[[image], [image], [image]]特性と関係 (7)
g1 = [image];g2 = [image];VertexList[GraphUnion[g1, g2]] == Union[VertexList[g1], VertexList[g2]]g1 = [image];g2 = [image];edgeSameQ[e1_, e2_] := SameQ[e1, e2] || SameQ[e1, Reverse[e2]]e1 = EdgeList[GraphUnion[g1, g2]];
e2 = Union[EdgeList[g1], EdgeList[g2], SameTest -> edgeSameQ];Sort[Sort /@ e1] === Sort[Sort /@ e2]g = [image];IsomorphicGraphQ[g, GraphUnion[g, Subgraph[g, Range[4]]]]g = [image];CompleteGraphQ[GraphUnion[g, GraphComplement[g]]]2つのグラフのGraphUnionにはGraphDifferenceと同じ頂点がある:
VertexList[GraphUnion[[image], [image]]] == VertexList[GraphDifference[[image], [image]]]2つのグラフのGraphUnionにはGraphIntersectionと同じ頂点がある:
VertexList[GraphUnion[[image], [image]]] == VertexList[GraphIntersection[[image], [image]]]GraphDisjointUnionはGraphUnionで求めることができる:
g1 = [image];g2 = [image];IsomorphicGraphQ[GraphDisjointUnion[g1, g2], GraphUnion[g1, IndexGraph[g2, VertexCount[g1] + 1]]]関連するガイド
-
▪
- グラフの操作と変更 ▪
- グラフとネットワーク ▪
- グラフの構築と表現 ▪
- グラフ上の計算
テキスト
Wolfram Research (2010), GraphUnion, Wolfram言語関数, https://reference.wolfram.com/language/ref/GraphUnion.html (2015年に更新).
CMS
Wolfram Language. 2010. "GraphUnion." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/GraphUnion.html.
APA
Wolfram Language. (2010). GraphUnion. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphUnion.html
BibTeX
@misc{reference.wolfram_2026_graphunion, author="Wolfram Research", title="{GraphUnion}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/GraphUnion.html}", note=[Accessed: 16-July-2026]}
BibLaTeX
@online{reference.wolfram_2026_graphunion, organization={Wolfram Research}, title={GraphUnion}, year={2015}, url={https://reference.wolfram.com/language/ref/GraphUnion.html}, note=[Accessed: 16-July-2026]}