There is a problem of facility location that I solve with genetic algorithms.
I can get good results. So I would like to compare my genetic algorithm complexity O(n^2) with the brute force algorithm. But I am not getting an answer.
(n = number of individuals in my population, usually 200.)
See the picture attached. Ignore the gray and pink squares. I want to know the complexity to find all the solutions for the problem. The problem is how I can connect the blue circle to the black squares.
In the picture, you can see one possible combination.
But in the worse scenario I see a O(k!), where k is the number of available places (20x20 in this case = 400).
If that is correct, in the worst scenario this would take 400! to be computed.
How I did it? I considered that for the first k places in the scenario I would have k-1 available places, and so on. In the worst case, I would have:
k.(k-1).(k-2).(k-3),...,1 possibilities
Is that correct?