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.
Same problem here, x = lhsu(M, zeros(M,1), ones(M,1))';
lhsu function is not defined
when i ran the function
generate_hv_testset(M, l, testno)
it is giving an error message stating an error in
x = lhsu(M, zeros(M,1), ones(M,1))';
where is this function defined
lhsu(M, zeros(M,1), ones(M,1))'
I suggest changing lebesgue_2D to this:
function [lm] = lebesgue_2D(F, ub)
% Efficient method for 2D objective function values
L = sortrows(F',1)';
l = length(L(1,:));
lm = 0;
for i = 1:l
lm = lm + (min((L(1,i) - ub(1)),0) * min((L(2,i) - ub(2)),0));
ub(2) = L(2,i);
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.
Thanks Johannes, I was just logging in to say the same thing - I figured it out for myself! Thanks for the code, very helpful.
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?
Thanks again for your file.
Now it works perfectly,
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?
Minor bug fix.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.