An \(O(n^{2})\) Algorithm for the Characteristic Polynomial of a Tree

David P. Jacobs1, Catia M. S. Machado2, Vilmar Trevisan3
1Dept. of Computer Science, Clemson University Clemson, SC 29634-0974 USA
2FURG – Departamento de Matematica 96201-900 Rio Grande, RS, Brasil
3UFRGS-Instituto de Matematica 91509-900 Porto Alegre, RS, Brasil

Abstract

We describe an algorithm that uses \( O(n) \) arithmetic operations for computing the determinant of the matrix \( M = (A + \alpha I) \), where \( A \) is the adjacency matrix of an order \( n \) tree. Combining this algorithm with interpolation, we derive a simple algorithm requiring \( O(n^2) \) arithmetic operations to find the characteristic polynomial of the adjacency matrix of any tree. We apply our algorithm and recompute a 22-degree characteristic polynomial, which had been incorrectly reported in the quantum chemistry literature.

Keywords: tree, adjacency matrix, characteristic polynomial. AMS subject classifcation: 05C05, 05C50, 05C85, 15A15 .