DistancePolynomial - Maple Help

GraphTheory

 DistancePolynomial
 compute distance polynomial

 Calling Sequence DistancePolynomial(G, x)

Parameters

 G - undirected connected graph x - variable or value

Description

 • DistancePolynomial returns the distance polynomial for the connected graph G in the variable x.

Definition

 • For an undirected connected graph G, the distance polynomial of G is defined to be the characteristic polynomial of the graph distance matrix.

Examples

 > $\mathrm{with}\left(\mathrm{GraphTheory}\right):$
 > $P≔\mathrm{Graph}\left(\left\{\left\{1,2\right\},\left\{2,3\right\},\left\{3,4\right\}\right\}\right)$
 ${P}{≔}{\mathrm{Graph 1: an undirected unweighted graph with 4 vertices and 3 edge\left(s\right)}}$ (1)
 > $\mathrm{DistancePolynomial}\left(P,x\right)$
 ${{x}}^{{4}}{-}{20}{}{{x}}^{{2}}{-}{32}{}{x}{-}{12}$ (2)
 > $C≔\mathrm{CycleGraph}\left(5\right)$
 ${C}{≔}{\mathrm{Graph 2: an undirected unweighted graph with 5 vertices and 5 edge\left(s\right)}}$ (3)
 > $\mathrm{DistancePolynomial}\left(C,x\right)$
 ${{x}}^{{5}}{-}{25}{}{{x}}^{{3}}{-}{60}{}{{x}}^{{2}}{-}{35}{}{x}{-}{6}$ (4)

Compatibility

 • The GraphTheory[DistancePolynomial] command was introduced in Maple 2018.