GraphTheory
CompleteGraph
construct complete graph
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
CompleteGraph(n, opts)
CompleteGraph(V, opts)
CompleteGraph(n, m, opts)
CompleteGraph(n1, n2,..., nk, opts)
n, m
-
positive integers
n1,...,nk
V
list of integers, strings or symbols (vertex labels)
opts
(optional) one or more options as specified below
The opts argument can contain one or more of the options shown below.
directed=true or false
This option specifies whether the resulting graph should be directed. The default is false.
layout=true or false
This option specifies whether a default coordinate assignment for the vertices of the graph should be made. The default is true.
selfloops=true or false
This option specifies whether the generated graph should include a self-loop for each vertex. The default is false.
vertexpositions=p
Specifies coordinate positions for the vertices for use with DrawGraph.
CompleteGraph(n) returns the complete graph on n vertices. CompleteGraph(V) does the same thing except the vertices are labeled using the entries of V.
CompleteGraph(n, m) returns the complete bipartite graph with bipartitions of size n and m.
CompleteGraph(n1,...,nk) returns the complete multipartite graph with partitions of size n1,..., nk.
with⁡GraphTheory:
K4≔CompleteGraph⁡4
K4≔Graph 1: an undirected graph with 4 vertices and 6 edge(s)
Edges⁡K4
1,2,1,3,1,4,2,3,2,4,3,4
DrawGraph⁡K4
G≔CompleteGraph⁡a,b,c
G≔Graph 2: an undirected graph with 3 vertices and 3 edge(s)
Edges⁡G
a,b,a,c,b,c
K23≔CompleteGraph⁡2,3
K23≔Graph 3: an undirected graph with 5 vertices and 6 edge(s)
Edges⁡K23
1,3,1,4,1,5,2,3,2,4,2,5
DrawGraph⁡K23,style=bipartite
The directed and layout options were introduced in Maple 2019.
For more information on Maple 2019 changes, see Updates in Maple 2019.
The selfloops option was introduced in Maple 2020.
For more information on Maple 2020 changes, see Updates in Maple 2020.
The GraphTheory[CompleteGraph] command was updated in Maple 2023.
The vertexpositions option was introduced in Maple 2023.
For more information on Maple 2023 changes, see Updates in Maple 2023.
See Also
DrawGraph
Edges
Graph
IsBipartite
Download Help Document