py-pathfinding
Description
This is a simplest program in python that realized the 2-D path finding algorithms. Including 3 kinds algorithm, they are
- Breadth first search
- Dijkstra search
- Astar search
Dependences
- python 2.7
- opencv 2.4
- numpy
- pyplot
How to use?
graph
Graph is a map that converted from an image with black point represent obstacle and white point as avaliable area. You can draw it yourself or download from web. Here we have prepared 4 maps, where 5-9_2.png is a standard map which I draw for an office, office is a piece of part of the map; xlab401.png is my own office, and liutao.jpg is a picture of liutao that download from web, as our program has provided the functions to convert the colored image with 3 channels to gray image, you can try it as a map, but it may cost some time.
start and goal
Just the start point and goal point in 2D.
algorithm
You can choose one algorithm from above 3 by changing the code line:
d1.dijkstra()
Reference
License
MIT.