A measurement of evaluating the diversity of non-dominated solutions in the objective space is introduced. It constructs alterable neighborhoods of solutions and the sizes of these neighborhoods change with the density of solution sets. The diversity relations among these neighborhoods are computed, and a metric is build. The metric can be used to compare the performance of different multi-objective optimization techniques. In particular, it can adapt to uniform test problems and non-uniform test problems. Experimental results show the proposed measurement is effective.