Particle Swarm Optimization and Genetic Algorithm for Big Vehicle Problem: Case Study in National Pure Milk Company

—The number of companies in the industry, as well as the current economic conditions, have created intense competition between companies. One of the important activities of a company is distributing goods from a warehouse to several agents so that the distribution of goods can be done easily and quickly. National Pure Milk Company is based in Salatiga. There are various ﬂavors of pure milk stored in the form of a cup and a pack that will be distributed to each destination. Each cup and pack has data in the form of mass, volume, destination (distance between the destination location and the warehouse location), and the time when it must be dropped. All items of pure milk will be delivered by 4 truck vehicles with different types. Each vehicle has a mass capacity, volume capacity, mileage capacity, trip duration capacity, and trip number capacity. All the data of the pure milk that distributed must not run over the capacity of the vehicle. In this research, Particle Swarm Optimization (PSO) Algorithm can be modiﬁed into the discrete PSO Algorithm to determine the shortest distance of the route and Genetic Algorithms can be modiﬁed to determine the exact composition of goods on each vehicle. The optimization problem is limited by the condition that each item is delivered at the same time interval.


I. INTRODUCTION
T HE number of companies in the industry, as well as the current economic conditions, have created intense competition between companies. Competition in the industry makes each company increasingly improve its performance so that company goals still can be achieved. One of the important activities of a company is distributing goods from a warehouse to several agents so that the distribution of goods can be done easily and quickly. This problem is commonly known as TSP (Traveling Salesman Problem). TSP is a combinatorial issue of the Operations Research area [1], [2]. The main problem of the TSP is that a salesman must visit several cities that the distances are known from one another. All cities must be visited by the salesman and the city must only be visited once. The problem is how the salesman can set the route so that the traveled distances become the optimum route which is the best minimum distance.
Optimization on logistics is a crucial issue in industries [3]. Real problems that often occur are in the logistics companies, where a company must be able to determine the amount needed to deliver an item or service from suppliers to the T customers so that the cost required is as minimum as possible.
Besides, there are also transportation problems in determining the most efficient routes with various obstacles such as the capacity of vehicles to store goods, the speed of the vehicle, the travel time of the vehicle, and others. The benefits of resolving a TSP problem will give good prospects in the future because by solving these TSP problems can also be used for navigation such as GPS which is very popular nowadays.
In this research, we solve the TSP problem and its constraints by taking a case of study on the data at National Pure Milk Company in Salatiga Indonesia.

A. Genetic Algorithm
The genetic algorithm is a stochastic searching technique to find the optimum value based on a natural selection mechanism [4]. Genetic algorithms differ from conventional convergence techniques which are more deterministic. The method is very different from most other optimization algorithms, which has the following characteristics: 1) Using the coding results of the parameters, not the parameters themselves. 2) Working in the population is not unique. Using the sole value of the function in the process. 3) Using outside functions or other outside knowledge. 4) Using the probability transition function is not a sure thing.

B. Particle Swarm Optimization Algorithm
This algorithm was firstly introduced by Kennedy and Eberhart in 1995 [5]. The basic idea of a Particle Swarm Optimization (PSO) is that a herd is assumed to have a certain size with each particle of its initial position located in a random location in a multidimensional space [6], [7]. Each particle is assumed to have two characteristics namely position and speed. Each particle moves in a certain space and remembers the best position that has ever been traversed or meet a food source or the value of an objective function. Each particle conveys its best information or position to the other particles and adjusts its position and speed.

D. Problem Analysis
National Pure Milk Company Indonesia is based in Salatiga. There are various flavors of pure milk stored in the form of a cup and pack that will be distributed to each destination. Each cup and pack of the pure milk item has data in the form of mass, volume, destination (distance between the destination location and the warehouse location), and the time when it must be dropped. All items of pure milk will be delivered  by 4 truck vehicles with different types. Each vehicle has a mass capacity, volume capacity, mileage capacity, trip duration capacity, and trip number capacity. All the data of the whole milk items distributed must not run over the capacity of the vehicle. Each truck vehicle has a fixed cost, hourly delivery fee, mileage cost, mass kg cost of whole milk items, and the cost of the number of trips that will be determined by which pure milk items will be placed on a number of truck vehicles so that the total interstitial costs are as small as possible. The optimization problem is limited by the condition that each item is delivered at the same time interval.
For i = 1, 2, . . . , m pure milk, we have: w i the mass of pure milk i, v i the volume of pure milk i, l i the destination of the pure milk i (the distance of the pure milk i to the warehouse), wt i the waiting time of pure milk i, st i the unloading time of pure milk i.
For j = 1, 2, . . . , p we have: CapW j the capacity of the vehicle's load j, CapV j the capacity of the vehicle's volume j, CapK j the capacity of the vehicle's mileage j, CapH j the capacity of the vehicle's time travel j, f c j fixed cost of the vehicle j, cw j vehicle's cost per mass j, cv j vehicle's cost per volume j, ck j vehicle's cost per kilometer j, ch j vehicle's cost per hour j, r j the average of vehicle's speed j.
For each vehicle, j will be stated that a row {x ij } n i=1 that fulfills in such a way to minimize the operational costs for vehicle j,

A. Inserting Goods in the Vehicle
In this case, we would like to determine the sequence {x ij } n i=1 which fulfills the first two constraints. It means we have to arrange various types of goods so they can be transported by all available trucks. In this case, 9 types of goods will be sent, thus n = 9 and 4 types of trucks are available. Note that, all is a sequence consisting of only numbers 1 and 0. The most suitable method to handle this is the Genetic Algorithm method because it can directly represent these sequences. However, because the optimized thing is different from the function in general, Genetic Algorithms need a little modification. In this study, every item that has the same type will be considered one type of goods or in other words, one type of item will be placed only in the same vehicle. The consequence is that if item one is in vehicle one, then it cannot be in another vehicle. If we stated the sequence, if x ij = 1 then it must x ik = 0 for every k = j. This is one of the modification needs to be added in the Genetic Algorithm. The following is an illustration of the modification: 1) The example of the best gen from Genetic Algorithm is given in Table II. 2) However, there is no same type of goods in the same vehicle, so the results are forced to be randomly changed as shown in Table III.
Thus, the composition of goods in the vehicle with the same item in the same vehicle can be obtained. Furthermore, the objective function of this step can be defined as follows. x i2 x i3 x i4 Thus, F is a function to determine the fitness of each individual. To deal with the obstacles, penalties will be used on the fitness of each individual. For example, if we obtained So, the value of the objective function is changed into Note that if a sequence {x ij } n i=1 breaks the obstacles, the fitness will be very poor and will not be chosen for the next generation. In this way, the right type of goods will come into the right type of vehicle.

B. Looking for the Best Route
After we have the sequence {x ij } n i=1 which contains the information of the position of each item at the time of shipment, we can determine the most efficient route for shipping the item. In this case, one type of item will be sent to 17 cities in Central Java. So, every vehicle must pass through the entire city. This problem now becomes a Traveling Salesman Problem, but with the objective is to minimize the travel costs, not only the distance traveled.
Here are the TSP-PSO algorithms: 1) Random initialization of permutation and swap sequences 2) For each iteration • Update gbest if needed • Update pbest if needed • For each particle in group

C. Calculating the Function of the Objective Operational Cost
After obtaining the type of goods in each vehicle as well as the route to send each item, afterward the fitness will be looked from the composition of the goods and the route of each vehicle towards operational costs. For example, {x i1 } n i=1 is the composition of goods in vehicle one and A = {a 1 , . . . , a k } (where a 1 , . . . , a k is the city that have to be passed and k is the number of cities) is the route the vehicle must pass. From A and D matrix, the travel distance can be obtained. Then from A, {x i1 } n i=1 the average speed of the vehicle and the unloading time of the goods, the total duration of the trip can be obtained. The total cost is obtained by adding the fixed cost with distance divided by cost per km and adding the duration of the trip multiply with the cost per hour. Here is the formulation of the objective function for vehicle 1.
However, that is the fitness value for the fulfilled obstacles, if in determining the route the vehicles caused the violated obstacles, so There will be fitness penalties from vehicle 1. The fitness value becomes m.100.c 1 where m is the number of obstacles that are violated. In other words, if a vehicle violates an obstacle then the fitness value will be bad and the route will not be selected as pbest or gbest. So, it is hoped that the selected route is a route that does not violate the constraint.

D. Results of Numerical Simulations
As explained before, this study aims to find the composition of goods in vehicles and the most efficient vehicle routes so that the operating costs can be minimized. To determine the optimum composition of goods in a vehicle, we have explained before by using Genetic Algorithm. And to determine the most efficient route discrete PSO algorithm will be used. Here are the results of applying the two algorithms to this problem as follow.

IV. CONCLUSIONS
After conducting various simulations and optimizing the operational costs of shipping goods to various cities in Central Java, it can be concluded that the Genetic Algorithms can be modified to determine the exact composition of goods on each vehicle, the PSO algorithm can be modified into the Discrete PSO Algorithm to determine the shortest distance of a route, vehicles with different luggage will choose different routes so that the operational costs are optimum, the optimization of the operational costs of the shipping of the goods of National Milk Pure Company Indonesia was successfully carried out.