GraphTheory - Maple Programming Help

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

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

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

Compatibility

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