haris989 / NSGA-II

This is a python implementation of NSGA-II algorithm. NSGA is a popular non-domination based genetic algorithm for multi-objective optimization. It is a very effective algorithm but has been generally criticized for its computational complexity, lack of elitism and for choosing the optimal parameter value for sharing parameter σshare. A modified version, NSGA II was developed, which has a better sorting algorithm , incorporates elitism and no sharing parameter needs to be chosen a priori.
MIT License
380 stars 158 forks source link

ptimization_speed #1

Open avengerandy opened 6 years ago

avengerandy commented 6 years ago

Hi i am MazeR, i use your code to learn NSGA-II your code is very appropriate for learning, thanks a lot

here's some speed optimization about your code the features are all same just change some function to python built-in functions like random.uniform, index and delete some slice([:]) that not necessary

the speed test on my computer original about 5.9s original(without print) about 5.1s optimization_speed about 3.6s optimization_speed(without print) about 2.8s

hope you will like : )