Our Milky Way and the Andromeda galaxy – two giant galaxies in our local patch of the universe – are heading for an immense collision with each other in only a few billion years’ time. So which will dominate in this intergalactic tussle?

Our recent work has turned up an interesting result on measuring the mass of the Andromeda galaxy, which at a distance of only two million light years is our cosmic next-door neighbour.

Both Andromeda and the Milky Way appear to have about the same total mass, about 800 billion times that of our Sun, suggesting that the result of this intergalactic gravitational battle may actually be a draw.

Read more: Looking at the universe through very different 'eyes'

Big brother, little brother?

The Andromeda and the Milky Way galaxies are very similar, giant spirals containing hundreds of billions of individual stars. But astronomers have struggled to work out which of these two galaxies is the most massive.

And knowing the masses of the two giant galaxies will help to reveal the details of our ultimate fate.

The answer to this question is vitally important if we are to understand the dynamic history of all nearby galaxies, both large and small, as the gravitational field of the most massive will command the action.

Until now, astronomers have been unable to pin down the galactic masses, with a lack of data and complex calculations yielding very uncertain answers.

At times it seemed that our own Milky Way was more massive; at others it appeared that Andromeda was the local Goliath.

In our Milky Way, where we can get the best observational data, there has been a growing consensus among astronomers as to its mass. For Andromeda, where observations are more difficult, astronomers have still struggled to measure an accurate mass.

Our new work takes a new approach to measuring the mass of the Andromeda galaxy.

How to measure a galaxy?

Simply counting the number of stars in any galaxy, and adding their individual masses, won’t give you its total mass. Not even close. The mass of a galaxy is dominated by its dark side, an immense amount of matter that is unseen by telescopes.

The light side of a galaxy, the glowing stars and gas that we can see, accounts for only a couple of tens of percent of the total mass. The rest, the significant majority, is this elusive dark matter that dominates all of the mass in the universe.

But it is the gravitational pull of this dark matter that holds the stars in their orbits, meaning we can measure its presence. American astronomer Vera Rubin figured out more than half a century ago that there is much more to the Andromeda galaxy than simply the stars we can see.

As dark matter holds stars in their orbits, we can use their motions to measure the overall mass of the Andromeda galaxy, including the unseen dark matter. This is what we did in our new work, but with a twist.

The key concept is escape velocity, or how fast you have to be moving to break free from the gravitational pull of a massive object.

As Elon Musk and the Falcon Heavy rocket just showed, you need to get up to speeds of more than 11km per second to ensure that your Telsa electric car escapes Earth’s gravitational clutches.

We figured that if we can trace out the escape velocity for stars within the massive gravitational halo of Andromeda, we can work out its gravitational pull, and the mass that is ultimately responsible.

While the calculation was complicated, the result was unequivocal: previous estimates had overstated the total mass of Andromeda. It and the Milky Way are equals in the local universe.

Towards the future

Now we know that the Milky Way and Andromeda are of similar masses, what have we learned? Importantly, we can now try to understand the role these galaxies played in the formation and evolution of the local universe.

Read more: The cosmic crime-scene hunt for clues on how galaxies are formed

But we know that the collision with Andromeda is coming in only a few billion years. Previously we were unsure who would be the major player in this battle, and who would dominate the gravitational battle ahead.

Like the Mutually Assured Destruction (MAD) doctrine of the Cold War, ultimately there will be no winner in this cosmic clash, but at least the Milky Way will be on an equal footing with its cosmic rival.