I would like to confirm solution for Question 6-b - the weighted matrix. I am having difficulty understanding the solution provided. Row 1 in the matrix represents V0, row 2 v1 and so on. The solution shows that V1 has a weighted entry of 5 with itself?
I'm also not happy with the last row...
Please clarify, maybe I'm not understanding properly...
Not correct. Function dft is recursive, so rolls back from the last vertex that cannot do any further. So from v2 to v1. All the steps are:
v0, v1, v2
rollback to v1, v5, (v2 visited),
rollback to v5, v4, (v1 visited),
rollback to v4, v3, (v1 visited),
rollback to v3, rollback to v4, rollback to v5, rollback to v1,
rollback to v0, (v3 visited)