The neighbouring galaxy from which the Kelvan Empire sent a generational expedition to find new territory, because rising radiation would make their own home uninhabitable within ten thousand years.
The Andromeda Galaxy lies far outside the Milky Way and is home to the Kelvan Empire. In the original series episode By Any Other Name, Rojan explains that radiation levels there are climbing and that his people must conquer a new home within ten millennia.
The Kelvan scout ship took three centuries to make the crossing and was wrecked at the galactic barrier, leaving descendants of the original crew stranded in humanoid form. They seize the Enterprise and modify her engines for a return voyage of roughly three hundred years, until Kirk persuades Rojan to send a robot ship home with a Federation offer of peaceful settlement instead.
Andromeda is also named in I, Mudd as the origin of the Makers, the vanished builders of the androids ruled by Harry Mudd.