Let \(D=\{a_1,\dots ,a_n\}\) be a finite set endowed with a metric d and X be an arbitrary strictly convex space. In this paper, we propose an algorithm for solving the following optimization problem \(\begin{aligned} \min _{\phi :D \longrightarrow X} \sum _{i,j=1}^n(d(a_i,a_j)-\Vert \phi (a_i)-\phi (a_j)\Vert )^2. \end{aligned}\) We will discuss the convergence of the algorithm, and in the case where X is an inner product space, we will prove that the proposed algorithm is convergent.