  In this paper, we develop a two-stage distributed algorithm that enables
nodes in a graph to cooperatively estimate the spectrum of a matrix $W$
associated with the graph, which includes the adjacency and Laplacian matrices
as special cases. In the first stage, the algorithm uses a discrete-time linear
iteration and the Cayley-Hamilton theorem to convert the problem into one of
solving a set of linear equations, where each equation is known to a node. In
the second stage, if the nodes happen to know that $W$ is cyclic, the algorithm
uses a Lyapunov approach to asymptotically solve the equations with an
exponential rate of convergence. If they do not know whether $W$ is cyclic, the
algorithm uses a random perturbation approach and a structural controllability
result to approximately solve the equations with an error that can be made
small. Finally, we provide simulation results that illustrate the algorithm.
