0

I have joined CS50's Artificial Intelligence with Python online course but encountered a problem in the 0th project I downloaded from their website. It's a maze project and I have to telll the computer to find the shortest path from point A to B but what is driving me nuts is that both the Algorithms (Breadth first search and Depth first search) are producing the same output that means they are both going through the same number of states while technically BFS is expected to go through relatively small amount of states than DFS. In the youtube lecture Brian does the same thing and it worked for him but when i do it i run into this issue. Any Suggestions?? Please Help!!!!!

  • What exactly do you mean by "the same output". Using maze2.txt for example, they both produce the same path (logically, there's only 1), but they each explore a different number of states,which is included in the output. That's the results I get. Did you perhaps not write the source when you changed the frontier? – DinoCoderSaurus Apr 16 at 18:07
  • they both are going through the same number of states to reach the same goal whereas QueueFrontier should have looked through a less number of states to reach the same state. That's what I mean.... – Devansh Gupta Apr 17 at 7:58
  • It's 194 by the way for both the algorithms, the number of states explored and please elaborate on "Did you perhaps not write the source when you changed the frontier" – Devansh Gupta Apr 17 at 8:01
  • Since you have moved on (added a new question on tictactoe) I'll assume that means you got it sorted. – DinoCoderSaurus Apr 17 at 10:47
  • No I couldn't solve it – Devansh Gupta Apr 18 at 3:59

You must log in to answer this question.

Browse other questions tagged .