Context variety can also be calculated using the set cover problem.
a left or right character (or word) that most covers the occurrence of the N-gram is iteratively selected until all the occurrences are covered.