Hacker News new | ask | show | jobs
by vladimirralev 1980 days ago
I think your priority queue is doing O(nlogn) sort for every insert https://github.com/npretto/pathfinding/blob/master/src/algo/...

This should be a heap with O(logn) insert instead to be truly Dijsktra/A*

1 comments

Dijkstra / A* search algorithm do not prescribe which algorithm to use to add/insert items to the queue, or which algorithm to use to maintain a priority queue. So, your optimization might be an improvement, but it doesn't make the process "more or less" truly Dijkstra or A*.