Serves as a first attempt to get publicly available MATLAB code for computing the hypervolume and hypervolume contributions. The implementation is usable in 2D and 3D. For 4D and beyond, it is not so efficient, but it does produce correct results. Contributions are very welcome. The code is also available and maintained in the RODEOlib sourceforge project.
function [lm] = lebesgue_2D(F, ub)
% Efficient method for 2D objective function values
L = sortrows(F',1)';
l = length(L(1,:));
orig=ub(2);
lm = 0;
for i = 1:l
lm = lm + (min((L(1,i) - ub(1)),0) * min((L(2,i) - ub(2)),0));
if L(2,i)<=orig
ub(2) = L(2,i);
end
end
end
Please let me know if there is something fundamentally wrong with my change.
I was using your Lebesgue measure for comparing a few algorithm, but when very few (less than 10) points fall below the reference point, the algorithm produces a negative value. Originally I thought the negative values might happen when no points fall below the reference points and that I could simply replace the negative values with zeroes, but that does not seem to be the case.
Your workaround is not really one that I would use. Rather, you should make sure that you use that same upper bound reference point during the optimization. This way, the hypervolume will always increase.
Thanks for this file, very useful. I have one small problem with it though. I'm using the Lebesgue measure to track the progress of an 2-objective optimisation problem (both objectives are to be minimised). The idea being that if the hypervolume is increasing then the pareto front must be improving. But sometimes the Pareto front can become shorter, because new Pareto points dominate ones that were previously at the upper bound of each objective, and when this happens the hypervolume decreases. So in this case the pareto front is improving (because the new points dominate the old points) but the hypervolume is going down.
I can get around this problem by including the two solutions, from the full set of solutions, that have, respectively, the maximum value for each objective. These solutions are often not on the pareto front (since there are other designs that have a lower value for one or both objectives), so that breaks the rule in your Lebesgue measure that all solutions of F should be non-dominated. Should I worry about this?
It seems you have found a small bug. Change at line 106 b to ub and it should be fine. I updated the file in this file-exchange (takes a few hours to update, though).
The code works really good when the reference point is the default one (faster and more accurate than the Monte-Carlo approximation)
However, for more than 2 objectives, the result for lebesgue_measure.m and for approximate_hypervolume_ms.m are different unless the reference point is the boundary point containing the maximum of F for each objective (the so-called default ub point).
Am I wrong? Could you give me some feedback?
Thanks,