I am trying to implement A* search on a grid in MATLAB. I am currently using a priority queue class I found herehere, but it's a bit slow. I tried to write this simple priority queue class in MATLAB:
The above code is at least 3 times faster than the one I've mentioned above. I'm getting exactly the same output from these 2 classes, and therefore I believe that the code is correct, but I'm not 100% sure if it is rightcertain. How can I check it? Is there any other way I could implement the same idea and get a faster result?
Edit: My question is on hold right now, the reason being: "Questions containing broken code or asking for advice about code not yet written are off-topic...". My question contains a working not-broken code. Please remove the hold!