Spectrally approximating large graphs with smaller graphs