I am trying to align an ordered set of n real, strictly positive numbers
$$Q = {q_{1},q_{2},..., q_{n}}$$
to a reference set of the same size and with the same properties
$$R = {r_{1},r_{2},..., r_{n}}$$
I am looking for an analytical solution to find the resulting set
$$S = {s_{1},s_{2},..., s_{n}}$$
that minimizes the differences between S and R
$$F(S)=\sum_1^n|r_{i}-s_{i}|$$
$$argmin_S F(S)$$
but preventing the length of each "segment" $s_{n}s_{n+1}$ from stretching too much from the original length $q_{n}q_{n+1}$, keeping the ratio between two numbers $\alpha$ and $\beta$.
$$\alpha \le {s_{n+1} - s_{n}\over q_{n+1} - q_{n}} \le \beta $$
with $0\lt\alpha \le 1$ and $\beta \ge 1$ that are input data of the problem.
In case there is not an analytical solution, I would like to find a numerical solution with a complexity that is not exponential. Thank you.