GraphDifference

GraphDifference[g1,g2]

gives the graph difference of the graphs g1 and g2.

GraphDifference[{vw,},]

uses rules vw to specify the graph g.

Details and Options

  • The graph difference Graph[v1,e1]Graph[v2,e2] is given by Graph[v1v2,e1 e2].
  • GraphDifference works with undirected graphs, directed graphs, multigraphs, and mixed graphs.

Examples

open allclose all

Basic Examples  (1)

Obtain the graph difference of two graphs:

In[31]:=
Click for copyable input
In[32]:=
Click for copyable input
Out[32]=

Highlight the graph difference:

In[33]:=
Click for copyable input
Out[33]=

Scope  (5)

Properties & Relations  (6)

See Also

GraphComplement  GraphUnion  GraphIntersection  GraphDisjointUnion  BooleanGraph

Introduced in 2010
(8.0)
| Updated in 2015
(10.3)