Philosophy Doctor of Operational Research and Optimization, Department of Mathematics, UAE
Received date: March 14, 2016; Accepted date: March 17, 2017; Published date: March 21, 2017
Citation: Hosseini E (2017) Laying Chicken Algorithm: A New Meta-Heuristic Approach to Solve Continuous Programming Problems. J Appl Computat Math 6:344. doi: 10.4172/2168-9679.1000344
Copyright: © 2017 Hosseini E. This is an open-access article distributed under the terms of the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original author and source are credited.
Visit for more related articles at Journal of Applied & Computational Mathematics
A concept for the optimization of continuous programming problems using an approach based on behavior of laying chicken, to produce chicken, is introduced. Laying chicken algorithm (LCA) is used for solving different kinds of linear and non-linear programming problems. The presented approach gives efficient and feasible solutions in an appropriate time which has been evaluated by solving test problems. The comparison between LCA and both of meta-heuristic and classic approaches are proposed.
Laying chicken algorithm; Meta-heuristic approaches; Optimization problems
In the recent decades, optimization and computer scientists have been designing several algorithms based on behavior of animals and insects because the natural systems are very efficient. Swarm Intelligence (SI) was introduced in 1989 as a novel approach in the global optimization . Ant Colony Optimization (ACO) was proposed to solve discrete problems as a new meta-heuristic optimizer . Particle Swarm Optimization (PSO) introduced for solving continuous programming problems . These algorithms have been found acceptable solutions to optimization problems. Therefore, the metaheuristic algorithms, such as Artificial Bee Colony Algorithm , krill herd algorithm , Bat Algorithm (BA) , social spider optimization , Chicken Swarm Optimization (CSO) , firefly algorithm  have attracted by many researchers.
This paper suggests a novel optimizer for optimization of linear and non-linear programming problems in continuous state. The approach has been discovered in simulating of a natural bi-inspiring model. The paper introduces the laying chicken algorithm concept, strongly discusses the steps of its extension from bi-inspiring simulation model to optimizer. Finally, by proposed numerical results of linear and nonlinear test problems, it is easy to see that the simulated model has been succeeded.
Laying chicken algorithm is related to two principle concepts. In general, LCA ties to artificial agent or artificial life obviously, and to, laying fishes, laying turtles, laying snakes and laying chickens in particular (not SI behavior). It comes from both evolutionary programming and genetic algorithms. In this paper, relationships between LCA and above concepts are obvious.
Proposed laying chicken algorithm by the author includes an easy natural theory and concept, and performance of steps can be displayed in some lines of MATLAB code. It needs just an array, to store feasible solutions, and initial mathematical factors. So it has an acceptable computational complexity in both of memory and time. Initial testes have realized the enforcement to be feasible and effective using different classes of problems. In the rest of paper, performances of steps and their MATLAB code will be presented. Finally use of approach to solve several kinds of problems, such as constraint and unconstraint programming problems in different states, is discussed.
The hens and their eggs are a great source of food as one of the most extensive tame animals . This paper focuses on behavior of laying hen and answer of this question: “how does she convert the egg to the chicken?” In this paper, same as eggs to the chicken, the feasible solutions have been changed to the optimal solution. In fact, each egg displays a feasible solution in continuous programming problem and a chicken describes optimal solution in the problem.
Farmers use a false egg sometimes to encourage hens to stay in the nest. Because hens often prefer in the same location and not empty nest to lay, in fact they try to do that in the nest that already contain eggs. This is a great idea to create an initial feasible solution and to generate first population near that.
Pheromone of ants in ant colony, individual members or global best in particle swarm optimization, crossover or combination of genes in genetic, are the fundamental concepts of some of the meta-heuristic algorithms. Here hens try to warm their eggs; this concept is base to development of laying chicken algorithm. Same as temperature of eggs objective function of solutions will be improved. Rotation of eggs is the next concept which will be simulated by little change of solutions.
The laying chicken algorithm optimizer may the best proposed using describe its conception development. As mentioned, LCA comes from laying hen as an original naturel event, so in this section the main concept of LCA and its relationship with the bio-inspiring event is discussed.
The initial solution
The simulated approach already was written based on two main concepts: initial solution and population. Same as the first egg in the nest, the initial feasible solution was necessary. So it has been created randomly. If it is not feasible, a loop in the MATLAB code is repeated to create a feasible one. Initial solution for some optimization problems is created in MATLAB are as follows:
The initial population
In the first iteration, initial population of solutions has been created near the initial feasible solution as possible. In fact, the next factor of the simulation defines “the initial neighborhood,” an n-dimensional neighborhood of Rn, this is defined as follows:
?X–Y? ≤ k (1)
Which, X is initial solution, Y is an n-dimensional vectors and k is a positive constant. Here the initial population of eggs has been created randomly in the possible nearest neighborhood of the initial solution.
Each member of initial population has to be in this neighborhood of the initial solution. We try to generate solutions very near the initial solution. This is because hens usually like to stay in their nest with their eggs. In fact, they prefer to convert their eggs to chicken than other animal eggs. Figure 1 shows 500 eggs (feasible solutions) near to the initial solution for a given problem with k=1 in R2 (Figure 1).
The algorithm will be more efficient when k be very small. This is because it does not miss many solutions near initial solution small k.
Improving of population
Each solution in population, which its objective function is not better than objective function of initial solution, should be changed in direction initial solution while it will be better than initial solution. In fact, value of particles have been changed in direction vector which connects its and the initial solution. These solutions have been modified as follows:
Which, dj0 is the vector from xj to x0 and f(xj)< f(x0), 0 ≤ α ≤ 2k in maximization problems.
All states of α have been described in Table 1 and according to that, the feasible interval for α as follows:
0 ≤ α ≤ 2k (3)
|States of α||xj+1=xj+αdj0||Explanation||Logical decision||P. Infeasible solutions|
|α >> 2k||α→∞Þ xj+1→∞||xj+1 will be infeasible.||This state should not be selected.||100%|
|α << 2k||α→–∞Þ xj+1→–∞||xj+1 will be infeasible.||This state should not be selected.||100%|
|α=0||xj+1=xj||xj+1 will not be changed.||α should not be near zero.||–|
|α=k||xj+1=x0||x0 is already in population.||This state should not be selected.||–|
|α=2k||xj+1=xj+kdj0||xj+1 will be feasible.||This state can be selected.||0%|
|α<k||xj+1=xj+2kdj0||xj+1 till be feasible.||This state can be selected.||0%|
Table 1: States of α description.
It is easy to show that α → 0 does not change solutions very well, so interval 0<α<k/4 has been removed and the following is the best:
k/4<α ≤ 2k (4)
But according to the gradient theorem in Figure 2a objective function of blue points are not better than initial solution (large red point) and small red points are better than it, in a given problem that its optimal solution is in right hand side of the initial solution. So interval of α has been modified as follows:
k ≤ α ≤ 2k (5)
This is because the author wants to move all blue solutions in Figure 2a in direction initial solution such that they will be better than it. Green points in Figure 2b are these solutions after their movement. By this stage all solution in population will be better than initial solution Figure 2c. The best solution in this iteration will be initial solution in the next iteration. So in the next population and after this step, all solution will be better than the best solution of current population. This is the main idea of the algorithm which every population is better than previous population. Pseudo code of this stage has been shown in Figure 3.
Changing the solutions
The last trait of the simulated method has been inspired from rotation of the eggs by the hen. She rotates the eggs three or four times every day. In this stage except the best solution, all member of population have been little changed as follows. ε is a given small positive number.
Some of solutions have been selected randomly and changed as follows:
Each solution j which xj < xbest has been changed as follows:
Each solution k which xk > xbest has been changed as follows:
At each iteration, the best solution has been saved and other solutions selected near that in the next population. There are two states for current stage: If this stage creates the better solution from the best one (best in this iteration), it will substitute the best and in the next iteration solutions should be selected near that. Otherwise the best solution will not change. In fact by this stage, the best solution will be better or not changed. Figure 4 shows code of this step.
This stage is useful because it causes to generate more random solutions except the best solution. In fact, the algorithm has more choices to select the best solution by more random solutions.
Steps of the algorithm
The main steps of the algorithm in R2 as follows:
• The initial feasible solution (x0,y0), is created. Number of iteration, N, and an arbitrary small positive number, ε1 are given.
• Initial population near (x0,y0), is generated.
• Each solution in step 2, which its objective function is not better than (x0,y0), should be changed in direction (x0,y0) and found the best solution (xbest,ybest)
• All solutions, except the best one, have been very little changed.
• Objective function of solutions and the best solution is updated. Let (x0,y0)=(xbest,ybest), go back to step 2.
• If |f(xibest)–f(x(i+1)best)|<ε1 or the number of iteration is more than M the algorithm will be finished, xibest, x(i+1)best are the best solutions in two consecutive generations. Figure 5 shows the process of the algorithm to gain optimal solution from a given feasible solution. Explanation of Figure 5 as follows: initial solution is generated in eqn (1), Red point is the optimal solution and the green point is an arbitrary feasible solution. Eqn (2) shows first population near initial solution with k=1, red points are better than the initial solution and blue points are not. Blue points move in eqn (3) and convert to green points which are better than initial solution. The algorithm continues with eqn (4). All solutions except the best solution have been little changed according eqn (5). Next population will be created near the best solution.
The process of the algorithm in R3 has been shown in Figure 6.
Convergent parameter set includes initial solution, small positive number ε and constants k and α. BBA is run several times to determine convergence rate and convergent parameter set of the algorithm. The convergence rate is top if various results are gained by more performances. Large number of eggs and slow convergent parameter set must be used in this state. The convergence rate is low if after large number of iterations same result is gained. Small number of eggs and quick convergent parameter set should be used here. Finally, if suitable results are gained, convergence rate is well and the common parameter set should be used. According to the computational results, convergence rate of the algorithm is completely high rather than other proposed meta-heuristic approaches.
Example 1 
Consider the following problem:
min exp(–(x-4)2–(y–4)2)+exp(–(x+4)2–(y–4)2)+2exp(–x2–y2) + 2exp(–x2––(y+4)2)
Figure 7 shows behavior of objective function in Example 1. To solve the problem, all efficient factors to obtain optimal solution are: number of eggs, stochastic constant (k), small positive number ε to change solutions, and initial feasible solution. According to the Table 2 the proposed meta-heuristic approach has presented a solution with less time and number of eggs than firefly algorithm. Behavior of agents to obtain optimal solution has been shown in Figure 8.
|Algorithms||N.Eggs/Firefly||N. Iterations||Optimal Solution||F Max||K||ε||x0|
Table 2: Comparison of LCA and firefly algorithm: Example 1.
Example 2 
Consider the following linear programming problem:
x1+2x2 ≤ 4
–x1+x2 ≥ 0
Comparison LCA and exact methods has been proposed in Table 3. Figure 9 shows to move generations to optimal solution in feasible region.
|Algorithms||N. Eggs||N. Iterations||Optimal Solution||F Max||K||ε||x0|
Table 3: Comparison of LCA and exact methods: Example 2.
Example 3 
Consider the following non-linear programming problem:
x1+3 ≤ 0
–x1+x2–2 ≤ 0
x1+x2–4 ≤ 0
x1,x2–2 ≥ 0
Comparison LCA and other methods by example 3 have been proposed in Table 4. Behavior of generations has been shown in Figure 10.
|Algorithms||N. Eggs||N. Iterations||Optimal Solution||F Max||k||ε||x0|
|Classic methods ||(0,0)||–32||–|
Table 4: Comparison of LCA and other methods: Example 3.
The proposed algorithm is efficient for problems by more than two variables according to the following example.
Example 4 
Consider the following linear programming problem:
x1+ x2+2x3 ≤ 9
x1+x2–x3 ≤ 2
x1,x2,x3 ≥ 0
Comparison LCA and exact methods has been proposed in Table 5. Behavior of generations to find optimal solution has been shown in Figure 11.
|Algorithms||N. Eggs||N. Iterations||Optimal Solution||F Max||K||ε|
Table 5: Comparison of LCA and other methods: Example 4.
Laying chicken algorithm is an easy meta-heuristic approach which optimizes different kinds of functions and optimization programming problems. Also, it seems efficient according to the examples. LCA was proposed as a natural event algorithm, not based on swarm intelligence unlike most of pervious meta-heuristic approaches. It ties to behavior of hen in process of produce chickens from eggs. In fact, LCA relates to both of biological and evolution computation because of its evolution and stochastic process.
LCA was successful because it does not miss the great solutions near initial solution particularly when k is small. The number of generations would be less according to a suitable feasible solution such as x0 in fact consuming time to find optimal solution is much better than other meta-heuristic approaches.
Finally, there are many different NP-Hard problems which can be solved by meta-heuristic approaches especially using laying chicken algorithm. The simple MATLAB code of the LCA can be interested in the future researches especially for problems in large size. However, the proposed solution by LCA is near to optimal solution, but it is an approximate approach and the better algorithms can be proposed in the future researches.