3 ms·
I think your priority queue is doing O(nlogn) sort for every insert https://github.com/npretto/pathfinding/blob/master/src/algo/queues/PriorityQueue.js#L27 http
by vladimirralev 6y ago
I think your priority queue is doing O(nlogn) sort for every insert https://github.com/npretto/pathfinding/blob/master/src/algo/queues/PriorityQueue.js#L27 https://github.com/npretto/pathfinding/blob/master/src/algo/...
This should be a heap with O(logn) insert instead to be truly Dijsktra/A*
- jschulenklopper 6y agoDijkstra / 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*.