You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I took a look on the degree.py solution. In the shortest_path function, the code segment:
if node.state == target:
rt = []
while node.parent is not None:
rt.append((node.action, node.state))
node = node.parent
rt.reverse()
return rt
is it necessary? I run with that segment commented and I think it is working pretty well without it taking in consideration that the same validation is done inside the for loop. I am just asking to learn. Thanks in advance.
The text was updated successfully, but these errors were encountered:
I took a look on the degree.py solution. In the shortest_path function, the code segment:
if node.state == target:
rt = []
while node.parent is not None:
rt.append((node.action, node.state))
node = node.parent
rt.reverse()
return rt
is it necessary? I run with that segment commented and I think it is working pretty well without it taking in consideration that the same validation is done inside the for loop. I am just asking to learn. Thanks in advance.
Hello blinkomaniak,
You say true. If you see this part of code that you mentioned, at the beginning of the while loop had to use it and check this condition for terminate, but in this part (# add neighbours to frontier) you don't need it repeat again. so, you can remove from code for have a clean code.
thanks
Hello fellow
Thanks for posting your solutions
I took a look on the degree.py solution. In the shortest_path function, the code segment:
is it necessary? I run with that segment commented and I think it is working pretty well without it taking in consideration that the same validation is done inside the for loop. I am just asking to learn. Thanks in advance.
The text was updated successfully, but these errors were encountered: