({{, (RefLink[GraphIntersection, paclet:ref/GraphIntersection])[(Subscript[g, 1]),(Subscript[g, 2])] 
gives the graph intersection of the graphs (Subscript[g, 1]) and (Subscript[g, 2]).}, {, (RefLink[GraphIntersection, paclet:ref/GraphIntersection])[(Subscript[g, 1]),(Subscript[g, 2]),…]
gives the graph intersection of (Subscript[g, 1]), (Subscript[g, 2]), … .}, {, (RefLink[GraphIntersection, paclet:ref/GraphIntersection])[{v->w,…},…]
uses rules v->w to specify the graph g.}})

OpenersNotesSection(Spacer1)Details and Options

The graph intersection (RefLink[Graph, paclet:ref/Graph])[(Subscript[v, 1]),(Subscript[e, 1])]⋂(RefLink[Graph, paclet:ref/Graph])[(Subscript[v, 2]),(Subscript[e, 2])] is given by (RefLink[Graph, paclet:ref/Graph])[(Subscript[v, 1])⋃(Subscript[v, 2]),(Subscript[e, 1])⋂(Subscript[e, 2])].

(RefLink[GraphIntersection, paclet:ref/GraphIntersection]) works with undirected graphs, directed graphs, multigraphs, and mixed graphs.

OpenersPrimaryExamplesSection(Spacer1)Examples  (14)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

Obtain the graph intersection of two graphs:

g=;h=;

GraphIntersection[g,h]

Highlight the graph intersection:

HighlightGraph[g,%,GraphHighlightStyle->"Thick"]

OpenersExampleSection1(Spacer1)Scope  (5)

(RefLink[GraphIntersection, paclet:ref/GraphIntersection]) works with undirected graphs:

GraphIntersection[,]

Directed graphs:

GraphIntersection[,]

Multigraphs:

GraphIntersection[,]

Mixed graphs:

GraphIntersection[,]

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}]

OpenersExampleSection3(Spacer1)Properties & Relations  (8)

The vertices of the graph intersection are the union of the vertices of the graphs:

g1=;g2=;

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=;g2=;

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=;

IsomorphicGraphQ[g,GraphIntersection[g,g]]

The graph intersection of a graph and its subgraph has the same edges as its subgraph:

g=;

h=Subgraph[g,Range[5]]

EdgeList[GraphIntersection[g,h]]==EdgeList[h]

The intersection of any graph and its complement is an empty graph:

g=;

EmptyGraphQ[GraphIntersection[g,GraphComplement[g]]]

The intersection of two graphs with different names is an empty graph:

EmptyGraphQ[GraphIntersection[,]]

The (RefLink[GraphIntersection, paclet:ref/GraphIntersection]) of two graphs has the same vertices as (RefLink[GraphUnion, paclet:ref/GraphUnion]):

VertexList[GraphIntersection[,]]==VertexList[GraphUnion[,]]

The (RefLink[GraphIntersection, paclet:ref/GraphIntersection]) of two graphs has the same vertices as (RefLink[GraphDifference, paclet:ref/GraphDifference]):

VertexList[GraphIntersection[,]]==VertexList[GraphDifference[,]]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[GraphUnion, paclet:ref/GraphUnion])  ▪  (RefLink[GraphDifference, paclet:ref/GraphDifference])  ▪  (RefLink[GraphComplement, paclet:ref/GraphComplement])  ▪  (RefLink[GraphDisjointUnion, paclet:ref/GraphDisjointUnion])  ▪  (RefLink[BooleanGraph, paclet:ref/BooleanGraph])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Graph Operations and Modifications, paclet:guide/GraphModifications])}})}})