I've been thinking about using a visitor to terminate the single-source function once the destination node has been examined, however I am unsure how to handle the termination. I am also unsure as to whether this is the most efficient way of generating a single-pair solution.