Tuesday 1 November 2022

Java programming is environmental friendly

I recently came across this paper, which provides experimental evidence that show that programming with different languages has different environmental footprint. It is reasonable to say that this is true, although I really believe that no one has every consider this while programming. 
The good news is that I don't have to give up my Java habits, as Java has a good environmental footprint. Also I can find in this study one more excuse to avoid Python, it has a bad environmental footprint.
Of course Python is great but old habits die hard.

Friday 26 August 2022

On the order of executing genetic procedures

The classical approach on genetic algorithm design is to generate an initial population and then in every generation to execute Selection, Crossover and then Mutation; in that particular order. I often place Selection last, after Crossover and Mutation. There are pretty good reasons for following any of the two approaches and the answer to the question of which forms the best strategy is as usually case dependant.

By placing Selection first in order, you actually make a cleaning of the population from weak solutions and then go on with the rest of the procedures. If the population contains lots of invalid or bad solutions without any hope that they will generate a good solution via Crossover or Mutation then this strategy is profitable. But in case the initial population covers a small part of the solution space then starting with Selection limits the possibilities of reaching a goal solution.

Placing Selection last enables the search of a larger part of the solution space and finally choose the best of them. Especially on NP-hard problems where the solution space is large, this strategy enables first the exploration of a wide part of the space and then the cleanup which is a more fruitful strategy.