HypercubeGraph - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


GraphTheory[SpecialGraphs]

  

HypercubeGraph

  

construct hypercube graph

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

HypercubeGraph(n)

Parameters

n

-

positive integer

Description

• 

The HypercubeGraph(n) command creates the hypercube graph of dimension n on 2n vertices. The vertex labels are strings of binary vectors of length n, and two vertices are joined by an edge if and only if they differ in exactly one coordinate. Note, the hypercube graph for n=2 is a square and for n=3 it is a cube.

Examples

withGraphTheory:

withSpecialGraphs:

HHypercubeGraph3

HGraph 1: an undirected graph with 8 vertices and 12 edge(s)

(1)

VerticesH

000,001,010,011,100,101,110,111

(2)

NeighborsH,010

000,011,110

(3)

DrawGraphH

Hypercube graphs have Hamiltonian cycles.

IsHamiltonianH,C

true

(4)

C

000,100,110,010,011,111,101,001,000

(5)

HighlightTrailH,C,red

DrawGraphH

See Also

SpecialGraphs