Nothing can ever be done to guarantee things like this won't happen. I don't believe in psychological profiling - there is too much gray area in that.
Our idea is that from the very beginning of schooling, meaning either kindergarten or 1st grade, until formal schooling ends (after college or graduate school), "Anger Management" is taught as a school subject just like math, reading, or science would be. Every single child, every single day, sits in a class to discuss the proper ways to deal with emotions, anger, and frustration. They are taught how to address their feelings in a healthy, safe way. At every school, there is a license, trained psychologist that they are encouraged to talk to if they are feeling distressed, sad, angry or otherwise unable to deal with emotions they are having. This would help demystify the idea of seeing a psychologist and hopefully help encourage people to talk about issues they might be having.
It certainly not a solution, and I don't think anything is, but I truly and honestly believe this would be a very powerful step to lessening these types of crimes. As it is, a student goes through 20+ years of education without ever having any sort of instruction on how to deal with their own emotions. This is insane.