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 CompleteGraph(n) CompleteGraph(V) CompleteGraph(n, m) CompleteGraph(n1, n2,..., nk)

Parameters

 n, m - positive integers n1,...,nk - positive integers V - list of integers, strings or symbols (vertex labels)

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

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{K4}≔\mathrm{CompleteGraph}\left(4\right)$
 ${\mathrm{K4}}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 4 vertices and 6 edge\left(s\right)}}$ (1)
 > $\mathrm{Edges}\left(\mathrm{K4}\right)$
 $\left\{\left\{{1}{,}{2}\right\}{,}\left\{{1}{,}{3}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{2}{,}{4}\right\}{,}\left\{{3}{,}{4}\right\}\right\}$ (2)
 > $\mathrm{DrawGraph}\left(\mathrm{K4}\right)$
 > $\mathrm{K23}≔\mathrm{CompleteGraph}\left(2,3\right)$
 ${\mathrm{K23}}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 5 vertices and 6 edge\left(s\right)}}$ (3)
 > $\mathrm{Edges}\left(\mathrm{K23}\right)$
 $\left\{\left\{{1}{,}{3}\right\}{,}\left\{{1}{,}{4}\right\}{,}\left\{{1}{,}{5}\right\}{,}\left\{{2}{,}{3}\right\}{,}\left\{{2}{,}{4}\right\}{,}\left\{{2}{,}{5}\right\}\right\}$ (4)
 > $\mathrm{DrawGraph}\left(\mathrm{K23},\mathrm{style}=\mathrm{bipartite}\right)$

 See Also

## Was this information helpful?

 Please add your Comment (Optional) E-mail Address (Optional) What is ? This question helps us to combat spam