https://github.com/auralius/parallel-value-iteration
Finding a shortest path on a binary occupancy map
https://github.com/auralius/parallel-value-iteration
dynamic-programming mpi4py numba occupancy-grid-map openmp parallel-programming shortest-path-algorithm value-iteration
Last synced: 2 months ago
JSON representation
Finding a shortest path on a binary occupancy map
- Host: GitHub
- URL: https://github.com/auralius/parallel-value-iteration
- Owner: auralius
- Created: 2023-06-03T07:23:43.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-15T02:10:00.000Z (3 months ago)
- Last Synced: 2025-03-27T05:22:39.900Z (3 months ago)
- Topics: dynamic-programming, mpi4py, numba, occupancy-grid-map, openmp, parallel-programming, shortest-path-algorithm, value-iteration
- Language: Python
- Homepage:
- Size: 634 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Parallel value iteration
The problem here is similar to:
https://www.mathworks.com/matlabcentral/fileexchange/39034-finding-an-optimal-path-on-the-terrain
However, instead of having a terrain map where the costs correspond to the terrain heights, we now have a binary map where the cost value describes the obstacle existence.
**The main objective here is to parallelize the value iteration algorithm by using different frameworks/methods.**
Implemented frameworks so far:
- Vanilla: no parallelization
- Vectorized: state-and-input flattening to eliminate nested-for, this process only relies on NumPy
- Cython: nested parallel-for with OpenMP and Cython
- Numba: nested parallel-for with Numba
- Python multiprocessing: multiprocessing is applied to the outer-most loop, the remaining nested-loop is accelerated by using Numba
- MPI: MPI is applied to the outer-most loop, the remaining nested-loop is accelerated by using Numba### For the Cython version:
To compile the path_planner.pyx file:
```
python setup.py build_ext --inplace
```For Windows, open `setup.py` and simply replace `-fopenmp` with `/openmp`.
### For the MPI version:
Run the demo file by using the `mpiexec` command, for example:
```
mpiexec -n 2 python ./5_mpi4py/demo1.py
```where ``-n 2`` represents the number of CPU cores.
### Map files
The binary occupacy maps are the PNG files located in `maps/` directory. Maps file are taken from https://imr.ciirc.cvut.cz/planning/maps.xml.


