TLDR:
Is there any formula, that measures the spread of a data set (like variance or std deviation), but is linear?
Longer version:
I'm working on an optimisation problem and the objective of that problem is to minimize the spread of the data. I'm currently using the variance of the data set to represent the spread of the data. My optimisation problem hence becomes a problem of minimizing the variance of the data set.
The issue is my data set is quite big and it takes a long time to compute an objective function that's quadratic. I want to find a linear function (no absolute value either) that takes the data points as input and output a representation of the spread of that data set. Is there such a function?