  Let $A$ and $X$ be nonempty, bounded and closed subsets of a geodesic metric
space $(E,d)$. The minimization (resp. maximization) problem denoted by
$\min(A,X)$ (resp. $\max(A,X)$) consists in finding $(a_0,x_0) \in A \times X$
such that $d(a_0,x_0) = \inf\{d(a,x) : a \in A, x \in X\}$ (resp. $d(a_0,x_0) =
\sup\{d(a,x) : a \in A, x \in X\}$). We study the well-posedness of these
problems in different geodesic spaces considering the set $A$ fixed. Let
$P_{b,cl,cv}(E)$ be the space of all nonempty, bounded, closed and convex
subsets of $E$ endowed with the Pompeiu-Hausdorff distance. We show that in a
space with a convex metric, curvature bounded below and the geodesic extension
property, the family of sets in $P_{b,cl,cv}(E)$ for which $\max(A,X)$ is
well-posed is a dense $G_\delta$-set in $P_{b,cl,cv}(E)$. We give a similar
result for $\min(A,X)$ without needing the geodesic extension property.
Besides, we analyze the situations when one set or both sets are compact and
prove some results specific to CAT$(0)$ spaces. We also prove a variant of the
Drop theorem in geodesic spaces with a convex metric and apply it to obtain an
optimization result for convex functions.
