Swarm intelligence versus direct cover algorithms in synthesis of Multi-Valued Logic functions

Ant Colony Optimization and Particle Swarm Optimization represent two widely used Swarm Intelligence (SI) optimization techniques. Information processing using Multiple-Valued Logic (MVL) is carried out using more than two discrete logic levels. In this paper, we compare two the SI-based algorithms in synthesizing MVL functions. A benchmark consisting of 50,000 randomly generated 2-variable 4-valued functions is used for assessing the performance of the algorithms using the benchmark. Simulation results show that the PSO outperforms the ACO technique in terms of the average number of product terms (PTs) needed. We also compare the results obtained using both ACO-MVL and PSO-MVL with those obtained using Espresso- MV logic minimizer. It is shown that on average, both of the SI-based techniques produced better results compared to thoseproduced by Espresso-MV. We show that the SI-basedtechniques outperformthe conventionaldirect- cover (DC) techniques in terms of the average number of product terms required.


Introduction
It is widely recognized by researchers as well as the chip industry that on-chip complex binary systems exhibit a number of curbs, such as large layout area for interconnections, limitations of data storage, increased power consumption, and limitation of available bandwidth. These limitations can be mostly overcome by using Multiple-Valued Logic (MVL) systems [1][2][3]. Digital information processing using MVL is carried out using more than two discrete logic levels. MVL-based information processing include arithmetic operations/ processors, memory, and special purpose processors [1]. Reported MVL (sub)-systems have shown considerable reduction both in time and speed compared to their binary counterparts [2][3][4][5]. It should however be noted that the search space for MVL synthesis problem is huge when compared to the binary one. There are r ðr n Þ ¼ 4 4 2 ¼ 2 32 2-variable 4-valued functions as compared to 16 2-variable binary functions. This makes exact minimization of MVL functions prohibitively expensive both in time and complexity. Therefore, modern heuristic optimization techniques were employed. These algorithms can be classified into iterative based [6], decomposition-based [7], algebraic based [8], direct cover-based [9][10][11], and evolutionary-based algorithms. The latter include Genetic algorithms (GAs) [12][13], Ant Colony (ACO) [14][15], and PSO-based [16]. Fuzzy-based synthesis of MVL functions has also been reported in the literature [21].
The Direct Cover (DC) algorithm is an iterative heuristic in the synthesis of MVL functions [9][10][11]. Swarm intelligence models (SIMs) are computational models inspired by real life swarm systems. The two main SIMs are the Ant Colony Optimization (ACO) [25] and the Particle Swarm Optimization (PSO) [26]. The main idea in the ACO is to model a given problem as a search conducted by ants for the optimal path guided by a substance deposited on the path called pheromone. Real ants were found to be skillful in finding the shortest path between their nests and a food source in the presence of hurdles. Particle swarm optimization (PSO) is inspired by the observation that birds fly in large groups and for long distances without collision. It is hypothesized that birds are able to achieve that through experience-sharing by maintaining an optimum distance between themselves and their neighbors. Hence, PSO is a search strategy that uses a set of flying particles with velocities that are dynamically adjusted based on past experience of individual particle and that of their neighbors in the search space. The PSO algorithm was first introduced in 1995 [21] and was later on extended as in [22,23]. There has been growing interest in the use of PSO for optimization problems [25,28,29,[35][36][37][38][39][40][44][45][46] and in synthesis of circuits [26,27]. A number of recent research work, books, and book chapters on the issue of swarm and nature-inspired algorithms have been published in the literature [47][48][49]. However, very few articles were reported on the synthesis of MVL functions, see for example [16].
The paper provides a concise coverage and comparison of both the conventional synthesis techniques of MVL functions represented by the Direct Cover algorithm and those based on the emerging functional synthesis techniques using the swarm intelligent-based algorithms. We aim to provide a useful data analytics for researchers in the area of digital synthesis for high-radix (beyond binary) logic functions. The paper also illustrates the adaptation of the discrete PSO algorithms in the area of MVL functional synthesis while showing the adopted processes used in the selection of the appropriate minterms and the appropriate implicants (product terms) to cover them. We also provide a comparison among the ACO and the PSO on one hand and the Espresso-MV standard algorithm on the other hand.
It should be noted that the two swarm intelligence based algorithms ACO and the PSO are selected in this work because of them being among the well-known swarm intelligence techniques and also in order to align our work with similar research work identified in the literature, e.g. [50].
The paper is organized as follows. Section 2 provides some background material. In Section 3 we provide a coverage of the related work published in the literature. Section 4 covers simulation results conducted using the ACO and the PSO algorithms using a benchmark consisting of 50,000 4-valued 2-varaible functions. In Section 5 we provide comparison among the results obtained out of the simulation conducted in Section 4. In Section 6 we provide a number of concluding remarks.

Background material
This section provides enough of the foundation material needed to make the paper self-stand and to help the reader to follow through the paper easily and with the minimum interruption. Table 1 shows the MVL logic operators used in this paper [15].
Definition 2 [15]: Define a product term (PT), Pðx 1 ; x 2 ; Á Á Á ; x n Þ, as the minimum of a set of window literals such that Pðx 1 ; . . . ; a n x b n n Þ where a i ;b i ∈ R; a i ≤ b i and c ∈ f1; 2; . . . ; r − 1g is the value of the product term.
Example: the product terms in Figure 1 Definition 3 [15]: Define a minterm as the assignment In the above definition a i ∈ f0; 1; . . . ; r − 1g. If the value of a minterm is r, then it is considered as don't care and is represented as d. There are 12 minterms in the function shown in Figure 1.
x n Þ for all assignments of x i 's.
Example: Figure 1 shows an example 4-valued 2-varaibale function. The objective of MVL synthesis to find the minimum form of an MVL function that can be completely or incompletely specified. As indicated above exact minimization of MVL functions is prohibitively expensive both in time and complexity and that a number of modern heuristic optimization techniques were employed. These include the direct coverbased (DC) [9][10][11], the Ant Colony (ACO) [14,15], and PSO-based [16]. In Section 5 we provide a comparison of the performance of the ACO and the PSO in the context of synthesis of MVL

The operator
The logic equation The window literal It should be noted that r 5 4 for 4-valued logic. The truncated sum (tsum) tsumða 1 ; a 2 ; . . . ; a n Þ ¼ a 1 ⊕ a 2 ⊕ . . . ⊕ a n ¼ a 1 þ a 2 þ . . . þ a n if a 1 þ a 2 þ . . . þ a n < r À 1 r À 1 otherwise Where a i ∈ R and ⊕ represents the truncated sum operation. The maximum (MAX) of two MVL variables  [50]) illustrates the fundamental difference between the two models of computation.
Having covered the needed background material, we provide a coverage of the DC, ACO, and the PSO algorithms in Section 3.

Related work 3.1 The Direct cover heuristic algorithm for synthesis of MVL functions
The Direct Cover (DC) algorithm is an iterative heuristic in the synthesis of MVL functions [9][10][11]. Figure 2 shows an adapted version of the DC.
A detailed analysis of the DC-based algorithms has been conducted jointly by the author in [17]. The results of such analysis have indicated that improvements to the conventional DC are still possible [20] and [24]. In the next section, we present the SI-based improvements of the DC in the form of the Ant Colony (ACO) and the Particle Swarm Optimization (POS).

The ACO algorithm for synthesis of MVL functions
The main idea in the ACO is to model a given problem as a search conducted by ants for the optimal path guided by a substance deposited on the path called pheromone. Real ants were found to be skillful in finding the shortest path between their nests and a food source in the presence of hurdles. The search is made possible by an indirect communication amongst the ants. While traveling their way, ants deposit a chemical substance, called pheromone, on Criteria ACO PSO

Communication Mechanism
Indirect communication through the environment (Stigmergy).
Direct communication.
Problem Type Both discrete (combinatorial) and continuous optimization problems.
Both Continuous and discrete (combinatorial) optimization problems. Problem Representation Using weighted (construction) graph. Set of n-dimensional points.

Algorithm Applicability
Problems with predefined source and destination Problems where previous and next particle positions at each point are uniquely defined.  ACI the ground. When they arrive at a decision point, they make a probabilistic choice, biased by the intensity of pheromone they smell, see Figure 3(a). This behavior has an autocatalytic effect since choosing a given path increases the likelihood that the same path will be chosen again by future ants. On their way back, ants are expected to choose the same path with high probability (due to the increase in the amount of pheromone), see Figure 3(b). As further pheromone is released, the chosen path will become more attractive for future ants. See Figure 3(c) [34].
The basic algorithmic steps in an ACO are shown in Figure 4.
A key point in the development of ACO is the selection of an appropriate fitness function. The fitness function is often formulated as cost minimization of the solution of the given problem. The ACO algorithm has received much attention and has been incorporated in a number of optimization problems [16][17][18][19][20][21][30][31][32][33]43].

The PSO algorithm for synthesis of MVL functions
Particle swarm optimization (PSO) is inspired by the observation that birds fly in large groups and for long distances without collision. It is hypothesized that birds are able to achieve that through experience-sharing by maintaining an optimum distance between themselves and their neighbors. Hence, PSO is a search strategy that uses a set of flying particles with velocities that are dynamically adjusted based on past experience of individual particle and that of their neighbors in the search space. The PSO algorithm was first introduced in 1995 [21] and was later on extended as in [22,23]. There has been growing interest in the use of PSO for optimization problems [25,28,29,[35][36][37][38][39][40] and in synthesis of circuits [26,27]. However, very few articles were reported on the synthesis of MVL functions, see for example [16]. The basic algorithmic steps in a PSO are shown in Figure 5. behavior [34]. Swarm intelligence versus direct cover algorithms 4. Simulation of the algorithms In this section we present a coverage of the simulation process conducted using the ACO and the PSO algorithms introduced in Section 3 above. The simulation conducted among the algorithms is made using a set of a benchmark consisting of 50,000 randomly generated 2variable 4-valued functions. The main characteristics of the generated benchmark are illustrated below. As can be seen the number of minterms in the benchmark ranges from 6 to 16. The number of functions in each range is illustrated in the table below. For example there are 500 functions each has 16 minterms, 9000 function seach has 11 minterms, and 75 functions each has 6 minterms.

Ant Colony synthesis technique (ACO-MVL)
In the ACO-MVL, use is made of the ants searching strategy in finding the best minterms cover using the right set of implicants. The minterms coverage process is performed iteratively, until all minterms in the table is covered. Upon selecting a minterm (or an implicant) an ant puts some pheromone trails on it. This will cause the next ant performs selection based on the additional pheromone information. This positive feedback process drives the selection to the best solution (see Figure 6) [15].
The daemon_action( ) function is used to initialize the pheromone value at the beginning of all ant's movement and also whenever stagnancy in the solution is found. Based on the output of the fitness calculations the selected minterms and implicants are updated. The next generation of ants will then use the newly updated pheromone values to guide their selection.   According to the ACO-MVL, a tabular form is used to represent a given MVL function. A bag whose size is equal to the size of the function's truth table is used to store all selected implicants. Each implicant is represented by a string of integers consisting five integer attributes as follows (in sequence): the constant value of the implicant, the first and second value of the literal (a and b in Table 1) of the first variable in the implicant representation, and followed by the first and second value of the literal (a and b in Table 1)  It should be noted that performance of the ACO algorithm is dependent on the selection of a number of parameters including the expectation heuristic factor, the pheromone evaporation rate, and the number of ants. The ACO parameter selection techniques differ from a study to the other depending on the types of optimization and the scales of the problem considered. In our case we have conducted experimentations on the parameter value selection using the (expectation) heuristic value η M and the pheromone evaporation τ M and we have developed a measure of the probability of choosing a minterm M as explained below in Eq. (1). We have also adopted a similar approach in the selection of the parameters for the implicant (product term) and have developed to measure the probability for choosing an implicant, L as explained below in Eq. (2). Our approach in developing the measures below is inspired by the approach used in [51].
4.1.2 Minterm selection. A stochastic process of Roulette Wheel is used in the selection of a minterm. Two factors affect the probability of choosing a minterm. These are the pheromone value and a heuristic value. The first factor is obtained from pheromone trails of previous ants. The second factor is the fuzzy weighted averaging of minterm's selection criteria. The probability of choosing minterm M is computed as:  Table 2 shows the average number of Product Terms (#PT) needed with respect to the number of minterms of the MVL function used in the benchmark (functions with minterms ranging from 6 to 16 are used) as well as for the conventional DC-based algorithms (ARM [11], BS [9], and DM [10]).
The results in the table show the ACO-MVL algorithm outperforms the DC-based algorithms for all cases. The table also shows that the maximum percentage improvement and the minimum percentage improvement achieved by the ACO-MVL are 12.8% and 0.3%, respectively. It should be noted that the achieved improvements should be considered in the context that the simulated benchmark is representing a population of 4 16 functions. Figure 7 illustrates this comparison. An overall comparison between the SI-based techniques and the espresso-MV logic minimizer tools is provided in Section 3.

The particle swarm synthesis technique (PSO-MVL)
We motivate the discussion in this section by considering the function given in Figure 8.
Notice that based on the representation introduced in [13], the MVL function shown in Figure 8 is represented as: '0000000023102200. The coverage relation between the minterms of the function and the implicants is depicted in Figure 9.
4.2.1 Particle representation. A string consisting of five numbers is used to represent an implicant [13]: the first number represents the value of the implicant, the next two numbers represent the range of the literal of the first variable (a and b in Table 1) while the last two numbers represent the range of the literal of the second variable (a and b in Table 1). Consider, for example, the 4-valued function given in Figure 9. The two implicants (fully or partially) that cover the minterm 31,122 are 11,222 and 20,123 (see Figure 10).
It should be that the performance of the PSO algorithm is dependent on a number of parameters including the swarm size, the particles velocities, the cognitive coefficient, and the particle positions. In our case, we have used the same list of parameters except that for the particle velocities. In our extermination and due to the discrete nature of the MVL synthesis problem we have adopted the discrete PSO approach introduced in [22,23]. Accordingly, we introduce the term particle displacement (rather than particle velocity) and used it instead. Please refer to the set of Eq. (4) in the paper. We have presented the obtained results due to the effect of the swarm size and the number of iterations in Table 4 in the paper. In our test we used: c1 5 1, c2 5 c3 5 0.5 and the number of runs 5 10. Notice that c1 and c2 represent the cognitive coefficients. As a result of our experimentations, we found out that most appropriate value for V max is either 4 or 5. A value of V max 5 5 has been used in testing the PSO-MVL Algorithm. Our developed model to compute the particle displacement is shown below in Eq. (4).

Swarm intelligence versus direct cover algorithms
Example:. Figure 10 shows an example of three particles in the swarm whose elements at time t. Table 3 illustrates the computation of the particle fitness function as explained above. The results displayed in Table 3 indicate that particles 2 and 3 supersede particle 1 in representing the example function. Although the functional fitness of the two particles show a tie (a score of 16 in each) however the overall fitness shows superiority of particle 3 due to the weight added by the objective function. Therefore, particle 3 is considered the best possible solution for the given MVL function.
4.2.3 Particle movement. The discrete nature of the MVL synthesis problem necessitates adopting the discrete PSO approach introduced in [22,23]. Accordingly, we introduce the term particle displacement (rather than particle velocity) and introduce the following to compute the particle displacement (D tþ1,i ): In the above computation we use DS t,i to represent the displacement of particle i at time step t due to particle best self-experience and DG t,i to represent the displacement of particle i at time step t due to the global experience. We use X t,i to represent the position of particle i at time step t, P i,t to represent the current best position at time step t, and P g,t to represent the current global best position at time step t, while c 1, c 2, c 3 represent the social/cognitive confidence coefficients, and r 2, r 3 are two random numbers.
As can be seen, the particle displacement (D tþ1,i ) consists of three components: (D t,i ), (DS t,i ), and (DG t,i ). The new particle position is formulated as follows: The PSO algorithm is illustrated in Figure 11 [16].     Figure 11. Swarm intelligence versus direct cover algorithms 4.2.4 Numerical results. We have tested the proposed PSO-MVL algorithm using a bench mark consisting of 50,000 randomly generated 2-variable 4-valued functions. The results obtained are reported in Table 4.
We report in this table the average number of product terms (PTs) needed to cover a given function. We report the obtained results for different number of particles and different number of iterations. In our test we used: c1 5 1, c2 5 c3 5 0.5 and the number of runs 5 10. As a result of our experimentations, we found out that most appropriate value for V max is either 4 or 5. A value of V max 5 5 has been used in testing the PSO-MVL Algorithm. It should be noted that a gradual decrease in the number of product terms (PTs) needed to synthesize a given function occurs as we increase the number of particles and/or iterations used. 4.2.4.1 An observation that lead to a modification in the PSO-MVL. Two example 4-valued 2-variable functions are shown in Figure 12. Notice that F2 is the complement of F1. While F1requires at least six implicants to represent, F2 requires only four implicants (circled in the figure). If we synthesize F2 and use an extra inverter we will need a total of 5 gates. This is still less than synthesizing F1. We have made use of such cases by modifying PSO-MVL algorithm in a way to synthesize both the given MVL function and its complement and collect the synthesis which requires less number of implicants taking into consideration the extra inverter gate needed if the complement of the function is synthesized. Table 5 shows the results obtained using the modified PSO-MVL in comparison with the DC-based conventional heuristics for different functions having different number of minters.
In this table we present the average number of minterms required to synthesize a bench mark consisting of 50,000 2-variable 4-valued functions having minterms ranging from 6 to 16. For a comparison purpose, we also report the results obtained for three other synthesis algorithms: the ARM [11], the BS [9], and the DM [10]. The maximum and minimum percentage improvement for each of the 11 categories of functions is also computed and reported in the table. The maximum improvement achieved by the modified PSO-MVL is 31.2% (in the case of functions having 11 minterms) and the minimum improvement achieved is 7.9% (in the case of functions having 6 minterms). The results shown in Table 5 is illustrated in Figure 13.

A comparison
In this section we provide two main comparisons. The first is among the two Swarm Intelligence based algorithms used for synthesis of MVL functions, i.e. the ACO-MVL and the PSO-MVL. The second comparison is among the PSO-MVL and ACO-MVL on one side with the results obtained using espresso-MVL logic minimizer. Our basis for comparison is the benchmark consisting of 50,000 2-variable 4-vauled randomly generated function. Table 6 shows a summary of the results obtained for the results obtained for PSO-MVL and those obtained for ACO-MVL for synthesizing the 50,000 benchmark functions.
The results shown in Table 6 indicate that on average the number of product terms (#PTs) needed to synthesize a given function using the PSO-MVL is lower than the number of those needed to synthesize the same function using ACO-MVL. The maximum percentage improvement in the number of product terms obtained using PSO-MVL over the ACO-MVL is 16.3% (in the case of functions with 16 minterms) while the minimum percentage improvement is 3.9% (in the case of functions having 7 minterms). Over all simulated 50,000 functions, the average percentage improvement is 5.4%. It should be noted that 5.4% represents a considerable improvement given that the simulated randomly generated functions are representative of a population consisting of 4 16 functions. We also observe that as the number of minterms in a given function increases, the percentage improvement decreases. This can be attributed to the observation that as the number of minterms increases, the likelihood of an ant finding a solution increases and hence the improvement in the number of PTs achieved by the ACO-MVL algorithm. Figure 14 illustrates this comparison.
The results show that on average both ACO-MVL and PSO produce better number of product terms for the benchmark functions.

Note(s):
The Espresso logic minimizer is a computer program using heuristic and specific algorithms for efficiently reducing the complexity of digital electronic gate circuits. Espresso was originally developed for binary logic at IBM [41]. A variant called Espresso-MV has been introduced in 1986 under the title ''Multiple-Valued Logic Minimization for PLA Synthesis" [42]. We have simulated the same set of 50,000 randomly generated benchmark MVL function using Espresso-MV.
The obtained results are shown in  PSOThe second comparison we have conducted was to compare the results obtained using both of the Swarm-Intelligence-based techniques against those obtained using Espresso-MV logic minimizer [40].  Swarm intelligence versus direct cover algorithms the case of ACO-MVL and it is 11.9% in the case of the PSO-MVL. Figure 15 illustrates this comparison.

Concluding remarks
This paper provides a review and comparison on the performance evaluation of the Ant Colony (ACO) and the Particle Swarm Optimization (PSO) heuristic techniques in the synthesis of MVL functions. This evaluation is provided on two levels: Swarm-Intelligence (SI)-based versus conventional Direct-Cover (DC)-based algorithms and between the two SIbased algorithms. The covered algorithms were simulated and tested using a benchmark consisting of 50,000 randomly generated 2-variable 4-valued functions. The average #PTs needed is used as a criterion in comparing the performance of all considered algorithms. The results obtained indicate that the SI-based techniques outperform the conventional DC in terms of the average #PTs required to realize a given MVL function. Between the two SIbased algorithms, the technique based on the PSO produces better overall results. The performance evaluation show also that the results obtained using both the SI-based algorithms outperform the results obtained using the espresso-MVL logic minimizer. It is shown that both the ACO and the PSO outperform the Espresso-MVL algorithm in the minimization of MVL functions. The work presented in this publication considers using ACO and PSO in the synthesis of 4-valued logic functions and compares the results to those obtained conventional using the direct-cover techniques. Application of other swarm intelligence techniques, e.g. Genetic Algorithms or Artificial Bee Colony for 4-valued or higher-radix logic is not covered in the article.