Well... I got the right answer by doing the graph ...
# advent-of-code
t
Well... I got the right answer by doing the graph search thing, but I'm not sure it works for all inputs (actually it probably doesn't).