We should use nukes to deflect asteroids, says astro algorithm

We’ve never had to deflect an incoming asteroid before it hits Earth, so how do we know the best way to do it? An algorithm says nuclear weapons are the most effective