OPTIMIZATION TECHNIQUES FOR SOLVING THE PROBLEM OF FRUIT DISTRIBUTION

Genetic algorithm is one of methods that can be used to solve complex optimization problems. One of the problems encountered by a fruit company is determine the distribution 5 types of fruits that will be sold to 5 distributors. Genetic algorithm itself is an optimization technique that is based on the evolution of living things, which in the evolution of living beings experience natural selection mechanism (including crossover and mutation) to be able to survive. In addition to the main purpose of implement genetic algorithms in this problem, the study will also try to compare with other optimization methods such as simulated annealing and Firefly Algorithm.This study also did the design and manufacture of software applications using genetic algorithms for optimization calculations provision and the distribution 5 types of fruits to 5 distributors, so it will get maximum income. However, the maximum income does not mean a good result. Because the distribution of fruit to distributors should be fair. Therefore, in this case the maximum income must be accepted by the company and distributors. If income is too high will have an impact on the company and distributor. Conversely, if income is too little will have an impact on the company and distributors. The results of this study showed that 10 times experiment using some number of generations. Genetic algorithms can generate maximum income is Rp. 136 167 000 from tenth experiment. While Simulated Annealing can generate maximum income is Rp. 141 028 000 from tenth experiment. And the Firefly Algorithm can generate maximum income is Rp. 158 844 500 from second experiment. Besides that results, the performance of Genetic Algorithm and Firefly Algorithm able to get results fast enough from the simulated annealing. It was because of the GA and FA generate many solutions, while SA is only a single solution. However, the results of the SA is good enough than the GA although it takes large iteration. FA get a very big result. And FA were able get maximum global quickly. However, these results are not suitable for use on this problem.


INTRODUCTION
The fruit is important food and should be consumed.Because in these fruits contained source of nutrients that were needed by the body for example vitamins, minerals and fibers.Many health problems that may arise due to less consumption of fruits.Such as an example of a lack of vitamin C can cause canker sores for mild symptoms and the worst is the scurvy and the lack of foods containing vitamin A can cause xeropthalmia.Therefore, the consumption of fruits is essential for the body and health.Every day, a lot of people buy and eat the fruit.Many fruit companies is selling fruit, and this problem has led to many intense competition between companies.Not to mention local companies in Indonesia also compete with companies overseas.One of a local company that sell fruits is a CV Harum Manis.
Owner of the company wantedto develop, grow and has a stable income so as to compete with other local companies and foreign companies that each time always export their fruit to Indonesia.Due to the company's desired to advance that, the company hada problem.The company always meet demand distributors with different amounts each month.That company has 5 types of fruit.And the company will sell the fruits to 5 distributors.
This problem mades the company distress to supply of stock fruit.If the companysupply fruits too much, the company fear if a fruit will not be sold.So that fruit will be rot, not fresh and not fit for sale.This can make the company bankrupt and losing.And if the companysupply fruits too little, the company is afraid if a distributor will get a little fruit and may not get fruit.This could make the company loses the opportunity to get benefit, the company loses a distributor who become regular customers and distributors will probably prefer to buy fruit to other companies.
Therefore, the distribution of distributor should be evenly and fairly.So, the company will continue to grow and have a stable income and high.Due to that complex problems, author will help the company to find a solution to supply and distribution fruit to distributors by make a calculation of some optimization methods.Some optimization methods that will be used by author, those areGenetic Algorithms (GA), Simulated Annealing (SA), and Firefly Algorithms (FA).
Genetic Algorithms (GA) was introduced by John Holland and researchers from the University of Michigan in the 1970s(S.M. Sait and H. Youssef,1999), which then started to be used widely to many fields, included for solved the optimization problem.The basic idea of the GA implemented model natural selection used decrease in genetic heritage by Darwin's theory (Michalewicz, 1996).The main process in the GA algorithm is process of breeding (crossover) to produce offspring and genetic mutations.After those processes, the next process is natural selection, in which members of the population are bad, they will be eliminated from the population.
The simulated annealing algorithm was originally inspired from the process of annealing in metal work.In 1982 Kirkpatrick used the term "Simulated Annealing" (SA) to describe how to use a virtual physical process to search out solutions to optimization problems.Annealing involves heating and cooling a material to alter its physical properties due to the changes in its internal structure.As the metal cools its new structure becomes fixed, consequently causing the metal to retain its newly obtained properties.Therefore, this concept was adapted by the SA to solve a variety of optimization problems.Besides, SA only evaluate one candidate at a time.
The firefly algorithms (FA) is a metaheuristic algorithm, inspired by the flashing behaviour of fireflies.The primary purpose for a firefly's flash is to act as a signal system to attract other fireflies.This algorithm was developed by Dr. Xin-She Yang at the University of Cambridge in 2007.Xin-She Yang formulated firefly algorithm by assuming all fireflies are unisexual, so that any individual firefly will be attracted to all other fireflies.Attractiveness is proportional to their brightness, and for any two fireflies, the less bright one will be attracted by (and thus move towards) the brighter one.However, the intensity (apparent brightness) decrease as their mutual distance increases.The brightness should be associated with the objective function.If there are no fireflies brighter than a given firefly, it will move randomly.

GENETIC ALGORITHMS
Genetic Algorithm is an adaptive heuristic method, because it can be several versions of the genetic algorithm, that adapts to the problems faced.Genetic Algorithm is also an effective algorithm and a simple and relatively easy to implement.Genetic Algorithm has the advantages compared to methods other heuristics, namely: a. GA solve the problem by encodes problems into a chromosome, rather than resolve the problem itself.Because it requires modeling chromosome good and effective that can represent the solution of the problems faced.b.GA start the process with an initial set of solutions, different with other metaheuristic, like Simulated Annealing and Tabu Search, that start the process with a single solution, and continues to other solutions through a transition.Therefore GA searches the solution space multidirectional, that minimize the possibility of stopping the search at local optimum condition.c.Genetic Algorithm is an algorithm that 'blind', because the GA does not know when it has reached the optimal solution.d.Using the transition probability function, so it is not a sure thing.
In addition, genetic algorithms also have disadvantages, namely: a.When fitness function is not properly defined, GA may converge towards local optima.b.Operation on dynamic sets is difficult.c.GA is not appropriate choice for constraint based optimization problem.
As already mentioned previously, genetic algorithm can be easily adapted to a wide variety of problems, so there are many versions of the Genetic Algorithm, depending on the problem to be solved.But in general genetic algorithm must meet criterias the following to generate optimal solutions: a.An exact representation of a solution to the problems, in the form of chromosomes.b.Generating initial population.Generally, the initial population is generated randomly, but in some cases can also be generated through certain methods.Merging both (generating initial population randomly and using certain methods) called seeding.Generated initial population should be heterogeneous, because if the population is too homogeneous form, Genetic Algorithm loses its ability to find the solution space, until the population has a diverse chromosome variation through other genetic operations (mutation).c.An evaluation function to determine the fitness value of each solution.d.Genetic Operators, simulate the process of reproduction (crossover) and mutation.e.Other parameters, such as the capacity of the population, the probability of genetic operations, and such.The capacity of the population is very affect the ability of Genetic Algorithm in finding a solution.The capacity of the population is too small causes a lack of variation in chromosome that appears, which can cause poor end result.Capacity large population usually give better results, and prevent premature convergence.

Process of Genetic Algorithms
Genetic algorithms are search algorithms based on the mechanisms of natural systems.Those are genetic and natural selection.In the application of genetic algorithms, variable solution encoded into structure of string that represents gene sequences, which are characteristic of the problem solution.Different from conventional search techniques, genetic algorithms departed from the set of solutions is generated randomly.This set is called the population.Whereas each individual in the population is called chromosomes which is a representation of the solution.Chromosomes evolved in an iterative process that continuous, it called generations.In every generation, the chromosomes are evaluated by an evaluation function.After some generations, the genetic algorithm will converge on the best chromosome, which is expected to be the optimal solution.
Genetic algorithms are search algorithms the best results, which are based on the marriage and the natural selection of genes.The combination of these marriages performed by a random process (random).Where the results of the gene structure of this marriage, will produce innovative genes to be selected In every generation, offspring (result of marriage), obtained from the bits and parts of genes that best parent.It is expected by take the best of the parent gene was obtained gene would better again.Although the fact that children do not always create better genes than its parent.There is the possibility of better, just as good, or maybe even worse.
The purpose of this genetic algorithm is to produce the best population of the initial population.While the advantages of genetic algorithm is the nature of a more optimal search method, without too enlarge the search space.
In compiling a genetic algorithm into the program, it would require some stages of the process, namely the process of making the initial generation, genetic process, selection process, and the repetition of the previous process.Adjust to Darwin's theory, the genetic algorithm is used terms that represent elements in the Darwinian theory, namely as can be seen in Table 2.2.

Population
It is a set of solutions of the problems will be solved using Genetic Algorithm.Population consists of a set of individuals (chromosomes).

Individual / Chromosome
Represent a possible solution (feasible solution) to the problems that wants to be solved.A Chromosome consists of a set of Gen.

Gen
Represent elements that exist in a solution.

Parent
A chromosome that will be subject to genetic operations (crossover).
Offspring it is a chromosome that is the result of genetic operations (crossover).

Crossover
A genetic operation that represents the breeding process between individuals.The crossover process requires two parent and produces one or more offspring

Mutation
A genetic operation that represents the process of mutation on the way individuals lives.
Mutation contributes to a random change in the population, that is useful to add to the variation of chromosome-chromosome in a population.
Details of the mutation process will also be discussed later.

Selection Procedure
A process that represents the process of natural selection (natural selection) of Darwin's theory.
This process is carried out to determine the parent of the genetic operations (crossover) that will be carried out to produce offspring.

Fitness Value
An assessment that determines Good or not a chromosome.Chromosome that has a low Fitness Value will eventually be eliminated by having Fitness Value chromosomes better.

Evaluation Function / Objective Function
Function is used to determine the value of Fitness Value.This Evaluation Function is a set of specific criterias of the problems that wants to be solved.

Generation
It is a unit of the population having experienced operations genetics, breeding, and produce offspring.At the end of each generation, to keep the number of chromosomes in the population remains constant, chromosomechromosome that have the Fitness Value is low and rank below the minimum value will be removed from the population.

Evaluation Function
There are two things that must be done in evaluating chromosome, ie the evaluation of the objective function (main function), and conversion functions into the objectives of the fitness function.In general, the fitness function derived from the objective function with non-negative value.

Replacement Process
Replacement process is the process of replacing the old population to new populations that have undergone a process of roullete whellselection, crossover and mutation.The new population will undergo the same process is expected to get better fitness value than the previous population.

ANALYSIS OF THE SYSTEM 3.1 Data Needs
Data needs on the software will be created, there are two namely input data and output data.Input data is the master data that has been provided by the user of the software and will be processed by the software to produce new data.The new data are candidates for the solution of the processes performed by the software.Then, the new data will be stored into the database.Meanwhile, theoutput data is the data of candidates for solutions that have previously been stored in the database, will be displayed to the user by the software.

Initialize Population
The generation of the Initialize Population was started from the manufacture of random 125 binary digits as many as 50 (In accordance with the population size).The binary will be split into 5 parts, in the manufacture of the five parts of the program is represented by D1, D2, D3, D4, D5 representing 5 distributors who act as genes.Each gene has 5 subgenes, the subgenes that represent 5 kinds of fruit.To change the binary to decimal using the formula alleles, which will be explained in the evaluation process.For more details, the division of the binary value can be seen in Figure 3.1

The evaluation process
The evaluation process is performed on the fitness value or an objective function for each chromosome.In this research, the objective function is calculate the value in the chromosome.The evaluation process will result in the values of fitness of each chromosome with the best value.To get a fitness value that must be done is to find the value of alleles.Formula to find the alleles are as follows.

Result of Experiment
Experiments were performed by running the program as many as 10 times.Each experiments were performed by different number of iterations or generation.In addition, the results of experiments that use genetic algorithms in this software will also be compared with the results of simulated annealing and Firefly Algorithm.So that would be obtained from the analysis of these three methods.Here is the experimental results shown in Table 4.1 And here is the price of each piece that has been determined to each distributor.

Genetic Algorithm
In Table 4.1, the results of the genetic algorithm shows that the results of tenth running got largest income.By iterating large enough, it turns out genetic algorithm can find a large enough income.However, to keep in mind that the GA is a 'blind' algorithm.So, GA does not know when it has reached the optimal solution.(Bambang,2008).In addition, when seen in the fifth running.With the number of iterations was 1750, we can get large enough income compared to the number of iterations were2000 and 2500.This proves that GA is a blind algorithm.However, although the GA was an algorithm that is blind, but the results of the GA pretty good or acceptable.(Rendy, 2013).Based on Table 4.5, after analyzed that distribution of fruit using FA heading to the maximum point at a predetermined distance.Indeed, the FA can find the results of the large income, but if the company uses the distribution of fruit with the FA, it is likely that the distributor will reject the offer of the company because a distributor will feel,if the company does not consider the number of sales of fruit to them.Because they will assume, that the company just choose the largest data from the purchase of fruit during the last 1 year.And this will be very troublesome to distributors, because they are forced to buy the maximum amount.
In Table 4.5, the company should provide as many as 1585 kg for mangoes, 1575 kg for pear, 1820 kg for oranges, 1810 kg for avocadoes, and 1690 kg for apples.Thus, the company will earn income of Rp. 158.844.500.

DISCUSSION
As the title of this thesis, this study discusses the results of using a genetic algorithm.From the experimental results in Table 4.1 by using a genetic algorithm, showed a comparison of the total value of the maximum income is a Rp.138 171 500 by providing as many as fruit1450 kg for mangoes, 1357 kg for pear, 1427 kg for oranges, 1624 kg for avocadoes, and 1457 kg for applesand distribution wasexplained in Table 4.3.In addition, the graph of the 10 experiments that have been performed with the number of iterations or generations is differences in experiments can be seen in figure 4.1 and figure 4.2.

CONCLUSION
From the observation during the design, implementation, and testing of software process that is done, it can be concluded as follows: 1. Genetic Algorithm methods can be applied to the optimization of the fruit distribution.2. Compared with simulated annealing and firefly algorithm, the results obtained and the process of using algorithms genetics is good enough or acceptable.3. The results showed that the highest income is Rp.136.167.000.With Crossover Probability (PC) = 70% and Mutation Probability (PM) = 10%.4. For the distribution the largest fruit in the distributor 4 and the lowest fruit in the distributor 2. 5.The requests of largest fruit is orange and the requests ofsmallest fruit is pear.

Figure 3 .
Figure 3.1Representation of a chromosome

Figure 3
Figure 3.2Allele Formula Max Range = Highest request binertodec(subD) = Convert binary value representing alleles to decimal Range = Highest request -Lowest request 2 n = ( n ) The number of binary digit on subD

Figure 4 Figure 4 .
Figure 4.1 Graph of Experiments

Table 4 .
1 Results of experiments with 10 times running