"Gentrification tends to stop when affluent people stop wanting to move into the city," Megan McArdle says in a fine overview of the intractability of the affordable housing problem. The only real solution, it would seem, is to close the gap between the affluent and everyone else.
Affordable Housing vs. Dystopian Walled Cities of the Future

In California, the high cost of housing is hurting the state's economic growth and pushing its citizens deeper into poverty. But there's so much land! Why is it so hard to find somewhere affordable to rent?
The Insane and Inspiring Plan for Affordable Housing in Gotham
New York City real estate is too expensive to afford for most people who are not foreign billionaires. Mayor Bill De Blasio has vowed to build or preserve 200,000 new units of affordable housing in the next decade. Is that even possible? The experts say: Uhhh.....
A long New York Times look at global thinking on how to create affordable urban housing turns up only one workable idea: "It seems the only solution would be to level all of, say, North Brooklyn and put up monolithic prefab tower blocks." We support this.