  We develop a formalism to compute the statistics of the top eigenpair of
weighted sparse graphs with finite mean connectivity and bounded maximal
degree. Framing the problem in terms of optimisation of a quadratic form on the
sphere and introducing a fictitious temperature, we employ the cavity and
replica methods to find the solution in terms of self-consistent equations for
auxiliary probability density functions, which can be solved by population
dynamics. This derivation allows us to identify and unpack the individual
contributions to the top eigenvector's components coming from nodes of degree
$k$. The analytical results are in perfect agreement with numerical
diagonalisation of large (weighted) adjacency matrices, and are further
cross-checked on the cases of random regular graphs and sparse Markov
transition matrices for unbiased random walks.
