The spectrum of optimal excess graphs for trees with up to four edges