The Farey sequence $\mathcal{F}_n$ is the list of all fractions in increasing order (in lowest terms) from $0$ to $1$, having denominator at most $n$. My question is, given some $a/b\in\mathcal{F}_n$ for known $n$, what is the most efficient method to find the fractions in $\mathcal{F}_n$ that are adjacent to $a/b$?
Here is one method. Suppose $\frac{a_0}{b_0}<\frac{a}{b}<\frac{a_1}{b_1}$ are consecutive terms of $\mathcal{F}_n$ for a known $n$. We want to find $a_0/b_0$ and $a_1/b_1$. By definition of $\mathcal{F}_n$, we want to minimize the differences $\frac{a}{b}-\frac{a_0}{b_0}$ and $\frac{a_1}{b_1}-\frac{a}{b}$. There is a well known property of Farey sequences that states if $a/b < a'/b'$ are adjacent terms in $\mathcal{F}_n$, then $\frac{a'}{b'}-\frac{a}{b}=\frac{1}{bb'}$. Then, the differences can be written as $$\frac{a}{b}-\frac{a_0}{b_0}=\frac{ab_0-a_0b}{bb_0}=\frac{1}{bb_0}, \frac{a_1}{b_1}-\frac{a}{b}=\frac{a_1b-ab_1}{b_1b}=\frac{1}{b_1b}.$$ Thus, $ab_0-a_0b=1$ and $a_1b-ab_1=1$. Since $\gcd(a,b)=1$ we can find $(a_0,b_0)$ and $(a_1, b_1)$ due to Bézout's Identity and the extended Euclidean algorithm.
Alternately, we could have drawn a tree diagram of sorts and used bounding arguments to arrive at the solutions.
Are there any other (maybe more efficient?) methods of finding $(a_0, b_0)$ and $(a_1,b_1)$? How can we find the computational complexities of such methods? Is there a method known to be most efficient? Any ideas are appreciated.