0

I have an input of integers (or floats), eg.

100, 203, 230, 280, 400, 410, 505, 600

And I want to filter them to get a subsequence so that the numbers would be almost evenly apart, that is, remove outsiders, in my case, the filtered sequence would be:

100, 203, 280, 400, 505, 600

Since they all lie about 100 units from each other.

In addition I also know that the average distance of the whole sequence is limited, eg. 70 < dist < 130.

What algorithm should I use?

Extra: Could the algorithm be improved that it would also work if now and then an element of the sequence would be missing, e.g. 505:

100, 203, 230, 280, 400, 410, 600

So the result would be either

100, 203, 280, 400, 600

or something like

100, 203, 280, 400, 500, 600

Also: I am working with semi-big data and would prefer prefer a fast solutions (not checking all possible subsequences for example).

Jake B.
  • 435
  • 3
  • 13

0 Answers0