@nclark Yup, you're totally right. There should have been a
toVisit.add(from);
right after toVisit
.
toVisit.add(from);
right after toVisit
.