MEMBRANE COMPUTING INSPIRED GENETIC ALGORITHM ON MULTI-CORE PROCESSORS

Membrane computing is a branch of natural computing. Several studies have recently attempted to utilize the structure of membrane computing to improve intelligent algorithms. These studies have applied communication rules in membrane models to facilitate information exchange between membranes, thereby improving the performance of those algorithms. However, parallel membrane computing has not yet been considered. This study proposes a membrane computing-inspired genetic algorithm. Similar to previous studies, the algorithm also uses communication rules to facilitate information exchange. In this study, an appropriate membrane computing-inspired genetic algorithm is defined, in which each membrane can be executed over different cores in a parallel manner. The proposed algorithm can be executed over different cores and uses multi-core processing to implement parallel membrane computation. Simulation with a Colville minimization problem shows that the membrane computing inspired genetic algorithm has improved performance, with a mean error of the solution 61.9 times better than genetic algorithm.


INTRODUCTION
Membrane computing (also known as P systems) (Paun et al., 2010) is a branch of natural computing. Since its inception, membrane computing has been used to solve various problems. Specifically, membrane computing has been used to solve biological problems, such as molecular interactions (Twycross et al., 2010;Muniyandi and Abdullah, 2012), bearded vulture evolution prediction (Cardona et al., 2009) and predator and prey relationship modeling. Membrane computing techniques have also been utilized to solve other problems, such as computation of the threshold of twodimensional images (Christinal et al., 2010), segmentation of images (Christinal et al., 2011) and robot controlling (Buiu et al., 2012). Difficult optimization problems, such as N-queens problem (Gutierrez-Naranjo and Perez-Jimenez, 2011), three-coloring problems (Adrian and Florentin, 2012) and satisfiability problems (Ishdorj et al., 2010), have also been solved by membrane computing models.
The main components of membrane computing are as follows: (i) the membrane structure and the delimiting compartments, in which (ii) multi-sets of objects evolve according to (iii) (reaction) biochemically inspired rules. The rules can process both objects and membranes (Paun et al., 2010). Thus, membrane computing can be defined as a framework for devising cell-like, tissue-like, or spikinglike computing models (Paun et al., 2010). This study applies the tissue-like membrane computing model.
Membrane computing models have recently been used to improve intelligent algorithms Zhang et al., 2011;2012a;2012b). Quantum-inspired and differential evolution intelligent algorithms are used in previous studies based on membrane computing to solve difficult non-deterministic, polynomial-time problems.

JCS
However, these studies merely use communication rules to aid information exchange between membranes.
This study introduces a Membrane Computing-Inspired Genetic Algorithm (MCIGA). MCIGA uses a parallel structure aside from communication rules to assist in information exchange between membranes. In this study, membrane computing is defined with appropriate communication rules and membranes such that each membrane has the ability to run parallel on different processors.

Tissue-like P Systems
Tissue-like P systems (Pena-Cantillana et al., 2011) have two biological inspirations: inter-cellular communication and cooperation between neurons. The common mathematical model of these two mechanisms is a network of processors dealing with symbols and then communicating these symbols along the channels specified in advance. Tissue-like P systems contain many cells within a common environment. Two cells can communicate with each other through channels between them and all cells can communicate among each other through the environment. A tissue-like P system with degree m ≥ 1 is expressed as follows: π = (O,E,w 1 ,…,w m ,R,i out ) Where: m = The number of cells in the system O = finite non-empty alphabet of objects E⊆ O = the set of objects present in the environment w 1 ,…w 2 = Strings over O, representing multi-sets of objects associated with m cells at the initial state of the computation R = A finite set of communication and transformation rules of the following form • Transformation rules x→y allow cell i∈O to consume a multi-set x to produce a new multi-set y inside the cell i. • Communication rules (i,u/v,j) for i,j∈{0, 1, 2,…,m}, i≠j and u, v∈O i out ∈ {0,1,2,…,m} = The output cell A tissue-like P system of degree m is as a set of m cells (each one consisting of an elementary membrane) labeled by 1,2,…,m. Here, 0 refers to the label of the environment and i out denotes the output region, which can be the region inside a cell or the environment. The strings w 1 ,…,w m describe the multi-sets of objects placed in the m cells of the P system and E⊆O is the set of objects placed in the environment. Each set is available in arbitrary large amount of copies.
The communication rule (I,u/v,j) can be applied over two cells labeled by i and j such that u is contained in cell i and v is contained in cell j. The communication rule denotes that the objects of the multi-sets represented by u and v are interchanged between the two cells. When either i = 0 or j = 0, the objects are interchanged between the cell and the environment. Rules are used in the framework of membrane computing, that is, in a maximally parallel way (a universal clock is considered). Each object in a membrane can only be used in one rule, which is non-deterministically chosen when there are several possibilities, but any object should participate in a rule of any form, that is, in each step, a maximal set of rules should be applied.

Genetic Algorithms
Evolutionary Algorithms (EAs) (Affenzeller et al., 2009) are generic population-based meta-heuristics inspired by biological evolution to address combinatorial optimization problems. Four main EAs have been applied to different types of problem domains: Genetic Algorithms (GAs), genetic programming, evolutionary strategies and evolutionary programming. GAs were introduced to study self-adaptation in biological processes and to solve optimization problems (Affenzeller et al., 2009).
GAs are a class of probabilistic algorithms that start with a population of randomly generated candidates. Moreover, GAs are iterative procedures that operate on a population where individuals are evaluated according to a certain fitness value. Individuals are selected according to this value. The selected individuals produce offspring candidates, thus forming the next generation. Two operators, namely, crossover and mutation, are used to produce new individuals. Crossover takes two individuals called parents and then produces one or two new individuals called offspring. In its simplest form, crossover works by swapping pieces of information from the parents. The second operator is called mutation, which is applied by modifying an information unit in one individual according to a mutation rate (Affenzeller et al., 2009). A simple pseudo code for GAs is as follows: Step 1: Randomly generate an initial population.
Step 2: Select pairs of individuals based on the fitness function.
Step 3: Produce next generations from the selected pairs by applying crossover and mutation.

JCS
Step 4: Replace previous generation with the new generation if the new generation is better or identical to the previous generation.
Step 5: The algorithm is finished when the coverage reaches a solution or a pre-determined number of iterations. Otherwise, increase the number of iterations and go back to Step 2.

Proposed Method
The structure of the proposed MCIGA is as follows: where, m = NumCores where NumCore is the number of cores that exist on a computer. The parallelism structure of membrane computing is utilized, aside from communication rules. The number of cells in a membrane is equal to the number of cores in a computer (NumCores). Thus, each cell can be executed on different cores in a parallel manner: • The transformation rules x→y are identical to the concepts of mutation and crossover operation in GAs that evolve individuals. Transformation rules (including mutation and crossover) are executed on different cores for each membrane for determined times that set with user and named as maximum iteration of transformation rules (Max_Iter_Tran). Individuals resulting from transformation rules are transferred to the master core so that the communication rules will be applied on them and information will be exchanged between membranes.
The communication rules are (i,u/v,j) for i,j∈{1,2,…,m}, i≠j that is, different cells can exchange their individuals using these rules. u can be chosen from n i individuals inside cell i (i.e., ). Figure  1 shows the communication direction for four membranes. (1,I / I ,3) , the seventh individual in Cell 1 is exchanged with the fifth individual in Cell 3. By exchanging information between membranes, the diversity of individuals in each membrane increases and the trapping of the algorithm in a local minimum solution are avoided. After each separate execution of transformation rules in each membrane Max_Iter_Tran times, communication rules are executed on the master core, after which membranes exchange individuals. Afterwards, the transformation rules execute on a separate core for Max_Iter_Tran times. This process is repeated until the termination condition is reached.
i out = 0 (0 indicates the environment of the output cell) at the end of computation. All membranes send their best individuals to the environment. The best individual in the environment is chosen as the solution.
The steps of the introduced membrane computing inspired genetic algorithm are as follows. Except for the communication step that runs on the master core in other steps, each membrane is executed on different cores in a parallel way.

Step1. Initialization
In this step, a membrane structure with m cells is created. m is equal to the number of existing cores in a computer, that is, m = NumCroses, because each membrane should be executed on different cores. n p individuals are randomly generated as

Step2. Evaluation
A fitness function is calculated for each individual in this step. Fitness functions differ based on the problem.

JCS
This step shows how near a solution is to the optimal solution and is executed on different cores for each cell.

Step3. Transformation
In each membrane, pairs of individuals are chosen based on their fitness and crossover rate. Individuals with better fitness have higher chances to crossover. If the crossover rate is equal to one, all individuals are chosen for crossover. Crossover takes two randomly chosen individuals (parents) as input and combines them to generate two children. The combination is performed by choosing a crossing point in the strings of the two parents and then exchanging the values. After crossover, mutation operation is used for individuals resulting from the crossover stage to prevent convergence of the algorithm with the local solution. The mutation operator chooses an individual and then changes the value of a randomly chosen gene in this individual. Different kinds of mutations and crossover operators can be defined based on the problem (Raad, 2011). This stage is performed on different cores for each membrane to exploit parallel structures of membrane computing and utilize multi-cores. The distribution of data over cores and gathering data from cores to master cores is a time-consuming process. Thus, this step is repeated several times on each core because the expected overhead time for sending data to the cores and receiving data from the cores with respect to the times data are processed on each core should be very low. This way, the advantages of multi cores are used. Results of each membrane in distinct cores are sorted according to fitness values. The results are then sent to the master core for communication information between membranes resulting from different cores.

Step 4. Communication
In this step, all of the individuals in the membranes are gathered from cores to the master core. According to the rules of the tissue-like P system, individuals are exchanged between membranes based on (i,u/v,j) for i, j∈{1,2,…,m}, i≠j rules. This study defines after applying the rules, as shown in Fig. 2a.
The results of the rules for each membrane are similar to that at the start of membrane i. The first individual of this membrane is selected as the new first individual in membrane i. afterwards, the membrane is changed according to Fig. 2b and a second individual of the next membrane is chosen as the new second individual in membrane i. Afterwards, the membrane is again changed and a third individual is chosen as a new third individual in membrane i. This process is repeated until all n i new individuals are chosen for membrane i. This process is repeated for other membranes. As mentioned in Step 3, the materials are sorted according to their fitness values in each membrane before being transferred to the master core. Thus, after individuals are exchanged between membranes, each membrane includes individuals with good fitness and low fitness values from itself and other membranes, thereby increasing the diversity of individuals in each membrane and increasing the performance of the algorithm.

Simulation Method
Simulations were implemented with Visual C++ software in a computer with Intel core i5 2.5 GHz (two cores) and 4 GB random access memory. In the simulations, blended crossover (Raad, 2011) is used as [X min +a(X max -X min ),X max -a (X max -X min )], where a is a user-defined parameter; x are the i th gen of the first and second individuals chosen for the crossover, respectively. Mutation for this simulation is based on (Chen and Wang, 2011) where gen x i is expressed as follows: where, ρ randomly choosen with a value of 1 or 0 with similar probabilities and U i and L i are the upper and lower boundaries of gene x i , respectively. γ decreases when γ = 1-b (1-Iter/Iter max )C , where iter max is the total number of iterations, iter is the iteration for this step, b is a random variable from [0, 1] and C is the user defined variable. In the following simulation, the constant for crossover is a = 0.5, the crossover rate is 1, the mutation rate is 0.7, the constant C for mutation is 3, the maximum iteration number iter max = 1000, the number of membrane for the MCIGA is equal to the number of cores on our computer (i.e., 2) and the numbers of individuals for the GA and MCIGA are both 300. Each membrane has 150 individuals. These parameters are obtained via experimental trials. Table 1 and Fig. 3. In Table 1 times in seconds and maximum, minimum, mean and deviation of error from global solution have been illustrated. These amount have been obtained from 500 simulation runs and the maximum iteration number for each run is iter max = 1000. In Fig. 3 the error of solution in each run for 500 runs has been shown for both proposed algorithm and GA.

DISCUSSION
The results demonstrate the advantages of the proposed approach of membrane computing inspired inteligent algorithm. This illustrates that the MCIGA has enough diversity to avoid local solutions and has enough parallelism to run on different cores. As illustrated in Table 1, the elapsed time of MCIGA is less than GA because MCIGA can execute on different cores in a parallel manner. Furthermore, the standard deviation of errors of solutions for 500 runs using MCIGA is 6.5 times lower and the mean error of the solution 61.9 times better than that obtained using GA. These enhancement caused by exchanging information between membranes. As shown in Fig. 3, in some runs, the error of the solutions for GA is higher than that of MCIGA. Because in the algorithm of MCIGA there are information (individuls) exchanged among membranes, thus, the diversity of the proposed algorithm increases and prevents the proposed algorithm to trap in local solutions as errors decreases.

CONCLUSION
A new membrane computing-inspired algorithm was introduced for solving optimization problems. This algorithm outperformed a previous algorithm because, unlike the latter, the former used parallel structures. Previous studies used communication rules in membrane computing to improve their algorithms. Aside from using communication rules, this study uses parallel structures in membrane computing by defining appropriate membrane-inspired algorithm and using multi-cores. The speed of the algorithm increases by executing each membrane on different cores. The diversity of the algorithm increases and the algorithm avoids being trapped in the local minimum answer by using communication rules to exchange information between membranes. Thus, the execution times and mean error are decreased.
The idea of using parallel structures in membrane computing for GA is introduced for the first time in this study. The proposed algorithm can also parallelize other intelligent algorithms. For our future work, we will extend the application of this proposed algorithm to manufacturing optimization problems and then compare it with several other algorithms.

ACKNOWLEDGMENT
This study supported by the Young Researcher Grant of the National University of Malaysia (Grant code: GGPM-2011-051).