2 meters is the recommended distance between two people during the COVID19 pandemic. Because of this, the amount of people that can fit in a public space is more limited than what we are used to. The Social Distancing Optimizer project aims to build a system that can find a configuration of people within a space that maximizes the amount of people within a defined space (of arbitrary shape), whilst still ensuring they are as safe as possible from spreading the virus. This will allow for better planning of events in public spaces or in the development of floor plans for public spaces.

How I built it

I devised a genetic algorithm that would optimize the placements of people within a space defined as an irregular polygon such that they would all be within the recommended 2 meter distance from each other. Essentially this means generating random configurations and picking the best ones to evolve the next generation of solutions iteratively.

For the system itself, I used p5.js to create a system for users to input an image of a floor plan or a top-down view of a space, specify the area they want to fit people in, and run the algorithm to find an optimal configuration. p5 was used due to the simplicity of creating visualizations and rapid prototyping.

Challenges I ran into

There were a lot of performance issues and it was incredibly difficult to debug. As such, I wasn't able to present the algorithm on time, although the theory is there.

Accomplishments that I'm proud of

I'm glad that I was able to apply my recently gained knowledge of evolutionary algorithms and devised a theoretical solution with a fitness function that should work.

What I learned

I learned exactly how computationally intensive these algorithms can get, and that sets my next goal of learning how to better optimize them for better runtimes.

What's next for Social Distancing Optimizer

If I do decide to come back to the application I would optimize the algorithm to get something usable in real time.

Built With

Share this project: