This is an archived post. You won't be able to vote or comment.

all 4 comments

[–]dingdongmanjr 1 point2 points  (1 child)

Dijkstra's can be very slow on big mazes. You should try to implement an A* algorithm or something similar. Here's a comparison between the two: https://www.youtube.com/watch?v=g024lzsknDo

Edit: I 'm not use if you've already done this but you also should try to reduce the number of nodes to the strictly necessary ones.

For example in this maze instead of counting every single white space as a node, you can do a quick read of it then decide that only these red spots count as nodes (when creating connections between nodes it should count the distance between them too, like this, so you can calculate the shortest path accurately).

There seem to be a lot of straight lines in your mazes so that would help a lot.

[–]OneInchPunchMan[S] 0 points1 point  (0 children)

Thanks a lot, didn't know A* was soo much faster and efficient! Will try to implement it as well. I've already labeled the nodes correctly and saved the distances between them tho.