Direct and Inverse Finite-Dimensional Spectral Problems on Graphs