Fixed my BFS algorithm to use Dijkstra’s now!
IDK why but earlier when I first made the BFS I was lazy and just used number of roads. Well, now it uses real road length to calculate distance. I had some problems involving queues and stuff, but it was pretty straightforward to get Dijkstra’s working.
The video just shows a case where the old algorithm would choose the super long route because it had less roads, but now it correctly chooses the shorter route.
Comments 0
No comments yet. Be the first!
Sign in to join the conversation.