Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignments from Neil #11

Open
wants to merge 30 commits into
base: gh-pages
Choose a base branch
from
Open

Assignments from Neil #11

wants to merge 30 commits into from

Conversation

neiljohari
Copy link

No description provided.

@JoeOsborn
Copy link
Owner

Looks pretty good! A code cell would be nice in the "hello-world" notebook though, to sanity-check the environment.

@neiljohari
Copy link
Author

@JoeOsborn How is a6db5b4

@neiljohari
Copy link
Author

neiljohari commented Jul 15, 2016

@JoeOsborn Got the switch A* working as far as I can tell (assignment 2)

Edit: Not anymore

@chern
Copy link
Contributor

chern commented Jul 15, 2016

@skreem: Epic.

" #new_cost = cost_so_far[current] + 1\n",
" new_cost = current.cost + 1\n",
" \n",
" if not successor in visited or new_cost < current.cost:\n",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This or isn't quite right, and turns this into if not in visited or false since (current.cost+1) is never less than current.cost. You want to compare against the cost of the member of visited which is equivalent to successor. This could lead to finding suboptimal paths since the node equivalent to successor may be tagged with a higher cost but never replaced.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants