Challenge 2 Feedback : 9 /20
Overall: Good improvements from Challenge 1. Keep improving based on feedback below.
Feedback based on Challenge 2 Rubric:
Works: (2 x 1) = 2
BFS is correct, but your method of computing the path is incorrect - you are storing all vertices visited, not just the ones on the path. To create the path you need to keep track of the parent (the current_vertex when this vertex is added to visited) at each stage, and then recreate by backtracking through the parents.
It does work on some files (due to structure - but not on the sample file)
Code handles isolated node (does not error or compute a path) but consider adding a message "There is no path"
Documentation: 3
good header comments and docstrings.
Use PEP8 styling : snake_case not camelCase for method names. Run pycodestyle to see whitespace and line too long errors.
Code Organization: 2
Separate out printing the shortest path from computing.
Consider creating a BFS method that shortest path calls (not necessary for this challenge but will make code more modular for the future.
create a separate file for graph and challenge (and possibly for file read depending on your read structure) - see challenge 1 solution .
Testing: 2
some error handling - add to file read and graph creation methods too as these are volatile
test run on provided code - your test for BFS works and this case works (due to file structure) - so it did not show the error in your path code - write more tests to expose various cases.
Challenge 2 Feedback : 9 /20 Overall: Good improvements from Challenge 1. Keep improving based on feedback below.
Feedback based on Challenge 2 Rubric: