The first thing we need to do to solve "homelessness" is to properly define terms.
There are people, like the ones you described above, who couldn't keep a home if one was given. They need much more help than a home.
Then there are working-class, middle-class people who are just down on their luck. They need a proper place to sleep, shower, and a way to get, and get to a job.
The first is a nuisance i have never found a way to solve.
The second are people that really need help.
My best thoughts on the subject is to provide free housing, free food, and free clothing.
Free housing being a 8 x12 room (probably concrete) with in wall/floor heating cooling. Build one of these for every man, woman and child in America. My calculation is that it would cost less than 1 year of section 8 housing. Then, if ever you have a time when you find yourself without a home, you show up at your local rooms place, and you get a room.
(and there is no double dipping, because you can't stay in two rooms at once)
Free food would be provided at cafeteria, strict hours, meal de jour.
Again, no double dipping, as you can only eat one meal.
Free clothing... something like a green jumpsuit. Easily recognizable, so unresellable.
Then, with the minimums provided, all other welfare programs are shut down.