It occurs to me that a list of genocide-was-the-only-solution-let's-not-w
orry stories in sf could be interesting. Certainly finding another way wasn't a concern of E. E. Smith, who wiped out evil races with a sun ray here and a smashing planet there.
THE MOTE IN GOD'S EYE at least says it's worth trying another way before jumping straight to the genocide, as per SOP. That's, like, the surprise twist.
Then there are cases where one has the sense that the primary reasons the humans didn't engage in righteous genocide as lack of capability, such as, perhaps, the aliens in Heinlein's Methuselah's Children.
Heinlein rethought Methuselah's Children and had Lazarus Long claim to have returned to punish the aliens for being superior to humans.
Edmond Hamilton's Interstellar Patrol stories generally involved a group of aliens, faced with extinction, trying to survive through some obnoxious method like stealing our sun or rubbing their comet against the Milky Way like a balloon to rebuild its charge. The Patrol generally exterminated the aliens, often turning the aliens' own superscience on them.
Michael Z. Williamson's books The Weapon and Rogue involve the planet Freehold causing the deaths of six billion degenerate socialists and then various characters attempting to avoid being held to account for killing six billion degenerate socialists.
Patrick Vanner's Ragnarok has humanity attacked by evil space lizards, the only cure for which is total genocide.
Michael McCollum's Antares Series has humanity attacked by obligatorily hostile space centaurs, the only cure for which is total genocide.
Also posted at Dreamwidth, where there are comment(s); comment here or there.