GraphTheory
Subdivide
construct graph by subdividing edges
Calling Sequence
Parameters
Description
Examples
Subdivide(G, E, r)
G
-
graph
E
(optional) edge or arc or set (or list) of edges or arcs of the graph
r
(optional) positive integer
The Subdivide command subdivides the specified edges or arcs of a graph or digraph, by putting r new vertices on each specified edge or arc.
If r is not specified, a default value of 1 is used.
with⁡GraphTheory:
G≔CompleteGraph⁡2,3
G≔Graph 1: an undirected graph with 5 vertices and 6 edge(s)
Edges⁡G
1,3,1,4,1,5,2,3,2,4,2,5
SG≔Subdivide⁡G,1,5,2,4
SG≔Graph 2: an undirected graph with 7 vertices and 8 edge(s)
Edges⁡SG
1,3,1,4,1,6,2,3,2,5,2,7,4,7,5,6
DG≔Digraph⁡a,b,c,a,b,a,c
DG≔Graph 3: a directed graph with 3 vertices and 2 arc(s)
Edges⁡DG
a,b,a,c
SDG≔Subdivide⁡DG,a,b,2
SDG≔Graph 4: a directed graph with 5 vertices and 4 arc(s)
Edges⁡SDG
1,2,2,b,a,1,a,c
See Also
Digraph
Edges
Graph
Download Help Document