Can you compute geodesics by treating it as a problem where you want to minimize the length of a curve through two points on a specified surface while having the constraint that the curve must reside on the specified surface?
If so, can you explain how one could do so for a cylinder?
Or is the calculus of variations the only method by which to do so?
I tried setting up the constrained optimization problem for a cylinder but was unable to make any progress, leading me to think that maybe it's impossible to solve the problem without the calculus of variations.
The calculus of variations is perhaps the most natural way of defining geodesics on a surface (via extremality of length or energy), but there is an easier definition that is sometimes more direct in specific cases. Thus, if a surface in $\mathbb R^3$ has a regular parametrisation $X(u^1,u^2)$ and a curve $\alpha(s)=(\alpha^1(s),\alpha^2(s))$ is regular, then the resulting curve $\beta(s)=X(\alpha(s))$ will be a geodesic if and only if the second derivative $\beta''(s)$ is normal to the surface. This can be easily shown to be equivalent to the usual equations ${\alpha^k}'' +\Gamma_{ij}^k {\alpha^i}'{\alpha^j}'=0$ for $k=1,2$.