Shortest path in modular arithmetic
Let us consider the more general case in which you have $n$ vertices, and you connect $x,y$ if $x-y \equiv a \pmod{n}$ (in your case, $n = 7$ and $a = 3$).
Your graph is a union of disjoint cycles. When $n$ is prime (as in your case), it is a single cycle. Hence if you want to get from $x$ to $y$, either you keep adding $a$ (modulo $n$), of you keep subtracting $a$ (modulo $n$). If you add $m$ times the value $a$ (where $m$ is possibly negative) then $x+ma \equiv y \pmod{n}$, that is, $ma \equiv y-x \pmod{n}$. Let us now assume that $(a,n) = 1$ (for example, $n$ is prime and $1 \leq a \leq n-1$). Then $m \equiv a^{-1}(y-x) \pmod{n}$.
Solving the equation above (assuming $x \not\equiv y \pmod{n}$), there will be one solution $m_+$ in the range $1,\ldots,n-1$ and another $m_-$ in the range $-1,\ldots,-(n-1)$. The distance is $\min(m_+,-m_-)$.
In your case, $n = 7$ and $a = 3$. We can compute $a^{-1} = 5$. If $x = 0$ and $y = 1$ then $a^{-1}(y-x) = 5$, and so $m_+ = 5$ and $-m_- = 2$. So the shortest path goes backwards for two steps: $0 \to 4 \to 1$.