The distance to $A$ is 2, and the distance to $B$ is 3. So, we choose $A$.
From $A$, we have two options: going to $D$ or going back to $S$. The distance to $D$ is 4, and the distance back to $S$ is 2. So, we choose $D$.
From $D$, we have three options: going to
Show more…