San Francisco Homeless Crisis

~ Introduction ~

    Ever-evolving technology have continued to capture our surprise in new creative ideas and services. Software companies such as Google, Facebook, Uber, Twitter, and Instagram spurred from the San Francisco Bay Area, Silicon Valley and made its way to the world. Today these billion-dollar companies have brought a great number of people from all over the world to Northern California. Software developers and engineers have gathered to create and innovate in the Silicon Valley. On the flip side, there has been a clearly visible income gap amongst the people living in San Francisco.

    The income gap that has been flooded throughout the San Francisco Bay Area has created a ripple amongst families and individual that led some to move out of the city and some to live on the street. The housing price has inflated more than the average individual can afford. “The average apartment rent over the prior 6 months in San Francisco has increased by $256 (7%) One bedroom units have increased by $306 (9.3%) and two-bedroom apartments have increased by $230 (5.2%).” (Jungle) People have begun being kicked out of their homes and without any warning, rents have skyrocketed. The housing has increased however many average workers in San Francisco’s income has not been raised.

    The situation for housing has become worse by the City of San Francisco taking actions that accentuate the rise in housing price in various situation. The city of San Francisco has continued to put a restriction on building permits on affordable housings, emphasizing environmental issue and minor issues such as “casting of the shadow on private property.” Many of the building in San Francisco needs to be remodeled since it’s more than a century old however many owners cannot get a permit. The number of homeless has exploded in the past several years.

    Due to poor living condition and lack of housing in San Francisco, a large number of families and individuals were led to live on the street. With very less oversight on the homeless from the City of San Francisco, homeless that has been living on the street has continued to persist. “In 2019, San Francisco reported 8,011 homeless people met the federal definition of homeless, an increase of 17 percent from 2017. When looking at San Francisco’s expanded definition, the city’s 2019 total homeless population is 9,784, the highest in the Bay Area.” (Eby)

Just the Federal count in homeless has doubled from ten years ago. There are almost ten thousand homeless people on the street in San Francisco, which has a surface area of only 46.87 mi^2.


    From the numbers, we can expect the homeless to continue to grow. In order to help homeless’ to get back on their feet, we would first consider helping generate a stable income. Income majorly comes from occupancy and the high minimum wage in the city already serves the perfect condition. Although in order to even start occupancy, homeless’ need proper housing. Homeless carry their whole belongings around and cannot properly treat their hygiene without a form of housing. Homeless shelters are often overcrowded and weekly street cleaning forces them to continuously move one place to the other. It is certain that housing is the most critical problem that homeless’ have today.

There are several limitations that we would need to consider in order to solve the homelessness in San Francisco.

  1. High housing cost to house the homeless individual and families.
  2. Restriction on building new affordable housing in San Francisco
  3. Difficulties renovating the current building for housing
  4. Overcrowded homeless shelters

Considering the restraints above the only solution to homelessness is to rely on current infrastructure in order to provide housing to homeless’. Although current public infrastructure in San Francisco does not offer a great solution to house homeless’ on the street. It is not a large city and because of the building restriction, it is not made to house a large number of people at the same time. We would need to rely on private properties that are vacant most of the time, especially at night.

In essence, the private property that is vacant at night and located all around the city are the 160 churches in San Francisco. If every church housed 20 homeless’, in just one day, half of all homeless in San Francisco will be cut in half. The effect would not only eliminate the homeless crisis but would open up homeless shelters for people in need. People would then find occupancy and the increasing homelessness would decrease in time. Churches would be rewarded through additional tax exemption and would be able to bring more people to their service. It would be a win-win deal for all people in San Francisco.


    In order to bring upon such mandate, there would be a need for a plan and a proof of concept to show that the proposition is valid and effective. In order to maximize the efficiency of housing, we cannot just allocate a static number of people in every church, however, there is no data set for the specific number each church can hold. So we would need to maximize the efficiency in housing homelessness in terms of proximity of each church. The closer the churches would be able to expand the housing cap, so if there is occupancy in another church nearby we would quickly be able to allocate people between each church.


The proof of concept that would be proposed would first target the churches that are 800m within a radius of City Hall. Through the FourSquare database, we would be filtering the churches around City Hall that are 800m in radius and measuring the proximity of each church to each other. We will then rank and group in terms of distance of proximity. Then we would be able to accurately measure how effective this proposition can be, with just an 800m radius.

Results and Discussion

    As a first step, access to Foursquare API to retrieve the information for churches around the San Francisco City Hall is initiated. The address for the San Francisco City Hall would be 1 Dr. Carlton B Goodlett Pl, San Francisco, CA 94102. The query would retrieve the 800m radius of this address and would transform the JSON into pandas data frame as above. The visualization of the churches that are 800m of the City Hall is listed below.

    The next step would be to calculate the proximity between every church of 800m of the City Hall. We would be creating a new data frame to store proximity data to list the distance between two churches.

    Then we would use the proximity data to create a data frame including the name of the church, location data, and the expected occupancy of each church.

Assuming that average amount of church can occupy 20 homeless’, the church that has the least amount of proximate churches would be assigned 20 occupancies, churches that have nearby churches within 100m proximity would be assigned 25, and churches that have churches in proximity within 50m would be assigned 30.

In the final step, we would be using the k-mean initialization to allocate homeless’ within the region efficiently. We would be separating into 2 groups to allocate within the 800m radius using the two centroids visualized below.

    We would be running four iterations of the k-means clustering as shown below.


Through the smart allocation of homeless between churches, we would be able to achieve up to 23% efficiency in housing homeless’ in an 800m radius of the San Francisco City Hall. This new plan would achieve up to 730 homeless housing in the city instead of 560 homeless’ and the effects would clearly be effective in fighting homelessness in San Francisco. If we would be able to roll out this throughout the San Francisco City, we can expect a minimum of 3200 to up to 4300 homeless housing in a single day. This would allow bringing the rate of homeless’ on the street to half and at a level that was ten years ago. The homeless shelter and housing would start having a vacancy and more homeless would have a chance to find a stable income. This new plan would accelerate in a decrease of homelessness in San Francisco exponentially.


Jungle, R. (n.d.). FIND APARTMENTS IN YOUR AREA. Retrieved from

Eby, K., Kgo, & Kgo. (2019, July 23). History of how many people are homeless in the Bay Area. Retrieved from