2

I am trying to explore genetic algorithms (GA) for the bin packing problem, and compare it to classical Any-Fit algorithms. However the time complexity for GA is never mentioned in any of the scholarly articles. Is this because the time complexity is very high? and that the main goal of a GA is to find the best solution without considering the time? What is the time complexity of a basic GA?

user1340852
  • 665
  • 2
  • 6
  • 22
  • 2
    The time complexity of GA is infinity. However, the advantage of GA is that you can stop the algorithm at any point, and have an approximate solution to the problem. And that is the main goal of GA: find a good approximate solution in a fixed predetermined amount of time. – user3386109 Mar 10 '18 at 08:27
  • I see, that makes sense now. Thanks :) – user1340852 Mar 10 '18 at 08:40

1 Answers1

1

Assuming that termination condition is number of iterations and it's constant then in general it would look something like that:

O(p * Cp * O(Crossover) * Mp * O(Mutation) * O(Fitness))
p - population size
Cp - crossover probability
Mp - mutation probability

As you can see it not only depends on parameters like eg. population size but also on implementation of crossover, mutation operations and fitness function implementation. In practice there would be more parameters like for example chromosome size etc.

You don't see much about time complexity in publications because researchers most of the time compare GA using convergence time.

Edit Convergence Time

Every GA has some kind of a termination condition and usually it's convergence criteria. Let's assume that we want to find the minimum of a mathematical function so our convergence criteria will be the function's value. In short we reach convergence during optimization when it's no longer worth it to continue optimization because our best individual doesn't get better significantly. Take a look at this chart:

enter image description here

You can see that after around 10000 iterations fitness doesn't improve much and the line is getting flat. Best case scenario reaches convergence at around 9500 iterations, after that point we don't observe any improvement or it's insignificantly small. Assuming that each line shows different GA then Best case has the best convergence time becuase it reaches convergence criteria first.

Michael Dz
  • 2,940
  • 5
  • 24
  • 54
  • Thanks a lot for your answer. Is there a scholarly link that you can refer to for this information? – user1340852 Mar 23 '18 at 14:06
  • 1
    What I gave you is simplified time complexity, there aren't many publications about it but I hope it'll help you: [link1](http://medal-lab.org/files/99014.pdf), [link2](https://pdfs.semanticscholar.org/1547/7bb3b7ac1e605a66af68cc73afe52268e6f6.pdf). – Michael Dz Mar 26 '18 at 09:38
  • Thank you. it is a bit difficult to understand the time complexity. I was trying to look for convergence time. can you explain in plain english, what is convergence time and how do they compare? – user1340852 Mar 27 '18 at 06:31
  • 1
    @user1340852 Added explanation in the answer. – Michael Dz Mar 28 '18 at 10:06