given values of x. The final fitness is the highest
of the partial fitness values.
2. SYMMETRIC RESULT (SR-fitness): The result
is expected symmetrically with respect to the in-
put. For example, if 0000011100000 corresponds
to initial CA state for x = 3, then the result y = 3
2
is expected as a specific CA state 00rrrrrrrrr00
(each r may be represented by any non-zero state).
The fitness is the number of cells in the expected
state.
The fitness evaluation of each genome is performed
by simulating the CA for initial states with the val-
ues of x from 2 to 6. The result of the x
2
calculation
is inspected after the 99th and 100th step of the CA,
which allows to involve the state stability check into
the evaluation. This approach was chosen on the basis
of the maximal x evaluated during the fitness calcula-
tion and on the basis of the number of steps needed
for the square calculation using the existing solution
(Wolfram, 2002). In particular, the fitness of a fully
working solution evaluated for x from 2 to 6 in a 100-
cell CA is given by F
max
= 5 ∗ 2∗ 100 = 1000 (there
are 5 different values of x for which the result x
2
is in-
vestigated in 2 successive CA states, each consisting
of 100 cells). The evolved transition functions, satis-
fying the maximal fitness for the given range of x, are
checked for the ability to work in larger CAs for up
to x = 25 For the purposes of this paper, the solutions
which pass the check are considered as generic.
The EA works with a population of 8 genomes ini-
tialised randomly at the beginning of evolution. After
evaluating the genomes, four candidates are selected
randomly, the candidate with the highest fitness be-
comes a parent. An offspring is created by mutating
2 randomly selected integers in the parent. The selec-
tion and mutation continue until a new population of
the same size is created and the evolutionary process
is repeated until 2 million generations are performed.
If a solution with the maximal fitness is found, then
the evolutionary run is considered as successful. If
no such solution is found within the given generation
limit, then the evolutionary run is terminated.
4 EXPERIMENTAL RESULTS
The evolutionary design of CAs for the generic square
calculation has been investigated for the following
settings: the number of states 4, 6, 8 and 10, the tran-
sition functions consisting of 20, 30, 40 and 50 CMRs
and two ways of the fitness calculation described in
Section 3. For each setup, 100 independent evolution-
ary runs have been executed. The success rate and av-
erage number of generations needed to find a working
solution were observed with respect to the evolution-
ary process. As regards the parameters of the CA, the
minimal number of rules and steps needed to calculate
the square of x were determined.
4.1 Results for the RA-fitness
For the RA-fitness, the statistical results are sum-
marised in Table 1. The table also contains the total
numbers of generic solutions discovered for the given
state setups and parameters determined for these solu-
tions. For every number of states considered, at least
one generic solution was identified. For example, a
transition function was discovered for the 4-state CA,
which consists of 36 table rules (transformed from
the CMR representation evolved). This solution can
be optimised to 26 rules (by eliminating the rules
not used during the square calculation) which repre-
sents the simplest CA for generic square calculations
known so far (note that Wolfram’s CA works with 8
states and 51 rules (Wolfram, 2002)). Moreover, for
example, our solution needs 74 steps to calculate 6
2
whilst Wolfram’s CA needs 112 steps, which also rep-
resents a substantial innovation discovered by the EA.
The CA development corresponding to this solution is
shown in Figure 2.
Another result obtained using the RA-fitness is il-
lustrated by the CA development in Figure 3. In this
case the CA works with 6 states and its transition
function consists of 52 effective rules. The number of
steps needed, for example, to calculate 6
2
, is 46 (and
compared to 112 steps of Wolframs CA, it is an im-
provement of the CA efficiency by more than 50%)
which represents the best CA known so far for this
operation and the best result obtained in this paper.
One more example of evolved CA is shown in
Figure 4. This generic solution was obtained in the
setup with 8-state CA, however, the transition func-
tion works with 6 different states only. There are
49 transition rules, the CA needs 68 steps to calcu-
late 6
2
. This means that the EA discovered a simpler
solution (regarding the the number of states and ta-
ble rules) which is a part of the solution space of the
8-state CA. Again, this result exhibits generally bet-
ter parameters compared to the known solution from
(Wolfram, 2002). The CA development, that was not
observed in any other solution, is also interesting vi-
sually - as Fig. 4 shows, the CA generates a pattern
with some “dead areas” (cells in state 0) within the
cells that subsequently form the result sequence. The
size of these areas is gradually reduced, which finally
lead to derive the number of steps after which a stable
state containing the correct result for the given x has
emerged (illustrated by the right part of Figure 4 for