Distributed Control and Optimisation of Complex Networks via their Laplacian Spectra