Ideally, you figure out how mental illness plays into the different categories, and you may be able to understand effective prevention.
My sense is that this goes beyond mere "we need some mental health facilities", because preventing someone in a less secure housing situation from becoming totally roofless may end up being significantly cheaper, i.e., not require specialist mental care and hospitalization, but just a subsidized housing and someone stopping by to make sure the person hasn't regressed.
Sadly, it appears nobody with real resources in the US wants to invest in understanding homelessness, so we just lump it all together and try to find ways to let the police deal with it.