Is there a systematic way of finding optimal rational approximations to $\pi$ whose numerator and denominator have at most $n$ digits?
More precisely:
Let $D_n$ be the set of all positive integers with at most $n$ digits and define the equivalence relation $\sim$ on $D_n\times D_n$ by $(x,y) \sim (x',y')$ iff $\frac{x}{y} = \frac{x'}{y'}$. For each fixed $n$, is there a systematic way to decide which equivalence class $[x,y]$ in $D_n\times D_n/\sim$ minimizes the residual $R(x,y) = \left|\frac{x}{y} - \pi\right|$?
For example, the optimal $D_1$ approximation is $[3,1] = \{(3,1),(9,3)\}$.
Note: it has been pointed out that you can always do this with a brute-force algorithm. That's obvious and not interesting. What is interesting is an efficient algorithm for doing this.
A philosophical point: clearly we have really, really, really good decimal approximations of $\pi$ and so rational approximations are of limited practical interest. This is therefore a question that arises from the enjoyment of mathematics for its own sake and not for its practical application.
There is. Just use any approximation method you want for $\pi$, and then calculate the differences between these approximations and the fractions you have, and take the fraction with the smallest difference.
But what I suspect is that you wanted a fast algorithm to do this. If anybody knew a method that was faster than our fastest known algorithm for computing digits of pi, well, that's a bit of a contradiction.
Otherwise, you can again use the fastest approximation for pi we have. Once you have sufficiently many digits, use the method of computing continued fractions and thus convergents to find the best approximations for pi.
Hope that helped.