beaunus/stanford-algs

Test Case 5_16 in Course 2 Week 1 Issue

Opened this issue · 0 comments

After writing out the graph by hand, I believe the test case answer for 5_16 in Course 2 Week 1 should be 10,3,1,1,1, not 10,3,1,1,0. Since the inputs only write outgoing edges, and we know 16 total nodes exist in the graph (by the file name, 5_16), we see that nodes 6, 9 and 16 are not mentioned in the input file. Thus, we have our SCC's of 10 and 3, and then nodes 6, 9, and 16 make up the last size 1 SCC's of the output.

Either the file name should be changed to 5_15, which would exclude node 16 and thus provide only 2 size 1 SCC's, or the test case must be corrected. Attached is my drawn diagram of the graph with SCC's circled in red.
IMG_0411