DegreeSequence - Maple Help

GraphTheory

 DegreeSequence
 degree sequence of graph

 Calling Sequence DegreeSequence(G)

Parameters

 G - graph

Description

 • DegreeSequence returns a list of the degrees of the vertices of G. For directed graphs, the directions of the edges are ignored.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{Graph}\left(\mathrm{Trail}\left(1,2,3,4,2\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[{1}{,}{3}{,}{2}{,}{2}\right]$ (2)
 > $H≔\mathrm{Graph}\left(\mathrm{Trail}\left(1,2,3,4,2\right),\mathrm{directed}\right)$
 ${H}{≔}{\mathrm{Graph 2: a directed unweighted graph with 4 vertices and 4 arc\left(s\right)}}$ (3)
 > $\mathrm{DegreeSequence}\left(H\right)$
 $\left[{1}{,}{3}{,}{2}{,}{2}\right]$ (4)
 > $\mathrm{DrawGraph}\left(G\right)$