This project demonstrates two approaches for multi-objective optimization using the NSGA-II genetic algorithm to determine optimal locations for nursing service centers.
Two case studies are included:
- London — simulated data
- Shanghai — real-world data sourced from a published dataset
The Shanghai dataset originates from the paper:
Efficient methods for a bi-objective nursing home location and allocation problem: A case study
Applied Soft Computing, 2018
DOI: 10.1016/j.asoc.2018.01.014
Dataset: http://pan.baidu.com/s/1kUFD3wV
This repository is used to support and reproduce our paper presented at a conference.
It does not aim to fully reproduce the referenced Shanghai study.
Instead, it is inspired by its approach and uses the dataset for demonstration purposes — showing how the NSGA-II algorithm can be implemented and adapted to solve similar nonlinear, constrained, multi-objective optimization problems in domains such as healthcare service network design, especially using Python.
- Implementation of NSGA-II from scratch in MATLAB and python.
- Two regional case studies (London, Shanghai)
- Example scripts for visualization and Pareto front plotting
- Modular design for easy adaptation to other datasets
This code is intended for research and educational use only.
The Shanghai dataset remains the intellectual property of the original authors and is used here solely for demonstration and non-commercial academic purposes.
- File:
london-overlay-nsga-map-app.py - Purpose: Interactive, visual demonstration of NSGA-II for nursing center placement in London.
- Features:
- Animated genetic algorithm evolution over generations.
- Interactive map with candidate locations and patient heatmap.
- Slider and step button for exploring generations.
- Designed for teaching, demo, and intuitive understanding.
- File:
nsga_reproduced.py - Purpose: Detailed, reproducible implementation of NSGA-II for scientific analysis and paper reproduction.
- Features:
- Loads real candidate and demand data from Excel files in
data/. - Compares NSGA-II optimization with a baseline method.
- Plots spatial solutions and Pareto fronts.
- Outputs results for publication and benchmarking.
- Loads real candidate and demand data from Excel files in
See requirements-streamlit.txt for minimal dependencies.
See requirements-nsga.txt for scientific dependencies.
If you want to install everything at once, use requirements.txt.
- The Streamlit app uses simulated data (random lat/lon within London's bounding box).
- The NSGA-II reproduction uses real candidate and demand data from Excel files in the
data/folder. - Both parts use the pymoo library for multi-objective optimization.
- No external APIs (e.g., Google Maps) are used, making this easy to run offline or in classroom settings.
- Python 3.7+
- pip
First, create a virtual environment (optional but recommended):
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activateThen install dependencies from requirements-streamlit.txt or requirements.txt.
pip install -r requirements.txtstreamlit run london-overlay-nsga-map-app.pyThis will open a new browser window with the interactive map interface.
- Install dependencies from
requirements-nsga.txtorrequirements.txt. - Ensure your Excel data files are in the
data/folder. - Run the script:
python nsga_reproduced.py- Include real healthcare facility locations as constraints.
- Replace the objective function with real-world service efficiency metrics.
- Extend the analysis to other cities or datasets.
This software is licensed for NON-COMMERCIAL use only. For commercial use, please contact prof.dr.rer.nat.lu@gmail.com.
See LICENSE for license details.
Scan to visit the GitHub repository:


