GraphTheory - Maple Programming Help

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

GraphTheory

 Degree
 InDegree
 OutDegree

 Calling Sequence Degree(G, v) InDegree(H, v) OutDegree(H, v)

Parameters

 G - directed or undirected graph H - directed graph v - vertex

Description

 • Degree returns the degree of v; that is, the number of edges of the graph G which are incident to v.  The directions of the edges are ignored.
 • InDegree returns the in-degree of v; that is, the number of arcs directed into v.
 • OutDegree returns the out-degree of v; that is, the number of arcs directed out of v.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $G≔\mathrm{Digraph}\left(\mathrm{Trail}\left(1,2,3,4,2\right)\right)$
 ${G}{≔}{\mathrm{Graph 1: a directed unweighted graph with 4 vertices and 4 arc\left(s\right)}}$ (1)
 > $\mathrm{DrawGraph}\left(G\right)$
 > $\mathrm{Degree}\left(G,2\right)$
 ${3}$ (2)
 > $\mathrm{InDegree}\left(G,2\right)$
 ${2}$ (3)
 > $\mathrm{OutDegree}\left(G,2\right)$
 ${1}$ (4)