Optimisation of Rice Fertiliser Composition using Genetic Algorithms

Fertiliser is very important for rice growth and evolution. It has one or more elements, used as a replacement of element in plants. Fertilisation can be interpreted as a soil nutrient enhancer. Fertiliser is divided into several types based on where they are come from [1]; such as inorganic, organic and biological fertiliser. There are two groups of inorganic fertilisers based on the content of nutrients: single and compound fertiliser [2][3][4]. Single fertiliser only had one content. There are three kinds of single fertiliser which had the main nutrients such as nitrogen (N), phosphorus (P), potassium (K) and magnesium (Mg). Some examples of single fertilisers are nitrogen, phosphorus, potassium, and magnesium fertiliser. On the other hands, compound fertiliser is a mixture of two or more nutrients. Some examples of mixture is blended again into NP and NPK.


I. Introduction
Fertiliser is very important for rice growth and evolution. It has one or more elements, used as a replacement of element in plants. Fertilisation can be interpreted as a soil nutrient enhancer. Fertiliser is divided into several types based on where they are come from [1]; such as inorganic, organic and biological fertiliser. There are two groups of inorganic fertilisers based on the content of nutrients: single and compound fertiliser [2][3] [4]. Single fertiliser only had one content. There are three kinds of single fertiliser which had the main nutrients such as nitrogen (N), phosphorus (P), potassium (K) and magnesium (Mg). Some examples of single fertilisers are nitrogen, phosphorus, potassium, and magnesium fertiliser. On the other hands, compound fertiliser is a mixture of two or more nutrients. Some examples of mixture is blended again into NP and NPK.
In rice planting, the right composition of fertilizer is essentially needed. If the composition given is not correct, the growth and quality of rice produced is inadequate or the costs incurred become more wasteful and even unaffordable [5] [6]. Farmers need an appropriate combination in order to obtain good results and minimum expenses of using fertiliser. The combination should consist of s nitrogen (n), phosphorus (p) and potassium (k). This composition is one of the solutions used in composing the optimal fertiliser for rice plants. Often, farmers do trial and error or follow others experience to get the right composition of fertiliser. The problem will arise if the raw material for fertilizer changes, then the farmer must change the composition that he knew beforehand. They must try harder to get the right composition of fertiliser. Many farmers fail in this case and lose a lot of costs. Accordingly, it is necessary to have the right composition of fertilisers in order to obtain high yields and affordable budgets.
Plants fertiliser combinations issue has been done by several methods such as goal programming [2], and meta-heuristic algorithms [7]. This study uses a genetic algorithm to optimise the fertiliser composition since it has been known as a powerful optimization method [8] [9][10] [11]. The method is used to produce optimal results with the reproduction processes such as determining population size, crossover rate, chromosome, reproductive and fitness value. The results of the genetic algorithm process expected to help determine the optimal combination of fertiliser.
There are so many problems with food scarcity. One of them is not too good rice quality. So, an enhancement in rice production through an optimal fertiliser composition. Genetic algorithm is used to optimise the composition for a more affordable price. The process of genetic algorithm is done by using a representation of a real code chromosome. The reproduction process using a one-cut point crossover and random mutation, while for the selection using binary tournament selection process for each chromosome. The test results showed the optimum results are obtained on the size of the population of 10, the crossover rate of 0.9 and the mutation rate of 0.1. The amount of generation is 10 with the best fitness value is generated is equal to 1,603.

II. Materials and Methods
Genetic algorithms or evolutionary algorithms is an optimizing technique that mimics biological evolution. There are several individuals in the population. From several generations, the individual has a role as a parent, which acts as a principal reproduction which can produce offspring. The individual has evolved and the new individual can have a great chance to survive the natural selection and survive. Better offspring tend to be generated from the individual who has a good offspring or sometimes is not better, but more likely from generation to generation will form a better population [7]. Genetic algorithm stages include initialization, reproduction, evaluation and selection [12][13] [14], is shown in Figure 1.
In the genetic cycle will be discussed how the process of solving the problem in optimizing the composition of rice fertiliser. There are several steps to resolve the problem using Genetic Algorithms. These stages can be seen in Figure 2. The genetic algorithm process consists of the main processes which include initialization, reproduction, evaluation, and selection.
Initialization begins with creating certain chromosomes randomly that can represent the solution of problems that need to be solved. The structure of the chromosome is illustrated in Table 1. It is also used as a generator of new solution set by randomly composed of a number of chromosome strings There are nine chromosomes formed, five initial chromosomes are used to calculate the amount of fertilizer, content, total price needed and fitness value. Reproduction is used to form or produce offspring from individuals in the population. There are two kinds of genetic operators here: crossover and mutation. This study uses one cut point crossover. Crossover levels must be determined so that the value used to express the ratio of offspring can be produced in the process crossover to produce cr(crossover rate) x popSize of offsprings. Illustration of the crossover process can be seen in Table 2 and the steps can be seen in Figure 3.
Reciprocal exchange mutation is used in this study. The mutation rate (mr) must be determined in advance to get a comparison between the amount of offspring that can be generated, and the parent involved in the process. The number of offspring that produced can be calculated by mr x popSize. Illustration of the mutation process can be seen in Table 3 and the steps can be seen in Figure 4. Evaluation is used for calculating the fitness of each chromosome, the greater fitness results of the chromosome means it produces a better result as a potential solution. Within a chromosome always contains the value of fitness and some other property of individuals who have a gene called formers such as name, age, address, and another period of property. Fitness values can be expressed in (1). Fitness = 1000 / ((Total price/1000) + (1000 * penalty)) Fertilizer composition always has ideal value requirements for the elements it contains (such as the need for Nitrogen (N) content, Phospor (P) content, and Potassium (K) content. Every violation of these ideal values is stated as a punishment written in (2).
Selection is used to select the individual that can be sustained for the next generation coming from the set of the population and offspring. Probability function used to select an individual who needs to be maintained. Individuals with higher fitness values have greater chances of being elected to represent the next generation. In this study, the selection used is binary tournament selection. And flowchart of selection process is represented in Figure 5.

III. Results and Discussions
Implementation of this study using the programming language C# desktop-based. The interface made as easy as possible so that users only enter some parameter values to get the results of the optimization. There are four interfaces that can be accessed by the user, data of fertiliser, fertiliser recommendation reference, input and calculation results of genetic algorithms, and genetic algorithms computation. User inputs the parameter values in the main interface on the menu input and calculation results of genetic algorithms and genetic algorithms. Input interface and display the results of the genetic algorithm in Figure 6. Afterwards, users can see the process of genetic algorithm calculation that occurs from the input. Interface genetic algorithm calculation displayed in Figure 7.
The population size test is conducted to determine the size of the population which can produce the best fitness as well as the effect of population size on the value of fitness. For testing the generation of a population was 10 and multiplied by 10, from 10 to 100 population. While the value of the crossover rate and mutation rate used by cr = 0.4 and mr = 0.6. Each experiment will be performed 10 times and average fitness will be calculated Figure 8 shows that the fitness value increases in population size 10 to 20 and produces the same fitness value on the size of 20 to 100 after 10 attempts. In the experiment, population size produces an average of the best fitness with the best fitness value of 1.603. The higher fitness produced better results for the calculation of genetic algorithms. It can be concluded that the value of fitness influenced by the size of the population, the greater the value of the size of the population, no increases fitness values occurred and may affect the computation time that occurs in the software. These experiments generate the optimal solution in the population from 20 to 100 with an average fitness of 1.603.
Generation testing are conducted to determine the size of the generation which can produce the best fitness as well as the influence of the generation number on the value of fitness. For testing, the population amount was 10 and multiplied by 10 to 100 generations. While the value of the crossover rate and mutation rate used by cr = 0.4 and mr = 0.6; each experiment will be performed 10 times and average fitness will be calculated. Cross over and mutation rate is conducted to determine the size of the crossover rate and mutation rate which can produce the best fitness and influence the amount of crossover rate and mutation rate of the value of fitness; for the testing population amount used was 10 and the generation was 10. While the value of the crossover rate and mutation rate used added by 0.1 from 0 to 1. Each experiment will be performed 10 times and calculated the average fitness.
On Figure 10, it is shown that the combination of crossover rate and mutation rate affect the fitness. The fitness value of the highest increases in the size of the crossover rate and mutation rate of 0.1 and 0.9. While generating the lowest fitness value on the size crossover rate and mutation rate of 0.9 and 0.1. Trial size crossover rate and mutation rate produce an average fitness of 1.603 and fitness of 1.603 as the best value. The higher the fitness value produced the better the results of the calculation of genetic algorithms. It can be concluded that the value of fitness was influenced by the size of the crossover rate and mutation rate. These experiments generate the optimal solution in the population 30 to 50 and 70 to 100 with an average of 1,603.
Best parameters s test has 3 different scenarios using 3 different cases. Genetic algorithm parameter values used are the best parameters for the results of population trials, generation, crossover rate and mutation rate. The first thing is to test the best parameters. The population size used was 20 and the generation size was 30. While the crossover rate was 0.1 and the mutation rate was 0.9. Each experiment will be carried out 3 times.  In case 1, for Target 7 tons, Land 1 ha, in Malang and District Ampel Gading can be seen that the best fitness shown is 1.603. The total of the best price is Rp 623,800. In case 2 for Target 8 tons, Land 1 ha, in Malang and District Ampel Gading can be seen that the best fitness shown is 1.525. The total of the best price is Rp 655,600. While the test solution in case 3 for Target 9 tons, Land 1 ha, in Malang, and District Ampel Gading can be seen that the best fitness shown is 1.459. The total of the best price is Rp 685,200. Measurement of the best solutions on the issue composition of rice plant fertilizer is to look at the highest fitness value. The highest fitness is obtained from the smallest penalty value with minimum price. From the testing that has been done, a genetic algorithm can be used to solve optimisation problems fertiliser composition with a good rice crop.

IV. Conclusion
From the experiments conducted in this study, it can be concluded that a genetic algorithm can be used to compose the rice plant fertiliser. The settlement of this problem in the genetic algorithm is to use the representation of a real code chromosome, reproduction method used are one cut point crossover and random mutation, and binary tournament for the selection process. Moreover, the quality of the best solution in this study was measured by looking at the highest fitness value. The highest fitness value having the smallest penalty value and the minimum price. On testing can be seen that the best solutions for the fitness value of the result is 1,603 and the price of Rp 623,300.-. Furthermore, tests have been conducted to examine the influence of genetic parameters on the fitness value are test population, test of generation amount and test combinations of crossover rate (cr) and the mutation rate (mr) and using the best parameters at the trial population produces optimal population values on population size 20 and produce the best fitness of 1,603. In the test generation produce optimal value generation to generation size 30 and produce the best fitness of 1,603. While the trials combine crossover rate (cr) and the mutation rate (mr) is best found in combination mr cr 0.1 and 0.9 with the fitness value 1,603. The conclusion is the higher value of the population will produce better fitness value, the higher the value generation does not make much impact to produce the best fitness value and the higher value of the crossover rate (cr) and the mutation rate (mr) affect the value fitness but it is not necessarily can yield optimal results. The time needed to process the algorithm effect on the higher value it will be a long process of computation.