I am looking for an efficient algorithm to solve the following problem:
Given $n$ points in 2D Cartesian space $p_1,\dots,p_n \in \mathbb{R}^2$ and an integer $m$, we want to find $s_1,\dots,s_m$ such that $1 \le s_1 < s_2 < \cdots < s_m \le n$ and that maximizes
$$\sum_{i=1}^{m} \|p_{s_i} - p_{s_{i+1}}\|_2,$$
where $\|p-q\|_2$ represents the $L_2$ distance between two points. In other words, we want to find a subsequence of the points $p_1,\dots,p_n$ such that the distance of following that path is maximized.
Is there an efficient algorithm for this problem?
In my application $m$ is at least 3 orders of magnitude smaller than $n$ and neighboring points $p_i,p_{i+1}$ are close to each other, which makes the search space structured. I have tried simulated annealing with and without an adaptive neighbourhood and get decent results, but I want to know if there is a optimal algorithm. Does anyone know other algorithms and ideally their complexity?