The characteristic polynomial of an square matrix
is defined here by
|
(1)
|
where
is the identity matrix of identical dimension.
Its roots satisfy the characteristic
equation
. This convention is also used by the
Wolfram Language (Wolfram Research).
The alternative monic convention defines
(Axler 2024, p. 363). The two conventions agree when
is even and differ by an overall sign when
is odd. They have the same roots
with the same multiplicities. Samuelson's
formula allows the characteristic polynomial to be computed recursively without
divisions. The characteristic polynomial of a matrix
may be computed in the Wolfram Language
as CharacteristicPolynomial[m,
x].
The characteristic polynomial of a matrix
|
(2)
|
can be rewritten in the particularly nice form
|
(3)
|
where
is the matrix trace of
and
is its determinant.
For a matrix over a field of characteristic
0 or greater than 3, the characteristic polynomial is
|
(4)
|
where Einstein summation has been used, which can also be written explicitly in terms of traces as
|
(5)
|
The monic convention has the form
|
(6)
| |||
|
(7)
|
where
is the matrix trace
of the matrix
,
,
and
is the sum of the
-rowed diagonal minors of the matrix
(Jacobson 1974, p. 109).
Le Verrier's algorithm for computing the characteristic polynomial of a graph (Balasubramanian 1984ab; Trinajstić 1988; Ivanciuc and Balaban 1999, p. 89) can be formulated as the solution of the linear system of equations
|
(8)
|
with the signed polynomial
|
(9)
|
where
and
. Thus
.
The divisions require a field of characteristic
0 or greater than
.
The corresponding matrix recurrence computes for
using the equation
|
(10)
|
where
|
(11)
|
(Balasubramanian 1985, 1991; Ivanciuc and Balaban 1999, p. 90) with and
.
The characteristic polynomial of a graph is defined as the characteristic polynomial of its adjacency
matrix and can be computed in the Wolfram
Language using CharacteristicPolynomial[AdjacencyMatrix[g],
x]. The precomputed characteristic polynomial of a named graph
in terms of a variable
can also be obtained using GraphData[graph,
"CharacteristicPolynomial"][x].
Characteristic polynomials are not diagnostic for graph isomorphism, i.e., two nonisomorphic graphs
may share the same characteristic polynomial. The smallest such example occurs for
the two graphs on five nodes
illustrated above, both of which have characteristic polynomial . The numbers of distinct characteristic polynomials
for simple graphs on
, 2, ... nodes are
1, 2, 4, 11, 33, 151, 988, 11453, ... (OEIS A082104).
The number of characteristic polynomials shared by at least two nonisomorphic simple graphs is 0, 0, 0, 0, 1, 5, 54, 829, 23728, ...
(Brouwer). Counting each polynomial once is distinct
from subtracting the number of characteristic polynomials from the number of nonisomorphic simple graphs.
The following table summarizes the characteristic polynomials for some simple graphs.
| graph | characteristic polynomial |
| complete graph | |
| complete
graph | |
| complete graph | |
| cyclic
graph | |
| cyclic graph | |
| cyclic
graph | |
| cubical graph | |
| octahedral graph | |
| tetrahedral
graph | |
| wheel graph | |
| wheel graph |