I am lacking the skill of visualizing the problem, picture [here](https://math.stackexchange.com/questions/17850/how-to-deduce-the-area-of-sphere-in-polar-coordinates/17862#17862), to decide the right intervals. The way I do it currently is to try things but the technique fails with anything more complicated to 2D. So how do you know which angle correspond to which angle range?

**[update]**

Let's break this into parts. Suppose there are two nodes, one $N$ in the north pole and one $S$ in the south pole. The distance $N-S$ is $\pi$. The distance $N-N$ is either $0$ or $2\pi$. Now, please, break this problem with nodes and graph-theoretically. See the paths are clearly different, the ending points vary: one is even and one is odd (trivially even if $N-N=0$ length accepted).