Do you mean the shortest PATH along the surface of the cylinder?
I imagine if you parametrize points by angle and height, plot your start and end points on a the plane, draw a straight line between them, and then translate those to the points on the surface to take the length.
At least, that'd be my starting point. You have to consider that angle-height coordinates aren't unique. When you plot the points, you need to plot one twice. One at one angle and one 360º less. You draw two paths and pick the shortest.
Then you'd have to prove it. I'm not sure how you'd do that, but it seems obvious enough.