ai-winter / python_motion_planning

Motion planning and Navigation of AGV/AMR:python implementation of Dijkstra, A*, JPS, D*, LPA*, D* Lite, (Lazy)Theta*, RRT, RRT*, RRT-Connect, Informed RRT*, ACO, Voronoi, PID, DWA, APF, LQR, MPC, RPP, DDPG, Bezier, Dubins etc.
GNU General Public License v3.0
322 stars 47 forks source link

the running time of JPS #11

Open GitaHubMartin opened 1 week ago

GitaHubMartin commented 1 week ago

Why is the python version of JPS not as efficient as A*?

omigeft commented 1 week ago

In my testing, JPS took much less time than A*. If you still encounter situations where JPS runtime performance is not as good as A*, please provide your map and specific runtime of the two planners. Below is a simple testing example:

import time
import python_motion_planning as pmp

a_star_planner = pmp.AStar((5, 5), (45, 25), pmp.Grid(51, 31))
start_time = time.time()
cost, path, expand = a_star_planner.plan()
print("AStar Planning time: ", time.time() - start_time)

jps_planner = pmp.JPS((5, 5), (45, 25), pmp.Grid(51, 31))
start_time = time.time()
cost, path, expand = jps_planner.plan()
print("JPS Planning time: ", time.time() - start_time)