We describe algorithms to compute the shortest path homotopic to a given path, or the shortest cycle freely homotopic to a given cycle, on an orientable combinatorial surface. Unlike earlier results, our algorithms do not require the input path or cycle to be simple. Given a surface with complexity n, genus g 2, and no boundary, we construct in O(gn log n) time a tight octagonal decomposition of the surface--a set of simple cycles, each as short as possible in its free homotopy class, that decompose the surface into a complex of octagons meeting four at a vertex. After the surface is preprocessed, we can compute the shortest path homotopic to a given path of complexity k in O(gnk) time, or the shortest cycle homotopic to a given cycle of complexity k in O(gnk log(nk)) time. A similar algorithm computes shortest homotopic curves on surfaces with boundary or with