Simple solution. Build a wall around San Francisco.
Send ALL criminals to San Francisco, including illegal immigrants. Add all the homeless folks. Build the border fence extension around the whole mess. Deploy our military forces the San Frans hate to shoot anyone trying to escape.