Extremal problems on edge-colorings, independent sets, and cycle spectra of graphs