  We study the problem of finding a minimum-distortion embedding of the
shortest path metric of an unweighted graph into a "simpler" metric $X$.
Computing such an embedding (exactly or approximately) is a non-trivial task
even when $X$ is the metric induced by a path, or, equivalently, into the real
line. In this paper we give approximation and fixed-parameter tractable (FPT)
algorithms for minimum-distortion embeddings into the metric of a subdivision
of some fixed graph $H$, or, equivalently, into any fixed 1-dimensional
simplicial complex. More precisely, we study the following problem: For given
graphs $G$, $H$ and integer $c$, is it possible to embed $G$ with distortion
$c$ into a graph homeomorphic to $H$? Then embedding into the line is the
special case $H=K_2$, and embedding into the cycle is the case $H=K_3$, where
$K_k$ denotes the complete graph on $k$ vertices. For this problem we give
  -an approximation algorithm, which in time $f(H)\cdot \text{poly} (n)$, for
some function $f$, either correctly decides that there is no embedding of $G$
with distortion $c$ into any graph homeomorphic to $H$, or finds an embedding
with distortion $\text{poly}(c)$;
  -an exact algorithm, which in time $f'(H, c)\cdot \text{poly} (n)$, for some
function $f'$, either correctly decides that there is no embedding of $G$ with
distortion $c$ into any graph homeomorphic to $H$, or finds an embedding with
distortion $c$.
  Prior to our work, $\text{poly}(\mathsf{OPT})$-approximation or FPT
algorithms were known only for embedding into paths and trees of bounded
degrees.
