I wouldn't say this is the only solution, but I think it's the best one. "Affordable housing" gives you long waiting lists and too many opportunities for political patronage and graft.
They could help a lot simply by adding capacity to existing transit, especially CalTrain and BART.
BART gets so overloaded that smart people wanting to board downstream of the choke points take a train the wrong direction for a few stops to get a seat by boarding upstream of the rush.
no, the only solution is to improve transit and infrastructure