The only way fix the homeless situation is to take chronic mentally ill and institutionalize them. Bust the drug dealers big time and tell the rest to move along. Better yet, stop the drug war , legalize all drugs and take away the profit motive.
This needs a different approach. Seriously... approach the drug issue as if you were trying to take down Amazon, since the drug market works the same way. Items are shipped across long areas, sold in bulk, split up, shipped more, etc and in the end get to the consumer/user via the drug dealer or delivery driver... Drug dealers rely on logistics just as much as Amazon does. So, leaving the dealers alone to focus on the "big guys" is the opposite of what needs to be done, the small drug dealers are the heart of the operation. Go after them.. sure, they might get right out of jail, but harass them enough and eventually it isn't worth it to sell drugs in San Francisco. Regardless of how many drugs are brought into the city, they are useless if you have no dealers to get those drugs to the users...