CharacteristicPolynomial - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Mozilla Firefox.

Online Help

All Products    Maple    MapleSim


GraphTheory

  

CharacteristicPolynomial

  

compute characteristic polynomial of graph

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

CharacteristicPolynomial(G, x)

Parameters

G

-

undirected graph

x

-

variable or value

Description

• 

CharacteristicPolynomial returns the characteristic polynomial of the adjacency matrix of a graph G, as a polynomial in x.

Examples

> 

with⁡GraphTheory:

> 

with⁡SpecialGraphs:

> 

P≔Graph⁡1,2,2,3

P≔Graph 1: an undirected graph with 3 vertices and 2 edges

(1)
> 

CharacteristicPolynomial⁡P,x

x3−2⁢x

(2)
> 

A≔AdjacencyMatrix⁡P

A≔010101010

(3)
> 

LinearAlgebraCharacteristicPolynomial⁡A,x

x3−2⁢x

(4)
> 

G≔ShrikhandeGraph⁡:

> 

Diameter⁡G

2

(5)
> 

f≔CharacteristicPolynomial⁡G,x

f≔x16−48⁢x14−64⁢x13+768⁢x12+1536⁢x11−5888⁢x10−15360⁢x9+23040⁢x8+81920⁢x7−36864⁢x6−245760⁢x5−32768⁢x4+393216⁢x3+196608⁢x2−262144⁢x−196608

(6)
> 

eigvals≔solve⁡f

eigvals≔−2,2,6

(7)
> 

numelems⁡eigvals

3

(8)

See Also

AdjacencyMatrix

GraphSpectrum

LinearAlgebra[CharacteristicPolynomial]