TL;DR
This paper rigorously evaluates the effectiveness of balanced crossover operators in genetic algorithms for cryptography-related optimization problems, demonstrating their advantages over traditional methods through statistical analysis.
Contribution
It provides a thorough statistical comparison of new and existing balanced crossover operators, revealing their performance benefits in cryptography and coding theory problems.
Findings
Balanced crossover operators outperform traditional one-point crossover.
Left-to-right variants generally perform better than shuffled variants.
Newly proposed crossover operators show promising results.
Abstract
In several combinatorial optimization problems arising in cryptography and design theory, the admissible solutions must often satisfy a balancedness constraint, such as being represented by bitstrings with a fixed number of ones. For this reason, several works in the literature tackling these optimization problems with Genetic Algorithms (GA) introduced new balanced crossover operators which ensure that the offspring has the same balancedness characteristics of the parents. However, the use of such operators has never been thoroughly motivated, except for some generic considerations about search space reduction. In this paper, we undertake a rigorous statistical investigation on the effect of balanced and unbalanced crossover operators against three optimization problems from the area of cryptography and coding theory: nonlinear balanced Boolean functions, binary Orthogonal Arrays…
Click any figure to enlarge with its caption.
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5
Figure 6
Figure 7
Figure 8
Figure 9| Problem | Instance | UNB Size | BAL Size |
|---|---|---|---|
| Bal-NL | |||
| Bent | |||
| Bin-OA | |||
| Problem | Instance | MoO | GAb | CLONALGb | opt-IAb |
|---|---|---|---|---|---|
| Bal-NL | |||||
| Bent | |||||
| Problem | Instance | MoO | GA-CB | GP |
|---|---|---|---|---|
| Bin-OA | ||||
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Balanced Crossover Operators in Genetic Algorithms
Luca Manzoni
Dipartimento di Matematica e Geoscienze, Università degli Studi di Trieste, Via Valerio 12/1, 34127 Trieste, Italy
Luca Mariot
DISCo, Università degli Studi di Milano-Bicocca, Viale Sarca 336/14, 20126 Milano, Italy
Eva Tuba
Faculty of Informatics and Computing, Singidunum University Danijelova 32, 11000 Belgrade, Serbia
Abstract
In several combinatorial optimization problems arising in cryptography and design theory, the admissible solutions must often satisfy a balancedness constraint, such as being represented by bitstrings with a fixed number of ones. For this reason, several works in the literature tackling these optimization problems with Genetic Algorithms (GA) introduced new balanced crossover operators which ensure that the offspring has the same balancedness characteristics of the parents. However, the use of such operators has never been thoroughly motivated, except for some generic considerations about search space reduction.
In this paper, we undertake a rigorous statistical investigation on the effect of balanced and unbalanced crossover operators against three optimization problems from the area of cryptography and coding theory: nonlinear balanced Boolean functions, binary Orthogonal Arrays (OA) and bent functions. In particular, we consider three different balanced crossover operators (each with two variants: “left-to-right” and “shuffled”), two of which have never been published before, and compare their performances with classic one-point crossover. We are able to confirm that the balanced crossover operators performs better than all three balanced crossover operators. Furthermore, in two out of three crossovers, the “left-to-right” version performs better than the “shuffled” version.
**Keywords ** genetic algorithms, crossover operators, balanced bitstrings, Boolean functions, orthogonal arrays, bent functions
1 Introduction
Crossover (or recombination) operators play a crucial role in Genetic Algorithms (GA). The idea underlying crossover, borrowed from biological evolution, is quite simple: given two candidate solutions, combining parts of their chromosomes will yield an offspring potentially having better fitness than the parents. This strategy stands on the observation that fit individuals share some traits encoded at the chromosome level, which can be inherited by their children via crossover. Indeed, this intuition has been formalized by Holland [6] with the concept of building blocks used in schema theory.
There exist several classes of combinatorial optimization problems whose feasible solutions must contain a specified number of ones, i.e. they must have a fixed Hamming weight. Examples of such problems come, for instance, from the domain of cryptography, where balanced Boolean functions are used to design symmetric key cryptosystems [1]. Another research area where balanced binary strings are sought is that of combinatorial designs: there, one is interested in constructing subsets of a certain support space (called blocks) which satisfy specific balancedness constraints [20]. A third research field where fixed-weight bitstrings are used is that of portfolio optimization; indeed, a portfolio can be represented by a binary vector where the positions set to indicate that the corresponding assets have been selected [7].
Genetic algorithms seem like a sensible choice for solving the optimization problems mentioned above. However, breeding feasible solutions which have a fixed Hamming weight is something that classic GA recombination operators such as one-point crossover cannot handle. As a matter of fact, starting from two individuals with the same number of ones and applying one-point crossover will likely produce an offspring having a different Hamming weight. This is due to the fact that one-point crossover (as well as most other recombination operators in the literature) does not enforce any control over the multiplicities of the alleles copied in the offspring. Of course, this drawback in dealing with fixed-weight bitstrings can be addressed at the fitness function level. Since we do not have any guarantee that the offspring has the desired number of ones, the idea is to add a penalty factor to the fitness function which punishes deviations from the expected Hamming weight. Although being the simplest solution to cope with this constraint, one might argue that it wastes a lot of fitness evaluations, because most of the solutions generated by classic crossover operators will violate the fixed-weight property.
An alternative way to address this problem is to design new recombination operators that preserve the Hamming weight of the bitstrings, which we term balanced crossover operators in what follows. The first researchers who pioneered this approach in the area of cryptography were Millan et al. [14], who proposed a counter-based crossover operator to evolve balanced Boolean functions, which was later adapted to evolve plateaued functions in [10]. Similar operators have been later proposed for GA applied to combinatorial designs problems [11, 12], portfolio optimization [2, 3], multiobjective -subset selection [13] and disease classification [18, 19].
Looking at the existing literature, one can remark that the introduction of balanced crossover operators has never been thoroughly motivated. In fact, the only recurring motivation supporting the use of such operators is the reduction of the search space (see e.g. [12]). To be sure, restraining the crossover operator to produce only fixed Hamming weight bitstrings greatly shrinks the space of candidate solutions searched by GA. Nonetheless, although the reduction is quite evident for short strings, this advantage becomes less clear as the Hamming weight approaches , since . Moreover, most of the works in the literature employing balanced crossover operators do not perform a sound comparison of their results with those that can be obtained with classic operators. Hence, it is not even clear on a statistical basis whether balanced crossover operators actually bring any advantage to GA working with fixed Hamming weight bitstrings.
The aim of this paper is to begin closing this gap by performing a thorough statistical comparison of balanced and classic crossover operators over a set of problems from the area of cryptography and design theory. In particular, we consider three balanced crossover operators in our investigation: the first is a modification of the counter-based operator proposed by Millan et al. [14]. The other two, as far as our knowledge goes, have never been published before, and they are based respectively on the map of ones and zero lengths chromosome encodings. For all three crossover operators, we have defined two variants: a “left-to-right” one, where the crossover is applied as usual, and a “shuffled” version, where the positions of an individual are randomly shuffled, the crossover is performed, and the positions are shuffled back in order. This operations should, in principle, counterbalance any positional bias in the crossover operator. As a term for comparison we considered one-point crossover, optimizing the Hamming weight as a penalty factor in the fitness function.
We considered three combinatorial optimization problems in our statistical investigation. The first one regards nonlinear balanced Boolean functions, where the goal is to maximize the nonlinearity of the functions while retaining their balancedness. The second problem, always concerning Boolean functions, is the evolution of bent functions, which reach the highest possible nonlinearity and, although unbalanced, have a specified Hamming weight. Finally, the third problem pertains binary Orthogonal Arrays (OA), which are Boolean matrices having balanced subsets of columns.
We carried out our experiments over three different instances for each problem. In order to compare the performances of the four crossover operators, we employed a non-parametric statistical test over the best individual produced by each experimental run, namely the Mann-Whitney-Wilcoxon test [4]. Some works in the literature [15, 16] performed a comparison with non-parametric tests on classic crossover operators, but did not consider balanced operators.
In our experiments we considered two main types of research questions: whether the balanced operators perform better than the one-point crossover, and whether there is any difference between the “left-to-right” and “shuffled” versions of the operators. For the first question, we are able to answer affirmatively: balanced crossover operators performs better, in general, than one point crossover. In particular, using one point crossover seems to be a bad choice for those problems where the balancedness constraint plays an important role in the fitness function, i.e. in the OA problem. As for the second question, the answer is more nuanced: for two out of three crossovers, removing any positional bias is actually detrimental to the performances in some cases. Similarly to the first question, this fact is more evident in the OA problem where balancedness is a key component of the fitness function. Concerning the map of ones crossover, however, both the “left-to-right” and “shuffled” versions have similar performances.
Although this work focuses on investigating the properties of balanced crossover operators, rather than proposing them to outperform other state-of-the-art evolutionary algorithms for problems in cryptography and combinatorial design theory, we compare our results with some recent work on the subject, namely [17] for balanced nonlinear and bent Boolean functions and [12] for orthogonal arrays. While in the first case our map of ones crossover has a performance similar to those of the algorithms studied in [17], it still falls short of achieving the success rate of Genetic Programming (GP) over the OA problem in [12], altough it improves on the GA used in the same paper.
This work is an extended version of the short paper [9] presented at GECCO 2019. In particular, the new contributions concern the experiments over the bent functions and orthogonal arrays problems, and the comparison between the “left-to-right” and “shuffled” versions of the balanced crossover operators.
The remainder of this paper is structured as follows. Section 2 covers some basic background definitions about fixed Hamming weight bitstrings, and describes in detail the three balanced crossover operators investigated in our study. Section 3 formally states the three optimization problems considered in our investigation. Section 4 describes the experimental design of our study, discussing in particular the structure of the steady state GA employed in our experiments, and stating three research hypotheses about the performances of balanced crossover operators. Section 5 presents the results of our experiments, analyzing the performances of the considered crossover operators through non-parametric tests. Section 6 engages in a discussion of the three hypotheses in light of our experimental findings, and compares the obtained results with some recent work in the literature. Finally, Section 7 concludes the paper, and sketches some possible future directions of research on the subject.
2 Balanced Crossover Operators
In this section, we describe the three balanced crossover operators analyzed in our experiments. Before delving into the details of each operator, we recall some basic definitions and results about bitstrings and their Hamming weights.
Let be the finite field with two elements. A bitstring of length is a binary vector of components, each of them belonging to . We denote by the set of all bitstrings of length . In what follows, we will often endow with a vector space structure, with bitwise XOR (denoted as ) as vector sum and logical AND as multiplication by a scalar from . Given a bitstring , let be the support of , that is, the set of coordinates equal to of the bitstring. The Hamming weight of is then defined as the cardinality of its support, i.e. . If is even and , we say that the bitstring is balanced. In other words, is balanced when it is composed of an equal number of zeros and ones.
A binary string can be interpreted as the characteristic function of a set . In particular, the support of corresponds exactly to , i.e. to the image of its characteristic function. Basic combinatorial arguments show that the number of all bitstrings of length is , that is, the cardinality of the power set of . Likewise, for the size of the set of bitstrings having Hamming weight , or equivalently the number of -subsets of , is , since it corresponds to the number of ways one can choose objects out of .
The search space of interest for our investigation is precisely , which we will also call the set of -combinations in what follows. In particular, will represent the set of feasible solutions to a particular optimization problem explored by GA. Although several types of crossover operators have been proposed in the literature of GA, very few of them consider restrictions on the Hamming weights of the chromosomes, i.e. which actually restrict the search of a GA to . More generally, such crossover operators are not specifically designed to evolve -combinations.
We now describe the crossover operators adopted in our experiments. Each of these operators is based on a different encoding for the chromosome of a candidate solution, which corresponds to a specific representation of an -combination. The reader is referred to Knuth [8] for further information about the properties of these encodings. We emphasize that, while the counter-based crossover operator is an adaptation of the one conceived by Millan et al. [14], to our knowledge the other two operators have not been proposed before in the literature.
2.1 Counter-Based Crossover
As discussed above, the binary vector coding is the most obvious and straightforward way to represent a -combination: given a bitstring of length , the positions of having value denote the selected objects out of a set of , while the remaining zeros represent the unselected objects. As an example, consider the case where and . A -combination can be represented by a balanced bitstring of length , such as: .
Of course, binary vector coding is also the most natural chromosome representation for GA. However, in order to evolve only individuals with a fixed Hamming weight, one has to come up with a particular crossover operator. Perhaps the simplest way to design such an operator is to randomly select bit-by-bit the allele from the first or the second parent to be copied in the offspring (as in uniform crossover), and use counters to keep track of the multiplicities of ones and zero in the child. When one of the two counters reaches the prescribed threshold (i.e. for the ones counter and for the zero counter), the child is filled the complementary value.
To our knowledge, Millan et al. [14] were the first to propose a crossover operator based on this idea to evolve nonlinear balanced Boolean functions. We report in Algorithm 1 the pseudocode of a slightly modified operator, which we used in our experiments.
Given two bitstrings of length and Hamming weight , the procedure Counter-Cross initializes the counters ( for the number of s and for the number of [math]s) and sets to zero all the bits in the string , which will hold the chromosome of the child produced by the crossover operation. Then, for , the -th bit of is determined as follows. If the maximum number of ones (respectively, zeros) allowed has already been reached, then is set to [math] (respectively, ). In all other cases, is chosen by randomly selecting with uniform probability the -th bit of or , and the counters are updated according to the drawn value. In this way, the child produced by Counter-Cross is itself balanced.
2.2 Zero Lengths Crossover
Given the bitstring of a -combination, the zero lengths coding of is the vector which lists the distances between consecutive ones in . In other words, the values denote the lengths of the runs of zeros which separate the ones in the binary vector coding, with the particular cases of and which represent the number of zeros preceding the first and following the last in , respectively.
Clearly, in order to ensure that a given zero lengths coding vector represents a valid -combination, the following relation must hold:
[TABLE]
Following the example adopted in the previous two sections, the run length coding of the bitstring is . As we pointed out in Equation (1), the zero lengths vector of a bitstring of length and Hamming weight is valid if and only if the sum of the components in the vector equals . In a crossover operator based on the zero lengths representation it is thus necessary to control the sum of the run lengths of zeros in the offspring, while the components of the vector are copied from the parents. The pseudocode for the crossover operator that we designed for this specific coding is reported in Algorithm 2.
The operator takes as input the zero lengths vectors of two bitstrings , their length and their Hamming weight . The first steps are devoted to the initialization of the zero length vector of the child (filled with zeros) and the accumulator used to control the value of the sum of zeros in . The FOR loop cycles over the first positions of . For each iteration , an IF block initially checks whether the sum of zeros in has already reached , in which case the value of is set to zero. In the other case, a candidate parent is randomly selected between and with uniform probability. The next IF block verifies whether the value at position of the selected parent can be safely copied in the child without breaking the limit set by Equation (1). If this is the case (i.e. is at most ), then is copied in , and the accumulator is updated by adding to it . Otherwise, the value in is set to the remaining number of zeros that can be put in the child, which is . Equivalently, this means that we are copying in just enough zeros from to reach the threshold , without violating it. Then, the accumulator is directly set to , since no other zeros can be put in the child. After the FOR loop, the value of the last component in is determined by simply subtracting from the sum of zeros obtained up to that point. Thus, if reached in the FOR loop, the last component will be set to zero, otherwise it will contain the number of zeros necessary to “pad” the bitstring encoded by after its last .
2.3 Map of Ones Crossover
Suppose that is the binary vector representation of a -combination, and denote by its support. The map of ones of is the -dimensional vector where for all , and such that for all indices . In other words, the map of ones of corresponds to its support in vector form.
Thus, the map of ones representation lists the nonzero coordinates in the binary coding of a -combination. Following the example of the previous section, the map of ones corresponding to the binary string representing a -combination is , where the positions of the ones are listed in increasing order. Strictly speaking, the order of the positions is irrelevant, since they always yield the same binary representation.
One can notice that the only constraint in the map of ones is that there cannot be duplicate positions in the vector. Thus, given two bitstrings of length and weight represented by their maps of ones, the crossover operator must be aware of the common positions between them, in order to avoid duplications. Algorithm 3 reports the pseudocode for our crossover operator.
Let us suppose that we have two bitstrings of length and Hamming weight , represented respectively by the maps of ones and of length . The procedure Map-1-Cross begins by initializing the map of ones of the child and by finding the positions which and have in common. The latter operation is performed by the subroutine Find-Com-Pos, which returns the vector . Successively, for all , the value is computed as follows. One of the two parents is randomly chosen by calling the procedure Random on and . Then, a random index is selected from the candidate parent , and the value of is set equal to . In other words, the child inherits from the parent the position of the specified by the value . Finally, in order to avoid that the same position is selected in the next iterations, the value is removed from the candidate parent by using the Remove procedure. The value is also removed from the unselected parent if it is contained in .
2.4 Ordering Bias and Positions Shuffling
It can be noticed that all the balanced crossover operators that we defined in the previous sections build the child individual from left to right, i.e. by copying the genes from the parents in increasing order of position. A natural question arising from this observation is whether this particular ordering introduces any bias towards a particular subset of feasible offspring. Intuitively, this does not seem to be the case for the map-of-ones crossover, since as we remarked in Section 2.3 the phenotype bitstring depends only on the specific values contained in the map of ones encoding, and not on their ordering. On the other hand, for the counter-based and zero-length crossover operators the situation looks different. In fact, after the threshold value has been reached (be it the number of [math] or , or the sum of zero lengths), the remaining loci of the child are set deterministically. Hence, it would be reasonable to assume that the counter-based and the zero-length crossover operators induces a bias in the offspring. We remark that, although this “left-to-right” approach is prevalent in the relevant literature since Millan et al’s counter-based crossover [14], to the best of our knowledge no one investigated the impact of this design choice on the GA performance.
For this reason, we also considered a “shuffling” version of each balanced crossover operator which randomly mixes the order of the positions to be copied from the parents to the offspring, to assess if there are significant differences in performances with the “left-to-right” approach. From the pseudocode point of view, the shuffling version of each balanced operator is practically identical to its “left-to-right” counterpart, except that an additional array of length representing a random permutation of the genotype positions is passed as an input parameter to the operator. Moreover, all occurrences of used to index the positions of the child or the parents are replaced by .
3 Optimization Problems
We now give the formal statement of the three combinatorial optimization problems that we addressed in our statistical comparison of balanced crossover operators.
3.1 Nonlinear Balanced Boolean Functions
A Boolean function of variables is a map . The common way for representing a Boolean function is by means of its truth table , which is basically a binary vector of length that specifies for each input vector the output value of , in lexicographic order. A Boolean function is called balanced if its truth table is composed of an equal number of ones and zeros, i.e. it represents a -combination.
Another representation of Boolean functions used in cryptography is the Walsh transform, which is the function defined for all as:
[TABLE]
where is the scalar product modulo between the vectors . The spectral radius of a Boolean function is defined as the maximum absolute value of its Walsh transform, i.e. .
The nonlinearity of a Boolean function is defined as the minimum Hamming distance of its truth table from the set of truth tables of all linear functions, i.e. those functions whose algebraic expressions contain only XOR. This can be computed through the following formula based on the Walsh transform:
[TABLE]
In cryptography, Boolean functions which are both balanced and have high nonlinearity play a fundamental role in the design of stream and block ciphers [1]. Since the set of all Boolean functions is composed of elements, which is not exhaustively searchable for , evolutionary algorithms such as GA represent a possible method for finding highly nonlinear balanced Boolean functions in a reasonable amount of time. We formally state the combinatorial optimization problem as follows:
Problem 1**.**
Let . Find a Boolean function of variables such that is balanced and has maximum nonlinearity.
In particular, given the truth table bitstring of a Boolean function of variables, in our experiments the fitness of is computed with the following function:
[TABLE]
where is the unbalancedness penalty factor which punishes the deviation of from being a balanced function. The objective of our GA, in particular, is to maximize . Of course, when using balanced crossover operators the penalty factor is not necessary, since the candidate solutions generated by GA are always balanced functions.
3.2 Bent Functions
From Equation (3), one can see that the lower the spectral radius is, the higher the nonlinearity of a Boolean function will be. Due to Parseval’s relation [1], the minimum spectral radius is achieved when the Walsh spectrum is uniformly divided among all vectors. This means that the Walsh coefficients must all have the same absolute value , thus giving the following upper bound on nonlinearity:
[TABLE]
Clearly, equality in (5) can occur only if is even, since the Walsh coefficients of a Boolean function must be integer numbers. The Boolean functions achieving this bound are called bent, and they have several applications in cryptography and coding theory [1].
A nice feature of the Walsh transform is that the Walsh coefficient (where [math] denotes the null vector) is related to the Hamming weight of the truth table as follows:
[TABLE]
Since all Walsh coefficients of a bent function must be equal to , this means that the Hamming weight of bent functions is either or . Without loss of generality, one can narrow the attention only to the weight , since the others are obtained by simply complementing the corresponding truth tables. Hence, one can cast the search of bent functions as an optimization problem over the set of bitstrings of length and weight , which makes it amenable to GA with balanced crossover operators. For this reason, we adopted it as our second optimization problem for our investigation:
Problem 2**.**
Let be an even number. Find a Boolean function of variables such that .
Since bent functions reach the highest possible value of nonlinearity, we defined a fitness function analogous to . Given , we defined the fitness function over for Problem 2 as follows:
[TABLE]
where the unbalancedness penalty factor this time is defined as . The optimization objective is again to maximize Equation (7), since having equal to the covering bound for corresponds to the case where the nonlinearity is maximal and the deviation from the prescribed Hamming weight is zero. As in the case of , when using balanced crossover operators the unbalancedness penalty factor is not necessary.
3.3 Binary Orthogonal Arrays
Orthogonal Arrays (OA) are rectangular matrices whose submatrices satisfy a specific balancedness constraint on their rows. OA find several applications in statistics, combinatorial designs theory and cryptography [5]. In what follows, we will focus on binary OA, meaning that the matrices are Boolean. We formally define a binary OA as follows:
Definition 1**.**
Let with . A binary matrix is called a binary orthogonal array (OA) with columns, strength and index (for short, an ) if in each submatrix of rows and columns each binary -tuple occurs exactly times.
Notice that the parameter of an OA is related to its strength and number of rows by the relation .
For our third optimization problem, formally defined below, we are interested in binary OA whose columns are truth tables of Boolean functions:
Problem 3**.**
Let . Find Boolean functions of variables such that the matrix
[TABLE]
is an , with .
Hence, the goal of Problem 3 is to find -variables Boolean functions such that the bitstrings of their truth tables are the columns of a binary OA with rows and strength .
A useful property for this problem is that any binary OA of strength is also an OA of strength , for all . Taking , this implies that each column of a binary OA must be a balanced bitstring of length . Consequently, one can use a GA with balanced crossover operators to evolve candidate binary OA as a set of balanced bitstrings. New solutions are bred by applying balanced crossover and mutation independently on the single bitstrings, thus maintaining the balancedness constraint on the single columns of the array. This is the optimization approach that was adopted by Mariot et al. [12], from which we took the fitness function for our experiments. In particular, the fitness function stands on the idea of counting the repeated tuples in the submatrices of an array.
Given a binary matrix , let be a subset of indices, and let denote the submatrix obtained by considering only the columns of specified by the indices of . For all binary -tuples , let denote the number of occurrences of in , and let be the -deviation of defined as . Then, the Euclidean deviation of is defined as:
[TABLE]
The fitness function for Problem 3 is then defined for all binary matrix formed by -variables Boolean functions as follows:
[TABLE]
where the unbalancedness penalty factor is defined as the sum of the unbalancedness of all Boolean functions , that is, . As for the other two optimization problems, when using GA with balanced crossover operators this penalty factor can be dropped from the fitness function. The optimization objective is to minimize , since any binary matrix such that corresponds to a binary .
4 Experimental Setting
In this section, we describe the details of the genetic algorithm used to test the three crossover operators presented in Section 2, the parameters used to set up the experiments over the three optimization problem defined in Section 3, and the experimental hypotheses to be tested111The source code of our GA and the experimental results presented in the next section are publicly available at https://github.com/rymoah/BalancedCrossoverGA.
4.1 Genetic Algorithm Details
The genetic algorithm adopted in this work is a steady state GA where a single pair of parents is drawn from the current population at each iteration. For selection, we employed a deterministic tournament operator where the best two out of randomly sampled individuals are selected for crossover.
The four crossover operators considered in our investigation are classic one-point crossover and the three balanced crossover described in Section 2, namely counter-based, map of ones and zero-lengths crossover. Our GA generates a single child for each selected pair of parents, independently of the underlying crossover operator. In particular, since one-point crossover generates two children by design, our GA randomly selects only one of them with uniform probability, which is then subjected to mutation.
The mutation operator depends on the type of crossover: when one-point crossover is used, a classic bit-flip mutation operator is applied on the generated child. On the other hand, with balanced crossover operators a simple swap-based mutation operator is used [12]. In particular, this mutation operator swaps with probability a pair of distinct values in the child, in order to maintain its Hamming weight. Notice that swap mutation always operates on the bitstring representation. Hence, even when zero-length or map-of-ones crossover are employed, the child is first mapped to the corresponding balanced bitstring, and then swap mutation is applied to it. Further, remark that in the OA problem the mutation operator (be it bit-flip or swap mutation) is applied separately on each column composing the child, as done in [12].
Once the child has been mutated, the GA evaluates the relevant fitness function on it. In particular, depending on the optimization problem considered, if one-point crossover is used then the full form of the fitness functions , or respectively described in Equations (4), (7) and (10) is used. On the opposite, when one of the three balanced crossover operators is employed, the unbalancedness penalty factor is dropped from the computation of the fitness functions. Similarly to the choice of the mutation operator, the creation of the initial population depends on the adopted crossover operator. For one-point crossover, the population is initialized at random, without controlling the Hamming weights of the generated bitstrings. Contrarily, for balanced crossover operators each chromosome is created by generating at random each bit in the bitstring, and using a counter to keep track of the number of ones. When the prescribed Hamming weight has been reached, the chromosome is filled with zeros in the remaining positions.
Our GA uses an elitist strategy with random replacement: in particular, if the child has a better fitness value than any of its two parents, then an individual is drawn at random from the population to be replaced by the child. To guarantee elitism, if the child has a better fitness value of its two parents but not of the best individual in the whole population, then the latter is excluded from the replacement. Further, since we are more interested in comparing the performances of the crossover operators than in generating optimal solutions for the considered problems, the GA terminates after it performs a specified number of fitness evaluations.
4.2 Experimental Parameters
Table 1 reports the problem instances tested in our experiments for each of the three considered optimization problems.
The three problems in the table are respectively identified in the first column by the names Bal-NL for highly nonlinear balanced Boolean functions, Bent for bent functions and Bin-OA for binary orthogonal arrays. The second column reports the problem instances considered for each problem, which are characterized by the number of variables for the problems Bal-NL and Bent and by the set of parameters for the Bin-OA problem. The third and fourth columns report, for each problem instance, the size of the corresponding search space respectively when one-point crossover is used (UNB Size) and when balanced crossover operators are adopted (BAL size). The details for the computation of the search space sizes can be found in [12]. It can be remarked from Table 1 that for the two Boolean functions problems (Bal-NL and Bent) the use of balanced crossover operators yields a reduction of the search space between one and two orders of magnitude. On the other hand, for the Bin-OA problem the reduction is much more significant.
For each problem instance, we ran our steady state GA with each of the four crossover operators for experimental runs. Moreover, for each balanced operator we performed a separate set of runs both for the “left-to-right” and the “shuffling” versions. Hence, we tested crossover operators for a total of experimental runs for each of the three optimization problems. Each GA experiment used a population size of individuals, tournament size and stopped after fitness evaluations. Additionally, we employed a mutation probability of for the Bal-NL and the Bent problems and of for the Bin-OA problem. We chose these particular parameter values in order to compare our balanced Boolean functions and bent functions results with those reported in [17], and our OA results with those of [12].
The research hypotheses that we tested with our experiments are as follows:
- •
: One-point crossover has a worse performance than any of the three balanced crossover operators.
- •
: The shuffling versions of the counter-based and zero-length crossover have a better performance than their “left-to-right” counterparts.
- •
: There is no statistical significant difference between the shuffling and the “left-to-right” versions of the map-of-ones crossover.
In order to settle the research hypotheses above when observation of the results plots was not sufficient, we employed the Mann-Whitney-Wilcoxon test. The alternative hypothesis adopted was that the two distributions were not equal. More precisely, that the probability of a sample from the first distribution exceeding a sample from the second distribution is different from the probability of exceeding . The significance value for the statistical tests was set to .
5 Results
The results of the experiments are summarized in Figures 2– 9. Each figure represents one of the three problem instances of the three considered optimization problems. The boxplots show the median, minimum, maximum, first and third quartiles (excluding outliers) of the fitness values of the best individuals reached at the end of the experimental runs with a particular crossover operator. In all figures, the acronyms OP, CP, ZL and MoO respectively stand for one-point, counter-based, zero-length and map-of-ones crossover, with the “w/s” suffix indicating the shuffling versions of the balanced operators.
5.1 Balanced Boolean Functions
Figures 2– 3 depict the results obtained for the balanced Boolean functions problem.
From the results for , it is possible to observe that all crossover operators have the same median fitness of , which corresponds to the maximum nonlinearity achievable by balanced functions of variables. Although the results obtained by one-point crossover seem to be more dispersed towards lower values of nonlinearity, the statistical tests show no significant differences between its distribution and those of the “left-to-right” versions of the balanced operators. On the other hand, one-point crossover performs worse than the shuffling versions of all balanced operators (-values of , , and respectively for the comparisons OP-CB w/s, OP-ZL w/s and OP-MoO w/s). On the other hand, for the instance one-point crossover performs worse than all other balanced crossover operators, both shuffling and left-to-right versions. Beside being confirmed by the statistical tests, this can also be remarked by the boxplots in Figure 2, where the median fitness scored by OP is lower than the medians of the balanced operators. The situation is about the same for variables, where OP performs worse than all other balanced operators except when comparing it with the shuffling version of the zero-length crossover, since the statistical tests did not yield any significant difference between their performances. Remark that, although one-point crossover produced a maximum best fitness of which is higher than the one scored by the balanced operators, this does not correspond to a balanced solution (since the nonlinearity of balanced functions must be even).
Regarding the comparison between the left-to-right and shuffling versions of the balanced crossover operators over this problem, we detected a statistically significant difference only for the counter-based crossover over the and instances, with the shuffling version performing better (-values of and respectively). In particular, the counter-based crossover with shuffle is the only operator reaching a success rate for the instance, since all best individuals achieved the maximum fitness value of . However, when considering all three problem instances, the map-of-ones crossover seems to be the most robust operator, since from the boxplots it has the smallest dispersion. Moreover, the shuffling version of the map-of-one operator achieved the maximum nonlinearity value of for balanced Boolean functions of variables.
5.2 Bent Functions
Figures 5– 6 report the results for the bent functions problem.
For the instance there is no clear distinction among the boxplots of the different crossover operators, although it can be seen that balanced operators (in particular, left-to-right counter-based and both versions of map-of-ones) are the ones reaching the optimal nonlinearity value of . We observed moreover that one-point crossover performs worse in the statistical tests than the left-to-right version of map-of-ones and the shuffling versions of all balanced operators (-values respectively of , , and ). Similarly to the results obtained for the balanced Boolean functions problem, the situation changes for the instance. In this case, OP performs worse than all other crossover operators, again with the exception of the shuffling version of the zero-length crossover operator, where no statistically significant difference arose. This observation is also supported for variables, where there are no significant differences between OP and both versions of ZL. On the other hand, OP performs worse than both versions of CB and MoO (-values respectively of , , and ).
Concerning the balanced operators, we observed no statistically significant differences between their left-to-right and shuffling versions, except for the zero-length crossover in the instance. In this case, the shuffling version fared worse than the left-to-right counterpart (-value of ). Analogously to the previous optimization problem, the map-of-ones crossover resulted to be the best performer, obtaining statistically significant differences in all comparisons with the other balanced operators over all three problem instances, except for the case with the left-to-right counter-based crossover.
5.3 Binary Orthogonal Arrays
Figures 5– 6 report the boxplots for the results obtained on the orthogonal arrays problem.
Recall from Section 3.3 that this is a minimization problem. Hence, it can be clearly seen from the boxplots that one-point crossover scored the worse performance over all three problem instances. As a matter of fact, beside never converging to an optimal solution, all OP quantiles are substantially higher than those featured by the distributions of the balanced operators.
Comparing the left-to-right and shuffling versions of the balanced operators, we can observe from the boxplots that the shuffle operation actually worsens the performance of the counter-based and zero-length crossover over all instances. On the other hand, the statistical tests did not detect any significant difference between the left-to-right and shuffling versions of the map-of-ones operator in any problem instance.
This left us with four crossover operators, namely left-to-right CB and ZL, and both versions of MoO. Among them, however, no significant differences have been observed through the statistical tests, in any of the three problem instances.
6 Discussion
In this section, we discuss the main findings that can be deduced from the results reported in the previous section, especially with respect to the research hypotheses laid out in Section 4.2. Additionally, we compare our results with those obtained by two recent works in the literature, namely [17] for the balanced Boolean functions and bent functions problems and [12] for the orthogonal arrays problem.
6.1 Insights Gained from the Results
The results presented in Sections 5.1, 5.2 and 5.3 showed that one-point crossover overall scored as the worst performer among all tested operators. The only exceptions are represented by the instances of the balanced Boolean functions and bent functions problems, where the performance of one-point was not distinguishable from that of the counter-based and zero-length operators, and by the instances, where no significant differences between one-point and zero-length crossover could be observed. On the other hand, over the OA problem one-point crossover is clearly worse than any balanced operator, without even the need to resort to statistical tests for settling the question.
Hence, the main insight that we gain from these observations is that hypothesis , i.e. one-point crossover has a worse performance than any of the three balanced crossover operators, can be considered largely confirmed by our experiments. Using an unconstrained crossover operator such as one-point seems to be a bad choice especially in those optimization problems where the fitness function heavily relies on the balancedness property of the individuals, such as in the OA case. As a matter of fact, the main term of actually measures the balancedness of submatrices, not only of the single columns. On the other hand, in problems where the optimization effort is not only focused on the balancedness property, as in the balanced Boolean functions and bent functions cases, the advantage of balanced operators over one-point is less clear on small problem instances. This is probably due to the sufficiently limited size of the search space for the instance, which allows also one-point crossover to converge relatively easily to optimal solutions.
The indistinguishability between one-point and zero-length crossover over the and instances for these two problems, however, seems to indicate that the latter is not a suitable operator for optimization problems concerning the cryptographic properties of Boolean functions. The reason could lie in the particular representation adopted for this operator, which encodes the sequences of adjacent zeros composing a truth table. Possibly, highly nonlinear and bent Boolean functions could have a “fragmented” truth table without long runs of zeros, hence making this encoding less efficient for these problems. As far as we are aware there are no works in the literature that investigate the distribution of run lengths in the truth tables of highly nonlinear and bent functions. Hence, this could represent an interesting direction for future research to test the “fragmentation” conjecture.
The second main remark that we can obtain from our experiments concerns the ordering bias of the “left-to-right” versions of our crossover operators. Surprisingly enough, we found out not only that the shuffling operation does not give any advantage over the Boolean functions problems with the counter-based and zero-length crossovers, but also that shuffling actually damages their performances over the OA problem. Therefore, we can reasonably assert that our experiments disprove hypothesis , i.e. the shuffling versions of the counter-based and zero-length crossover have a better performance than their “left-to-right” counterparts. On the other hand, since in our results we found no statistically significant differences between the “left-to-right” and shuffling versions of the map-of-ones operator, we can consider hypothesis confirmed.
The reason for the worse performances scored by counter-based and zero-length crossovers with shuffling on the OA problem could reside in the particular structure of this optimization problem. Indeed, the fitness function tries to minimize the number of repetitions of -tuples going beyond the index . However, crossover is applied column-wise on the Boolean matrices represented by the parents, and when shuffling is adopted, each column of the child is created using a different random permutation of the positions. This could pose a problem since if two parents have a good fitness value on a particular subset of columns, changing the order of positions when crossing the single column could worsen the multiplicities of the -tuples, thus creating a child with worse fitness. On the other hand, the “left-to-right” version does not have this problem, since it adopts always the same order to copy the positions of the columns. More specifically, we suspect that there is nothing special about the left-to-right ordering: the important thing is that in the OA problem the same ordering of positions should be used over all columns, instead of different ones. It would be interesting to investigate this idea in future research by performing further experiments with fixed positions orderings other than the left-to-right one.
6.2 Comparison with other Algorithms
As noted in Section 4.2, we selected the parameter values for the GA such as mutation probabilities, population sizes, numbers of fitness evaluations and runs in order to match the experimental settings of two recent works in the literature, namely Picek et al.’s work about immunological algorithms for evolving cryptographic Boolean functions [17] and Mariot et al.’s paper about the design of binary orthogonal arrays through evolutionary algorithms [12]. For completeness, we report in this section a comparison of our results with these two works. However, a perfect comparison is not feasible due to some small differences concerning both the adopted fitness functions and the structure of the optimization algorithms. Moreover, we recall that the main focus of this paper is not about finding a balanced crossover operator that can outperform all other state-of-the-art algorithms, but rather analyzing whether balanced crossover operators give an advantage over unbalanced ones.
In Table 2 we present the comparison of the median fitness values for balanced and bent Boolean functions. Among our crossover operators, we considered only the best performing one, that is, the “left-to-right” map-of-ones crossover.
From [17] we considered the following optimization methods: Genetic Algorithms (GAb), Clonal Selection Algorithms (CLONALGb), and Optimization Immune Algorithms (opt-IAb), all using a binary encoding of the solutions. We discarded Evolution Strategies since they resulted to be the worst performers among all considered methods in [17], and all algorithms employing the floating point representation, since it is out of scope for the comparison. Regarding the balanced Boolean functions problem, we observe that all medians coincide over all problem instances and optimization methods. This can be interpreted as the fact that the problem can be successfully approached in different ways through optimization algorithms whose parameters are carefully tuned or using ad-hoc variation operators. On the other hand the map-of-ones crossover performs slightly worse than the other considered methods on the bent functions problem, with a more pronounced difference in the median fitness for higher number of variables.
Table 3 compares the success rates for the OA problem between our map-of-ones crossover and the Genetic Algorithms with counter-based crossover (GA-CB) and Genetic Programming (GP) proposed in [12].
One can remark that over the smallest problem instance the map-of-ones crossover converges more frequently than the GA-CB algorithm. In the other instances, however, both algorithms have difficulties in generating optimal solutions over all considered runs. In particular, neither GA-CB nor the map-of-ones crossover can match the performances of GP, which achieves a full success rates in two out of three instances, while it converges 93% of the time on the largest instance. Thus, the difference in the performances between GA and GP does not seem to be due to the particular variation operator employed, but rather to something about the GP representation of the candidate solutions.
7 Conclusions
In this paper, we investigated the effect of three balanced crossover operators in constraining the search space explored by a steady state GA over three combinatorial optimization problems from the domains of cryptography and combinatorial designs. The considered operators were the counter-based, zero-length, and map-of-ones crossovers and all of them were studied in both in their “left-to-right” and shuffled variants.
Regarding the novelty of the crossover operators, the counter-based crossover operator is a slightly modified version of the crossover designed by Millan et al. [14], while to the best of our knowledge the zero-lengths and map of ones crossovers are proposed for the first time in the present work.
We explored three different research questions: whether there is an advantage in using balanced crossover operators as opposed to one-point crossover, whether the shuffled versions of the counter-based and zero-length crossovers perform better than their “left-to-right” versions, and whether the shuffled version of the map-of-ones crossover performs as its “left-to-right” version.
The Mann-Whitney-Wilcoxon test was used to compare the performances of these balanced operators with that of one-point crossover, which does not enforce any constraint on the Hamming weight of the bitstrings. The obtained results showed that, in general, the balanced crossovers perform better than the one-point crossover, showing the suitability of the proposed operators for constraining the search space.
We also noticed that using shuffling either produces no significant difference or actually damages the performances in the case of the counter-based and zero-length crossover, showing that the their “left-to-right” versions might actually be more suitable. However, for the map-of-ones crossover the use of shuffling neither hinder nor improve the search.
Multiple research avenues remain open for future research. The proposed balanced crossover operators, while better than one-point crossover, does not obtain state of the art performances in tackling combinatorial optimization problems related to cryptography and combinatorial design theory. Further improving and tuning our crossover operators is then an essential step in ensuring their practical applicability in the future. Moreover, it would be interesting to discover the effect on the shape of the fitness landscape induced by the different balanced crossover operators proposed in this paper.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] Claude Carlet. Boolean functions for cryptography and error-correcting codes. In Y. Crama, , and P. L. Hammer, editors, Boolean Models and Methods in Mathematics, Computer Science, and Engineering , pages 257–397. Cambridge University Press, New York, 2011.
- 2[2] Jiah-Shing Chen and Jia-Leh Hou. A combination genetic algorithm with applications on portfolio optimization. In IEA/AIE , volume 4031 of Lecture Notes in Computer Science , pages 197–206. Springer, 2006.
- 3[3] Jiah-Shing Chen, Jia-Li Hou, Shih-Min Wu, and Ya-Wen Chang-Chien. Constructing investment strategy portfolios by combination genetic algorithms. Expert Syst. Appl. , 36(2):3824–3828, 2009.
- 4[4] Salvador García, Daniel Molina, Manuel Lozano, and Francisco Herrera. A study on the use of non-parametric tests for analyzing the evolutionary algorithms’ behaviour: a case study on the cec’2005 special session on real parameter optimization. J. Heuristics , 15(6):617–644, 2009.
- 5[5] A Samad Hedayat, Neil James Alexander Sloane, and John Stufken. Orthogonal arrays: theory and applications . Springer Science & Business Media, 2012.
- 6[6] John H Holland. Adaptation in natural and artificial systems: An introductory analysis with applications to biology, control, and artificial intelligence. U Michigan Press, 1975.
- 7[7] Hans Kellerer, Ulrich Pferschy, and David Pisinger. Knapsack problems . Springer, 2004.
- 8[8] Donald E Knuth. The art of computer programming. combinatorial algorithms, part 1, vol. 4a, 2011.
