You can use the Douglas-Peucker algorithm to get the best performance without fetching.
The algorithm builds the set under the selection, starting from only the endpoints of the original data set. At each step, a point in the original data set is added to the set for the samples, which is the โfarthestโ (maximum error) from the uncalibrated view. Thus, the algorithm includes important peaks in the original dataset and creates an undocumented representation of the minimum error.
Since you are allowed to use only 10 points in your set with insufficient sampling, you can configure the algorithm only to increase the set for the sample to size 10.
If you have an original dataset that includes too many peaks, you cannot capture them and satisfy the size limit.
Hope this helps.
source share