Cold Equations: The Body Electric: Book Three by David Mack
At the centre of the Galaxy, a planet-sized Machine of terrifying power and unfathomable purpose hurls entire star systems into a supermassive black hole. Wesley Crusher, now a full-fledged Traveller, knows the Machine must be stopped...but he has no idea how. He enlists the help of Captain Picard and theEnterprisecrew, who also fail to halt the unstoppable alien juggernaut's destructive labours. But they soon divine the Machine's true purpose, which threatens to exterminate all life in the Milky Way Galaxy. With time running out, Picard realizes he knows of only one person who might be able to stop the Machine in time to avert a galactic catastrophe-but he has no idea how to find him.