prepared by Evgeny Noi
Toy examples for heuristics used in locational science.
- Clone repo via git or Github Desktop
git clone https://github.com/barguzin/spatial_heuristics.git
- Navigate to the cloned repo directory
cd spatial_heuristics
- Create a Python environment (conda or pip):
conda create -n env_name
- Activate the newly created environment:
conda activate env_name
- Install requirements using pip:
pip install -r requirements.txt
- Run check_funs.ipynb notebook to see usage examples
The functions are located in spam/core.py:
make_points(n) - Generate set of points (sites) on a 2d plane using a normal distribution. Where
makde_grid(q) - Generate regular square grid over a 2d plane. Where
calculate_dist - Calculate distance via scipy.distance.cdist and store results into distance_matrix.csv in a root directory.
get_covered(r) - For each facility find the demand points that are covered given a radius (
naive_greedy(n_sited, sort_par='cnt') - Implements naive Greedy Addition algorithm for MCLP with
plot_solution - plots solution
- Greedy Addition for maximal covering
- Teitz & Bart
- Teitz, M. B., & Bart, P. (1968). Heuristic methods for estimating the generalized vertex median of a weighted graph. Operations research, 16(5), 955-961.