Use this if you are using igraph from R
The difference of two graphs are created.
## S3 method for class 'igraph' difference(big, small, byname = "auto", ...)
The left hand side argument of the minus operator. A directed or undirected graph.
The right hand side argument of the minus operator. A directed ot undirected graph.
A logical scalar, or the character scalar
Ignored, included for S3 compatibility.
difference creates the difference of two graphs. Only edges
present in the first graph but not in the second will be be included in the
new graph. The corresponding operator is %m%.
byname argument is
auto and the graphs
are all named), then the operation is performed based on symbolic vertex
names. Otherwise numeric vertex ids are used.
difference keeps all attributes (graph, vertex and edge) of the
small must both be directed or both be
undirected, otherwise an error message is given.
A new graph object.
Gabor Csardi firstname.lastname@example.org
## Create a wheel graph wheel <- union(make_ring(10), make_star(11, center=11, mode="undirected")) V(wheel)$name <- letters[seq_len(vcount(wheel))] ## Subtract a star graph from it sstar <- make_star(6, center=6, mode="undirected") V(sstar)$name <- letters[c(1,3,5,7,9,11)] G <- wheel %m% sstar print_all(G) plot(G, layout=layout_nicely(wheel))