wreszelewski / nsga2

Implementation NSGA-II algorithm in form of python library
104 stars 51 forks source link

Crowding Distance Calculation different from paper #2

Closed sp4ghet closed 7 years ago

sp4ghet commented 7 years ago

I believe the crowding distance calculation is different from the one in the NSGA-II(Deb, 2000) paper.

The offending line of code is here, and looks like:

front[index].crowding_distance = (front[index+1].crowding_distance - front[index-1].crowding_distance) / (self.problem.max_objectives[m] - self.problem.min_objectives[m])

However, in (Deb 2000), the crowding distance is calculated as follows:

image

The last line would correspond to the above code. Is there a particular reasoning behind this? Thanks.

kamilmielnik commented 7 years ago

This implementation was not based on aforementioned paper.

I believe the denominator might be there just for normalization purposes, but this is a wild guess.

Please keep in mind that this was a university project and the code is no longer maintained.

sp4ghet commented 7 years ago

I see, thanks for the response. I totally understand, I'm going through and rewriting some of it for my own purposes but I might come back with more questions if I don't understand something. Thanks!

I tried replacing the crowding distance calculation with the one from the paper and the HVR didn't change by a significant amount so I'm sure both implementations are functional and the normalization might actually help where it's relevant.