-
Notifications
You must be signed in to change notification settings - Fork 4
Operations
Ed Scheinerman edited this page Aug 12, 2021
·
7 revisions
In addition to add!
, add_edges!
, and delete!
the following functions modify the graph on which they operate.
-
contract!(G,v,w)
: contract the edge(v,w)
(mergingw
intov
). -
complement!(G)
: overwriteG
with its complement.
The remainder of the functions on this page do not modify their arguments; they produce a new graph.
-
G'
orcomplement(G)
: return the complement ofG
. -
line_graph(G)
: line graph ofG
. -
induce(G,A)
: return the induced subgraph ofG
on vertices in the setA
. -
trim(A,d=0)
: iteratively remove vertices of degree at mostd
. -
relabel(G)
: new graph isomorphic toG
with vertices named1,2,...,n
. -
relabel(G,d)
: new graph isomorphic toG
with vertices relabeled by the dictionaryd
. -
subdivide(G)
: new graph formed by replacing every edge ofG
with a path of length two.
-
disjoint_union(G,H)
: disjoint union of graphsG
andH
. This can also be written asG+H
. Note that2*G
(or2G
) is the same asG+G
. More generally,k*G
(wherek
is an integer) gives a graph that is isomorphic toG+G+G+...+G
(withk
terms). -
union(G,H)
: new graph whose vertex [resp. edge] set is the union of the vertex [resp. edge] sets of the two graphs. -
cartesian(G,H)
: Cartesian product. -
lex(G,H)
orG[H]
: lexicographic product. -
join(G,H)
: join ofG
andH
. May also be invoked withG ∨ H
.