IsRegular - Maple Help

GraphTheory

 IsRegular

 Calling Sequence IsRegular(G) IsRegular(G, d)

Parameters

 G - graph d - (optional) name

Description

 • An undirected graph G is regular if each vertex has the same degree. For example, CycleGraph(4) is a regular graph of degree 2.
 • The IsRegular command returns true if the graph is regular and false otherwise. If a name d is specified, then this name is assigned the degree of the graph. If the graph is not regular and a name is specified, then the name is assigned FAIL.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $\mathrm{with}\left(\mathrm{SpecialGraphs}\right):$
 > $G≔\mathrm{Graph}\left(\left\{\left\{1,2\right\},\left\{1,3\right\},\left\{2,3\right\},\left\{3,4\right\}\right\}\right)$
 ${G}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 4 vertices and 4 edge\left(s\right)}}$ (1)
 > $\mathrm{DegreeSequence}\left(G\right)$
 $\left[{2}{,}{2}{,}{3}{,}{1}\right]$ (2)
 > $\mathrm{IsRegular}\left(G\right)$
 ${\mathrm{false}}$ (3)
 > $P≔\mathrm{PetersenGraph}\left(\right)$
 ${P}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 10 vertices and 15 edge\left(s\right)}}$ (4)
 > $\mathrm{DegreeSequence}\left(P\right)$
 $\left[{3}{,}{3}{,}{3}{,}{3}{,}{3}{,}{3}{,}{3}{,}{3}{,}{3}{,}{3}\right]$ (5)
 > $\mathrm{IsRegular}\left(P,'r'\right)$
 ${\mathrm{true}}$ (6)
 > $r$
 ${3}$ (7)
 > $\mathrm{DrawGraph}\left(P\right)$
 > $C≔\mathrm{ClebschGraph}\left(\right)$
 ${C}{≔}{\mathrm{Graph 3: an undirected unweighted graph with 16 vertices and 40 edge\left(s\right)}}$ (8)
 > $\mathrm{IsRegular}\left(C,'r'\right)$
 ${\mathrm{true}}$ (9)
 > $r$
 ${5}$ (10)
 > $\mathrm{DrawGraph}\left(C\right)$