GraphTheory - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Mathematics : Discrete Mathematics : Graph Theory : GraphTheory Package : GraphTheory/CompleteGraph

GraphTheory

  

CompleteGraph

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

CompleteGraph(n, opts)

CompleteGraph(V, opts)

CompleteGraph(n, m, opts)

CompleteGraph(n1, n2,..., nk, opts)

Parameters

n, m

-

positive integers

n1,...,nk

-

positive integers

V

-

list of integers, strings or symbols (vertex labels)

opts

-

(optional) one or more options as specified below

Options

  

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.

Description

• 

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.

Examples

withGraphTheory:

K4CompleteGraph4

K4Graph 1: an undirected unweighted graph with 4 vertices and 6 edge(s)

(1)

EdgesK4

1,2,1,3,1,4,2,3,2,4,3,4

(2)

DrawGraphK4

GCompleteGrapha,b,c

GGraph 2: an undirected unweighted graph with 3 vertices and 3 edge(s)

(3)

EdgesG

a,b,a,c,b,c

(4)

K23CompleteGraph2,3

K23Graph 3: an undirected unweighted graph with 5 vertices and 6 edge(s)

(5)

EdgesK23

1,3,1,4,1,5,2,3,2,4,2,5

(6)

DrawGraphK23,style=bipartite

Compatibility

• 

The GraphTheory[CompleteGraph] command was updated in Maple 2019.

• 

The directed and layout options were introduced in Maple 2019.

• 

For more information on Maple 2019 changes, see Updates in Maple 2019.

See Also

DrawGraph

Edges

Graph

IsBipartite