We built a city-simulation to model the business infrastructure of a city and use density patterns throughout the user's preference selection to optimally suggest and help choose a location and evaluate the user's choice of location. Business location can be the difference between success and struggle, but most entrepreneurs rely on intuition rather than science to pick the perfect spot. At Prime Plot, we’re driven to take the guesswork out of this process aiming to help aspiring business owners make informed decisions.
We are using Generalized Voronoi Diagrams (GVDs) to identify optimal business locations by evaluating proximity and minimizing competition. The red spots on the map represent existing businesses, while green spots represent the vertices of GVDs, which are potential locations suggested for new businesses. The lines, or GVD bisectors, form boundaries that divide areas based on their distance to nearby businesses. By placing new business locations on or near these green vertices, we ensure maximum coverage of the surrounding area while reducing overlap with established competitors. This helps identify strategically advantageous locations for new businesses. Our hypothesis with using Generalized Voronoi Diagrams (GVDs) in Prime Plot is that positioning new businesses near GVD vertices will help maximize reach while minimizing direct competition. The GVD vertices, marked as green spots, are points of equidistance from surrounding competitors, represented by red spots on our map. By identifying these strategic points, we aim to suggest locations that are optimally placed between existing businesses, balancing accessibility to customers with minimal interference from nearby competitors. However, we recognize that GVDs alone don't capture the full complexity of a successful business location. Beyond just spatial distance, we factor in other key demographics, such as population density by age group, opening and closing time intervals of similar businesses, proximity to schools, office zones, and rental rates. By overlaying this demographic data with GVD-generated locations, we ensure that our recommendations align not only with spatial advantage but also with the specific needs and behaviors of the target customer base in each area. This approach allows us to fine-tune recommendations, making them both geographically strategic and deeply informed by the community profile, ultimately helping entrepreneurs choose locations that maximize their success potential.
This architecture diagram showcases our solution’s approach to suggesting optimal business locations by integrating spatial analysis with demographic features. Starting with essential features like population density, age demographics, rental costs, and operational timings, we leverage Generalized Voronoi Diagrams (GVDs) to pinpoint new, strategically located points based on existing business distributions. These potential locations undergo further statistical analysis, considering nearby businesses and relevant demographic data, to refine recommendations. Our solution also includes an explainability module powered by Large Language Models (LLMs), providing clear insights for user choices. Although not fully integrated, we envisioned a comparison feature using LLM agents to debate between two suggested locations, offering more robust decision-making support. This blend of algorithmic and machine-learning methods aims to maximize business reach while tailoring recommendations to local dynamics.
The above is the architecture of our software that we were able to implement as a part of the hackathon. (red represents the feature we were not able to make it in time to incorporate in the frontend)
This data engineering and extraction architecture highlights how we process various factors to recommend business locations. Starting with key demographic features—like population, age groups, rental costs, and operating hours—we apply postprocessing steps such as one-hot encoding to prepare data for machine learning. Additionally, we use probabilistic heat maps to evaluate location attractiveness based on proximity to other companies and schools, quantified as areas under respective curves. Our pipeline also leverages the Serper API for real-time data scraping and Groq for advanced parsing, while Generalized Voronoi Diagrams and Manhattan distances help us spatially analyze and pinpoint optimal locations. This structured approach ensures that each recommendation is both data-driven and contextually relevant.
The above is the architecture for our data collection and feature extraction process.
Resolution: We believe that this data-driven approach to location selection will revolutionize how businesses find their ideal environments, fostering vibrant and interconnected commercial ecosystems. This pilot study is only the beginning, and our vision is to scale these insights to reshape urban landscapes. Much like the precision of a well-designed blueprint, our models empower stakeholders to envision a balanced, data-backed future for cities—similar to how SimCity allows us to thoughtfully construct virtual worlds, a concept inspired by our discussions with Andrej Karpathy.
To advance these simulations to a larger scale, incorporating millions of data points and refining our models with advanced compute resources, we are actively seeking support through partnerships and funding. With your support, we can further enhance our simulations, optimizing the process to recommend safer, smarter, and more dynamic locations for businesses. Together, we can create a framework that not only benefits individual enterprises but also contributes to the growth of healthier, more connected communities.
- Interactive Map Interface: Upon launching, the application displays a map interface where users can select a rectangular region.
- Business Display: All businesses within the selected area are highlighted, offering an overview of the business landscape.
- Optimal Location Recommendation: Based on six key features, the application suggests the best location within the selected region to start a business.
- Feature Visualizations: Users can explore various visualizations for population density, age demographics, and other metrics.
The recommendation algorithm takes the following features into account:
- Total Population: Population density of the area.
- Ages 0-22 Population: Density of younger residents aged 0-22.
- Ages 23-40 Population: Density of residents aged 23-40.
- Rent: Average rental costs in the area.
- Opening and Closing Times: Typical hours of operation for businesses.
- Number of Businesses: Density of businesses around the selected region.
- Voronoi Points: The application calculates Voronoi points equidistant from businesses of the same type, dividing the space into regions that represent proximity to each business.
- K-Nearest Neighbors (KNN) Analysis: For each Voronoi point, KNN identifies the nearest similar businesses. This analysis helps determine the competition level and strategic positioning.
- Python (latest version recommended)
- Node.js (latest LTS version recommended for React)
- OpenStreetMap API Access (optional but recommended for real-time data)
- Install dependencies as listed in
requirements.txtandpackage.json.
-
Clone this repository.
-
In the root folder, run the following commands:
# Backend setup pip install -r requirements.txt # Frontend setup npm install uvicorn main:app --reload npm start
- Run the application; the interactive map will open.
- Select a rectangular area on the map.
- The application displays all businesses in the selected region.
- The system performs spatial modeling and feature analysis based on the selected metrics.
- Visualizations for population density, age demographics, and other factors are available for deeper insights.
- The application suggests the optimal business location based on the analysis.
- Frontend: React.js
- Backend: Python (FastAPI)
- APIs: OpenStreetMap for geospatial data, Serper and Groq APIs for data processing
- Data Analysis: Pandas, NumPy, SciPy
- Modeling: Voronoi Diagrams, K-Nearest Neighbors
src/: Contains the React frontend code.backend/: Contains FastAPI backend code.tests/: Separate test files for backend and frontend logic.main.py: Contains theProcess_dataclass, which manages data processing tasks, including theaggregatemethod for feature extraction.
- Additional filters for business type.
- Expansion to include economic and social data indicators.
- Enhanced prediction models for business success.
Please create an issue before submitting a pull request. We welcome contributions and encourage discussing improvements.
This project is licensed under the MIT License. See the LICENSE file for more details.
Special thanks to OpenStreetMap for geospatial data and other open-source libraries used in this project.



