Quote: Original post by anda
What do you mean by being minimized and maximized?
You stated that you want to keep the attributes balanced as much as possible.
Essentialy you want to minimize some quantified metric of 'unbalanced' (or maximize some quantified metric of balanced)
But you really havent defined what it really means to be balanced. You need to quantify it in terms other than 'pretty close' because that doesn't seperate differing instances at all.
Considering a single attribute, the 5 averages could be:
2 3 3 5 7
or
1 4 5 5 5
Which one is better? Define it mathematically. Put a single value onto each so that you may perform a comparison.
In terms of GA/SA algorithms, this mathematical definition is called your fitness function and you are trying to either minimize or maximize that value, depending on the context.
I should point out that in the above 2 examples, the average of those averages is 4 for both cases.
You really need to full-stop on your GA/SA work until you figure out how to compare the two cases.
One methodology is to sum up the squared difference between each value and the mean of values, this is a standard practice in mathematics in computing the variance or standard deviation of a sequence.
The mean is 4 in both cases, so each squared difference is (4 - x)^2 in both cases.. summing them you get:
Case 1: 2^2 + 1^2 + 1^2 + 1^2 + 3^2 = 16
Case 2: 3^2 + 0^2 + 1^2 + 1^2 + 1^2 = 12
Under this metric, the second case is "better" but I'm not sure thats what you really want.