GraphIntersection[g1,g2]
gives the graph intersection of the graphs g1 and g2.
GraphIntersection[g1,g2,…]
gives the graph intersection of g1, g2, … .
GraphIntersection[{vw,…},…]
uses rules vw to specify the graph g.
GraphIntersection
GraphIntersection[g1,g2]
gives the graph intersection of the graphs g1 and g2.
GraphIntersection[g1,g2,…]
gives the graph intersection of g1, g2, … .
GraphIntersection[{vw,…},…]
uses rules vw to specify the graph g.
Details and Options
- The graph intersection Graph[v1,e1]⋂Graph[v2,e2] is given by Graph[v1⋃v2,e1⋂e2].
- GraphIntersection works with undirected graphs, directed graphs, multigraphs, and mixed graphs.
Examples
open all close allBasic Examples (1)
Scope (5)
GraphIntersection works with undirected graphs:
GraphIntersection[[image], [image]]GraphIntersection[[image], [image]]GraphIntersection[[image], [image]]GraphIntersection[[image], [image]]Use rules to specify the graph:
GraphIntersection[{1 -> 2, 2 -> 3, 3 -> 1, 4 -> 3, 2 -> 4}, {1 -> 2, 2 -> 3, 4 -> 3, 4 -> 1}]Properties & Relations (8)
The vertices of the graph intersection are the union of the vertices of the graphs:
g1 = [image];g2 = [image];VertexList[GraphIntersection[g1, g2]] == Union[VertexList[g1], VertexList[g2]]The edges of the graph intersection are the intersection of the edges of the graphs:
g1 = [image];g2 = [image];edgeSameQ[e1_, e2_] := SameQ[e1, e2] || SameQ[e1, Reverse[e2]]EdgeList[GraphIntersection[g1, g2]] == Intersection[EdgeList[g1], EdgeList[g2], SameTest -> edgeSameQ]The graph intersection of any graph and itself is isomorphic to the original graph:
g = [image];IsomorphicGraphQ[g, GraphIntersection[g, g]]The graph intersection of a graph and its subgraph has the same edges as its subgraph:
g = [image];h = Subgraph[g, Range[5]]EdgeList[GraphIntersection[g, h]] == EdgeList[h]The intersection of any graph and its complement is an empty graph:
g = [image];EmptyGraphQ[GraphIntersection[g, GraphComplement[g]]]The intersection of two graphs with different names is an empty graph:
EmptyGraphQ[GraphIntersection[[image], [image]]]The GraphIntersection of two graphs has the same vertices as GraphUnion:
VertexList[GraphIntersection[[image], [image]]] == VertexList[GraphUnion[[image], [image]]]The GraphIntersection of two graphs has the same vertices as GraphDifference:
VertexList[GraphIntersection[[image], [image]]] == VertexList[GraphDifference[[image], [image]]]Related Guides
Text
Wolfram Research (2010), GraphIntersection, Wolfram Language function, https://reference.wolfram.com/language/ref/GraphIntersection.html (updated 2015).
CMS
Wolfram Language. 2010. "GraphIntersection." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2015. https://reference.wolfram.com/language/ref/GraphIntersection.html.
APA
Wolfram Language. (2010). GraphIntersection. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/GraphIntersection.html
BibTeX
@misc{reference.wolfram_2026_graphintersection, author="Wolfram Research", title="{GraphIntersection}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/GraphIntersection.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_graphintersection, organization={Wolfram Research}, title={GraphIntersection}, year={2015}, url={https://reference.wolfram.com/language/ref/GraphIntersection.html}, note=[Accessed: 13-June-2026]}