# The Modified Particle Swarm Optimization for a Special Case of the Assignment Problem: A Case Study in Chicken Transportation

Authors: Naratip Supattananon; Raknoi Akararungruangkul
Journal: Mathematical Problems in Engineering
 (2020)

---

## Abstract

This research aims at solving the special case of multistate assignment problem. The problem includes many special characteristics which are not normally included in the assignment problem. There are many types and conditions of vehicles included in the planning and different road conditions of traveling, which would have different effects on fuel consumption, which is the objective function of the study. The proposed problem is determined as a large and complicated problem making the optimization software unable to find an optimal solution within the proper time. Therefore, the researchers had developed a method for determining the optimal solution by using particle swarm optimization (PSO) in which the methods were developed for solving the proposed problem. This method is called the modified particle swarm optimization (modified PSO). The proposed method was tested with three groups of tested instances, i.e., small, medium, and large groups. The computational result shows that, in small-sized and medium-sized problems, the proposed method performed not significantly different from the optimization software, and in the large-sized problems, the modified PSO method gave 3.61% lower cost than the cost generated from best solution generated from optimization software within 72 hours and it gave 11.03% better solution than that of the best existing heuristics published so far (differential evolution algorithm).


---

## Body

## 1. Introduction

The egg is very important to the Thai economy and its people. Since it is a high nutrition fact food and can be cooked in many dishes, both main courses and desserts, it is therefore widely consumed, resulting in high demand for hen eggs throughout the year and it is likely to increase steadily. During 2012–2018, the average domestic egg consumption tended to increase at a rate of 6.13% per year. In 2018, the consumption of eggs was equal to 14,823.24 million, which is increased from 13,534.98 million eggs at a rate of 9.52% from the year 2017. Egg is cheap compared to other protein resources and easy for cooking. In addition, the government and private sectors have campaigned on the egg consumption suitable for all ages. In 2012–2018, Thai egg production increased at a rate of 5.98% per year, according to the increase in consumption demand. In 2018, the eggs were produced in the amount of 14,915.82 million, which is increased from 13,724.42 million eggs at a rate of 8.68% from the year 2017. Since there was the efficient management of egg farms, resulting in increased productivity, the export value of fresh eggs in 2018 was 92.58 million eggs or worth 319.42 million baht, which tended to increase at the rate of 6.82% per year. In 2018, 4,356.92 tons of chicken eggs were exported which is equivalent to 425.41 million baht. Japan was the main export market.This research studied the problem of chicken transportation, which was the multistage assignment problem. For the case study, an appropriate vehicle was assigned to transport the chickens directly from its farms to the egg farms, for the purpose of finding the answer with the lowest assignment cost. The mathematical models for the multistage assignment problem were developed which are suitable for the case study. Then, the estimating methods to find the optimal answer were also developed by employing the particle swarm optimization (PSO). When transporting chickens to the purchased farms, some factors must be considered, such as transportation standards, time, and temperature, and also the chickens apart from multiple sources must not blend up. These factors may affect the quality of the chicken. Therefore, if the assigned vehicle is appropriate and meets the needs of the chicken farms, it shall be used to send the chickens directly to the egg farms, without transporting chickens from other farms. The resulting cost of assignments or production costs is at the lowest value, which benefits the chicken farm concerning the decrease in production costs. Since each farm is responsible for all the costs incurred for transportation, they must be managed correctly and efficiently by establishing production schedules and assignments on farms, in both the allocation of chickens and the size of trucks that are used to deliver efficiently and quickly. It shall create the highest possible operating profit and the overall limitation of the chicken production will be raised. As the cost is decreased, chicken and egg farms can employ the time for doing other activities such as feeding, vaccination, or research and development for their farms.Road transport is an essential means and widely used in the transshipment of agricultural goods in Thailand. However, this type of transportation depends on energy from fuels, which has high energy consumption. Regarding the costs of transportation in 2018, the overall fuel usage of road transportation increased by 0.37% when compared with the previous year. When considering diesel and gasoline usage, it increased by 2.68% and 3.43%, respectively. Besides, the data showed the trends in increasing road transport costs each year (Energy Policy and Planning Office) [1]. Therefore, it is shown that the more the development in logistics, the more the fuel consumption. Moreover, the combustion of fuels in transportation causes a lot of air pollution, such as nitrogen oxides (N2O), carbon dioxides (CO2), and particulate matter (PM). Fuel conservation, therefore, is necessary to be considered together with the growth of various industries at the same time to prevent the fuel shortage in the future as well as to reduce the impact on the environment.Previously, Srivarapongse and Pijitbanjong [2] studied the assignment problem in the agricultural industry, which presented the generalized assignment problem (S-GAP) model. In the first step, the driver was assigned to the truck. Then, in the second step, the truck was assigned to the harvesting of sugarcane with the objective to create the maximum land size that could be employed for harvesting in a day. However, this research determined the most appropriate amount of chickens and the most fitted trucks to transport chickens to the factories. Each type of truck had a different capacity to carry chickens and had a different fuel consumption rate, causing the assignment of each type of truck to have different costs. And in this case, the objective was to obtain the lowest total cost. Nevertheless, the study of Srivarapongse and Pijitbanjong never mentioned this matter. In addition, this research also considered different road conditions for transportation, and their difference would affect the rate of fuel consumption as well. Therefore, this research had limitations closer to real-life working.The research motivation is to increase the profitability of farmers and all stakeholders related to the broiler industry, by reducing operational costs from the current situation. The contributions of this paper are as follows: (1) This research combines environmental care in the assignment problem by considering road categories that impact fuel consumption. This has been a new feature for this kind of problem. (2) The proposed method is a modified metaheuristic method which was developed for solving only this problem. (3) The case study, which is a real-world problem, occurred in Thailand. This paper fulfills the gap in the literature by determining the most appropriate amount of chickens and the most fitted trucks to transport chickens to the factories. Each type of truck had a different capacity to carry chickens.This research consisted of the following structures. Section2 provides the survey of the previous literature, Section 3 presents the problem statement, the methodology is presented in Section 4, Section 5 reports the computational result, and Section 6 provides conclusion and suggestion.


## 2. Literature Review

Assignment problem (AP) means the problem of the task allocation to an agent. Each job is different and each employee has different expertise, resulting in unequal time spent in working, and the cost of assigning jobs to each one is different as well. Therefore, the problem is how to assign the task so that the total cost shall be the lowest, with an important condition that the assignment must be one on one basis. In other words, once an assignment has been assigned to an agent, it cannot be assigned to another. On the other hand, if an agent gets assigned a task, he/she does not get assigned another task.The generalized assignment problem (GAP) is an extended type of the assignment problem (AP), which can assign multiple jobs to an employee, whereby the different assignments might require different resources. Ross and Soland [3] first presented GAPs and proved that GAPs were NP-hard problems [4]. Later, it was proven to be complete NP by Chu and Beasley et al. [5]. The exact procedures were presented and executed with the generated dataset without more added constraints.GAP has been revealed extensively by plenty of researchers who are trying to solve practical problems. Similarly, Osorio and Laguna [6] resolved GAP issues by considering work availability and rotation on a working day. Alfares [7] and Elshafei [8] also studied the same problem but considered additional working days in other GAP extensions in order to consider the assignment more than once, which is called multilevel GAP. Moreover, searching for a location and task allocation were considered together with the GAP solution [9].Dantzig[10] proposed a problem solution of simplex assignment by presenting assignment problems in linear programming problems and was able to use the simplex methods to execute problems. However, it has limitations to the range of the tested instances, a value of decision variables, equations, and limitations, including tools used to find the answers (computer). In other words, if the limitations were too much or the computer had not got enough capabilities, then the answer could not be found by using the simplex method. Therefore, the Hungarian method was a method proposed by Kuhn [11], which was another method used for resolving the assignments quickly. Furthermore, Ford and Fulkerson (1956) said that if the assignment problem with a size of 20 × 20 was solved with the simplex method, it would take at least an hour. However, if the Hungarian method was used, it would take about 30 minutes. It was the optimal manual calculation, which was considered much faster.The metaheuristic method is necessary to solve GAP problems. Its well-known methods were variable neighborhood search [12,13], colony optimization [14], adaptive large neighborhood search [15], differential evolution (DE) [16,17], and genetic algorithm (GA) [18]. DE and GA were also applied to image encryption application for classification of COVID-19 patients from chest CT images and drug interaction prediction efficiency [19–27].Particle swarm optimization (PSO) is a method that used natural imitation behavior by relying on the foraging role of animals, such as birds, fish, or other animals that have the behavior of finding food together. Each animal or particle shall find food by moving from the current point to the new point by using the direction and speed from particle best (Pbest) and the global best (Gbest) to search for the best food resources. This is the work to benefit the herd mainly. The PSO was first published by Kennedy and Eberhart (1995) [28]. Since then, this method has been discussed and used to execute various problems. Besides, Rapeepan and Kanchana (2016) [29] presented the particle swarm optimization (PSO) which was applied to execute the vehicle routing problem (VRP) with the service points and demands that could be changed.PSO methods have been extensively used to solve various problems, for instance, the assignment problems and multilevel location-allocation problems [30]. Besides, VRP with time window problems were solved by using the hybrid PSO method. In other words, other solutions were assembled into existing problems [31]. Solutions for pricing and production quantities were found by employing the hybrid particle swarm optimization and the differential evolution (DE) [32]. The hybrid particle swarm optimization was improved by employing particle swarm optimization and other methods [33]. Inventory management problems were solved by using the PSO method [34]. The logistics problems of distribution centers were resolved by applying the PSO method [35]. University and polytechnic exam scheduling was modified by employing the PSO method [36].Green logistics have received attention from business organizations in terms of environmental and ecological factors. When making logistics decisions aside from general economic costs, these also included pollution, accidents, resource use, and the risk of climate change [37]. Green logistics and green transportation were becoming part of supply chain management, which stimulated environmental awareness in transportation decisions, in addition to transportation costs as in the past [38].Nowadays, customers and business organizations place importance on environmental impacts due to the transportation of agricultural products which is a large type of energy consumption and greenhouse gas emissions (GHG). Many organizations are thus aware of the need to assess and reduce the environmental impacts of their activities and services. However, society is still concerned about the impact of human activities and the carelessness of using resources. There are a lot of research studies aiming to reduce the negative effects (i.e., fuel consumption and greenhouse gas emissions) from logistics activities to the environment such as pollution-routing problem (PRP) [39–41], green-VRP (G-VRP) [42], and the green-VRP pickup and delivery problem [43].There were previous research studies on the death of chickens, its diets, and growth periods, which could increase production rates or reduce death and weight loss [44–46]. Besides, production planning in chicken had been studied by Mohaddes [47], who has taken efforts to decrease the cost of raising chickens by revealing the most appropriate type of food and the number of chickens in all farms. Furthermore, Demircan et al. [48] sought to maximize the profit by considering the appropriate size of farm in order to provide the optimum feed consumption, including production costs and profits. In this study, appropriate farm sizes and parameters gained from former research studies were used for manufacturing planning. Therefore, each farm had to have a good production plan and the production plant would determine the chicken needs for each period, and the chicken produced from the farm had to meet the requirement of the production factory. As each farm had different sizes, it has to make a good assignment, so that the chicken demand of the factory was properly met. The highest possible profit will be achieved when all the needs are fulfilled. The profit of production planning is revenue, minus costs, which are probably the operating costs and transportation costs of the farm. All farms are considered to have the same production costs, but the delivery cost is different because they are located in different areas. The models presented in this research would determine the optimal number of chickens and the most fitted truck to transport the chicken to the production plant. Each type of truck has a different capacity to transport chickens and a different fuel consumption rate, resulting in different assignment costs as well. In addition, different road conditions are considered, and their difference would affect the rate of fuel consumption. Nevertheless, there has never been any research on GAP problems since GAP is a difficult problem. If there are many farms, it is not possible to execute problems using the exact procedure. Therefore, the particle swarm optimization (PSO) has been presented to execute the problems in this research.


## 3. Problem Statement

The case study is the multistage assignment problem, which is used to assign the appropriate vehicle type suitable for chicken transportation directly from the chicken farms to the egg farms. There are 4 categories of vehicles, which are truck that has ten, six, and four wheels and the modified version of the four-wheel truck aiming to keep the total cost minimum. The cost of the assignment in this case study consists of 3 parts, which are (1) the cost of transshipment depending on the category of vehicle with different fuel consumption rate and the distance in transportation, (2) the cost of transshipment depending on the category of road condition and the distance to travel, and (3) the opportunity cost.Multistage assignment problem was studied by considering the appropriate vehicle type suitable for chicken transportation straight from the chicken farms to the egg farms, and the limitations are listed as follows:(1)
It is direct transportation in which there was no picking the chickens up from different farms and not being transport to other egg farms. The egg farms require quality control and good breed, to protect against communicable diseases.(2)
A chicken ranch may transport to many egg ranches.(3)
Once the chickens have been produced, all of them can be sold.(4)
The egg ranch may obtain chickens from many different farms, but must not over the capabilities of such a farm.(5)
Egg ranch shall get not less than 50 percent of the demand of their farm.(6)
The time required for transportation should not exceed 8 hours, beginning with loading chicken to the vehicle, transporting, and taking them down.(7)
The vehicles employed for transportation are acceptable for needs.(8)
Chicken ranch can employ more than one category of vehicles.This assignment is the multistage assignment problem beginning by assigning the truck type (4 types). Each truck has a different capacity to transport chickens and a different fuel consumption rate, which causes different assignment costs. Therefore, the researcher aims to study the multistage assignment problem by considering the appropriate vehicle type to transport chickens straight from the chicken farms to the egg farms for the cheapest total cost.The multistage assignment problem of the case study is to assign the layer hen farming to feed chickens starting from hatching and then raise them until they can be sold to the egg farming. Hatching and feeding of layer chickens require different technologies compared to raising chickens to lay eggs. The chicken farm consists of 40 farms, and all are capable of producing chickens differently, as shown in Table1. In addition, this assignment is the multilevel assignment beginning by assigning the truck type, which consists of 4 types as shown in Table 2. Each type of truck has a different capacity to transport chickens and different fuel consumption rate, resulting in different assignment costs. However, the assignment must be under the conditions or restrictions specified.Table 1
Details of 40 chicken farms.
Types of chicken farmsProduction capability (chickens/farm)Number of farmsTotal amount (chickens)Large farm20,0008160,000Medium farm10,00012120,000Small farm5,00020100,000Total35,00040380,000Table 2
Types of vehicles used in transportation.
Types of vehiclesNumber of chickensRate of fuel consumption (liter/kilometer)Ten-wheel truck12,0003.2Six-wheel truck8,0005.0Four-wheel truck4,0008.0Modified four-wheel truck2,00010.0Egg production can be obtained by using layer chickens that are obtained from the chicken farms in which there are 60 egg farms. Each farm has a different demand for chickens, but in total there is a demand for 388,000 chickens, as shown in Table3.Table 3
Details of egg farms.
Types of egg farmsNumber of laying chickensNumber of farmsTotal amount (chickens)A10,00018180,000B8,00014112,000C5,0001050,000D3,0001030,000E2,000816,000Total28,00060388,000The condition of the road used to transport shall affect the speed of the truck and its speed influences the rate of fuel consumption as well. The speed varies according to road conditions. For example, the main roads connecting the province are usually large with 4–6 traffic lanes. The vehicles can speed up than the roads with narrower lanes. The road surface also affects the speed, and the roads with a smooth surface, such as paved roads, can be driven faster than the roads with a rough surface (a concrete road, a damaged road, and bumpy road surface). In this research, the road condition is divided into 5 types [49], with each road having different average speeds and fuel consumption rates as shown in Table 4.Table 4
Road types and fuel consumption rates.
Road typesAverage speed (km/hr)Fuel consumption rate (liter/kilometer)A<500.112B51–600.090C61–700.098D71–800.098E81–900.102In general, the cost of transporting goods varies with distance, so the mathematical models shall try to find the shortest route as the answer to the problem, resulting in the lowest total cost. However, this research presents different perspectives with the purpose of finding the lowest grand fuel transportation cost. Therefore, the mathematical model shall try to choose the transportation route with the lowest fuel consumption first regardless of the distance. Calculation examples are shown for a better understanding of the pattern of the problem in this research as follows.The road types among 6 farms are specified in Table5 and its distance is revealed in Table 6. When the fuel usage rate is multiplied by the traveling distance, the result shows the amount of fuel used to travel among 6 farms. For example, traveling from Farm 1 to Farm 6 has a distance of 23 kilometers, which is the road type C (fuel consumption rate of 0.098 liter/kilometer). Therefore, the fuel consumption on this route is 23 × 0.098 = 2.254 liters, as shown in Table 7.Table 5
Example of road type metrics among 6 farms.
Farm1234561—ACBBC2A—BCAA3CB—BBC4BCB—DA5BABD—C6CACAC—Table 6
Example of distance metrics among 6 farms.
Farm1234561—1739372723217—2831192433928—4216264373142—2918527191629—3962324261839—Table 7
Example of fuel metrics for traveling among 6 farms.
Farm1234561—1.9043.8223.3302.4302.25421.904—2.5203.0382.1282.68833.8222.520—3.7801.4402.54843.3303.0383.780—2.8422.01652.4302.1281.4402.842—3.82262.2542.6882.5482.0163.822—Transportation solutions generally focus on finding the shortest route as it leads to the lowest transportation costs. Nevertheless, shorter routes may consume more fuel. For instance, travel distances from Farm 6 to Farm 2 and Farm 6 to Farm 3 are equal 24 kilometers and 26 kilometers, respectively. When considering the fuel used in both directions, which is 2.688 liters and 2.548 liters, it can be seen that the route from Farms 6–3 is longer than the route from Farms 2–6, but less fuel is used.


## 4. Mathematical Model Formulation

Indicesi = 1, 2, 3, …, I (types of trucks from 1 to I)j = 1, 2, 3, …, J (chicken farms 1 to J)k = 1, 2, 3, …, K (transportation rounds 1 to K)l = 1, 2, 3, …, L (egg farms 1 to L)Decision variablesxijkl = 1, chickens are assigned to the truck i to ship the chickens from the farm j in the round k to deliver them to the egg farm l= 0, other casesyijkl = 1, there is the vehicle type i to deliver the chickens from the farm j in the round k to transport to the egg farm l= 0, other casesqijkl = the amount of chickens shipped by vehicle i to deliver chickens from the farm j in the round k to the egg ranch lParametersI = category of the truckJ = amount of chicken ranchK = amount of rounds of the transportation of the truckL = number of egg farmscijl = cost of assigning truck i to transport the chickens apart from the farm j to  the egg farm leijl = cost of transportation on the truck i to transport the chickens apart from the farm j to the egg farm lti = the limitation to deliver chickens of the vehicle type iOijl = the opportunity cost of inefficient transportation by truck i to deliver chickens from the farm j to the egg ranch l (unit: baht per chicken)dl = the chicken demand from the egg farm lsj = the capacity to produce chickens from the farm jtjikl1 = the time taken to load the chickens up the vehicle i from chicken ranch j in the round k to egg farm lpji1 = the staff ability of the chicken farm j to load up the chickens to the truck itijkl2 = the time taken to bring the chickens down from the truck i from chicken ranch j in the round k at the egg ranch lpli2 = the staff ability of the egg ranch l to bring chickens down from the truck type i.tijkl3 = traveling time of vehicle type i from the service center to the chicken farm j to transport the chicken in the round k to the egg ranch ltljd = the time taken for transporting the chicken from the service center to the chicken ranch j, and the time spent to travel from the chicken ranch j to the egg ranch ltijkl4 = the total operating time of the vehicle type i to deliver chicken from ranch j in the round k to egg farm lti5 = the limited predefined working time of truck iObjective function:(1)min∑iI∑jJ∑kK∑lLcijl×xijkl+∑iI∑jJ∑kK∑lLeijl×yijkl∑iI∑jJ∑kK∑lLxijkl×ti−qijkl×Oijl.Constraints:(2)xijkl∈0,1∀ijkl,(3)qijkl∈0∀ijkl,(4)∑lLxijkl≤1∀ijk,(5)∑iI∑jJ∑kKqijkl≤dl∀l,(6)∑iI∑jJ∑kKqijkl≥0.5dl∀l,(7)∑iI∑jJ∑kKqijkl=sj∀j,(8)qijkl≤M×xijkl∀ijkl,(9)qijkl≤ti∀ijkl,(10)tijkl1=pjiij1×qijkl,∀ijkl,(11)tijkl2=pli2×qijkl∀ijkl,(12)tijkl3=tljd×xijkl∀ijkl,(13)tijkl4=tijkl1+tijkl2+tijkl3∀ijkl,(14)tijkl4≤ti5∀ijkl,(15)xijkl≥xijk+1l∀ijkl,This mathematical model was formulated to execute the multistage assignment problem. The purpose function consists of 3 cost terms: (1) the cost of transshipment depending on the category of vehicle with different fuel consumption rate and the distance in transportation, (2) the cost of transshipment depending on the type of road condition and the distance to travel, and (3) the opportunity cost occurred due to not full capacity of transporting.Various limitations relating to the decision variables are as follows:Xijkl is a positive integer and has a value of 0 or 1 only (equation (2)). The amount of chickens to be transported (qijkl) must be a positive integer (equation (3)). The egg ranch (l) can only get chickens apart from the chicken farm (j) by employing the truck (i) in the round (k) only a single time (equation (4)). Equation 4 is also used avoid the shipping of the chickens from different sources to the same egg farm. Egg farm (l) might not receive chickens as its demand (equation (5)) and each egg farm (l) shall get not less than 50 percent of the chickens, according to their requirement (equation (6)). Each chicken ranch (j) is able to send chickens to all egg farms with no leftover at the farm (equation (7)). If the assignment is not occurred (Xijkl  = 0), the amount to be delivered must be equal to 0 (qijkl  = 0) (equation (8)). The amount to be delivered (q) in each cycle must not be over the capacity of the vehicle (equation (9)). The time consumed on storing up chickens to the vehicle is shown in equation (10). Equation (11) is used to determine the amount of time spent to load out the chicken that is transported to egg farm l. Equation (12) determines the total traveling time of truck i to deliver the assigned egg farm. Equations (13) and (14) determine the total time that truck i spent to deliver the chicken to the egg farm and this time should not exceed the predefined period of time (working time), and equation (15) is used to control that round k must be executed before round k+1.


## 5. Methodology

The multistage assignment problem of the case study is to assign the fitted vehicle type for the chickens transporting straight from the chicken ranch to the egg ranch by employing the cheapest total cost. Therefore, the author has applied and developed particle swarm optimization (PSO) and modified particle swarm optimization (modified PSO) in Sections5.1 and 5.2, respectively.


### 5.1. Particle Swarm Optimization (PSO)

Particle swarm optimization is one of the most widely used methods, which was first mentioned by Kennedy and Eberhart in 1995. It can find the answer by using the cooperation between the particle and its swarm and each particle searches for the appropriate value from the current location. The direction and velocity for the next position are known by considering the former direction and speed from the particle best (Pbest) and the global best (Gbest). The relationship can be shown as follows:(16)Vt+1=c0Vt+c1r1Pbest−Xt+c2r2Gbest−Xt,(17)Xt+1=Xt+Vt+1,where Vt+1 is the speed of each particle for traveling to a new position, Vt is the speed of each particle for the existing position, r1 and r2 are random number values between 0 and 1, c0, c1, and c2 are the learning coefficient constants, Xt is the existing position, Xt+1 is the new position, Pbest is the particle best, and Gbest is the global best.When the particle recognizes the new velocity (Vt+1), such particle shall change from its existing position (Xt) by using the said velocity to the new position (Xt+1). When each particle changes from its existing position to the new position, it must use its particle best and global best (equation (17)). Therefore, when the particle best is found, the whole changes to that position. Such a position might be the only local optimal solution. In order to find the solution, the particle swarm optimization method is detailed as follows.


#### 5.1.1. Encoding Method

The encoding method uses the same principle with the differential evolution (DE), which assigns a random number between 0 and 1 for every particle in each particle. Then the random number of each particle is sorted in ascending order. Particles with the lowest random number shall be chosen first. Random numbers of truck types are shown in Table8. Random numbers of the chicken farm are revealed in Table 9 and random numbers of egg farms are revealed in Table 10. After that, the lowest random numbers will be considered first, and then the highest will be chosen last. Then the sequence from the said guidelines shall be decoded.Table 8
Initial particle of the truck type.
ParticleInitial particle of the truck type1234510.36620.03300.86620.53090.430420.37380.26980.54560.93800.434430.62670.62800.50890.09260.375940.60830.74640.06870.87660.5045Table 9
Initial particle of the chicken farm.
ParticleInitial particle of the chicken farm1234510.25970.14710.84200.40440.712420.31840.29530.45260.84810.121330.12320.09950.34690.32180.045640.95810.21220.57130.80340.9386Table 10
Initial particle of the egg farm.
ParticleInitial particle of the egg farm1234510.04720.62640.83700.84890.247920.39400.75090.10760.58240.541730.93130.20530.18510.47470.045640.68330.58250.27440.07460.5546


#### 5.1.2. Decoding Method

The decoding method uses the same principle with the differential evolution (DE), where each cycle begins with determining the quantity to be transported by comparing the number of chickens in the first chicken farm with the demand of the first egg farm. If any amount is less, such amount shall be transported. To comply with the constraints of the case study, each egg farm shall receive at least 50 percent according to the chicken demand. However, the egg farms in the last rank may not gain the chickens as they need:(18)A1=QdA,ifQdA≤Qs,Qs,otherwise,where A1 means the quantity to be transported, QdA means the chicken demand (50 percent of the total demand), and Qs means the number of chickens produced by the chicken farms.Then the appropriate truck is chosen by considering its capacity that is greater than the quantity to be transported and must be the truck with the capacity closest to the delivered amount.Once the transportation has been completed, adjustments and validity checks must be recorded to meet the constraints of the case study. If the chicken farm still has chickens left, it will be transported next round until there are no remaining chickens from this farm, and then the next farm will be chosen for further transportation.The decoding process begins with determining the transport quantity and choosing the appropriate truck type to avoid transportation many times, which results in higher production costs. The chicken farm is able to transport all the chickens without remaining. Egg farms also get the chickens at least 50 percent of the demand. The egg farms in the first particle shall receive all the chickens as they need, while the egg farms in the last order may not receive all the chickens as they need. However, chicken transportation in each round must not be over the capacity of each vehicle and must be used not more than the specified usage hours. When decoding the initial particle, the answer is given in Table11.Table 11
The assignment costs from initial particle decoding.
Particle sequencesTransportation costOpportunity costAssignment cost113,5623,84517,407214,6104,84619,456314,0884,81118,899414,9514,15819,109513,4334,15217,585Once the initial particle has been processed (equation (17)), it provides the particle of the truck type according to Table 12, the particle of chicken farms as per Table 13, and the particle of the egg farm as per Table 14. After that, the values obtained shall be arranged in order to be assigned before-after as in Tables 15–17, respectively.Table 12
The particle of the truck type after past the process of particle swarm optimization (PSO).
ParticleThe particle of the truck type1234510.48200.3197−0.25200.19280.412920.57330.85210.31940.53520.626230.39930.49810.57630.43411.740240.2681−0.12150.68090.39330.1290Table 13
The particle of chicken farms after past the process of particle swarm optimization (PSO).
ParticleThe particle of the chicken farm1234510.82330.41770.6567−0.24850.103220.38650.22230.66170.82640.127730.83581.61210.19890.49070.750840.81780.04770.6120−0.5619−0.2719Table 14
The particle of egg farms after past the process of particle swarm optimization (PSO).
ParticleThe particle of the egg farm1234510.66850.85530.57300.80240.419621.26800.73750.92170.68070.33723−0.19300.34550.49811.09051.075440.1991−0.37280.35751.34760.5766Table 15
The particle sequences of the truck type chosen for the assignment.
ParticleThe particle of the truck type12345132112244243323334411421Table 16
The particle sequences of the chicken farm chosen for the assignment.
ParticleThe particle of the chicken farm12345133322212443344134421211Table 17
The particle sequences of the egg farm chosen for the assignment.
ParticleThe particle of the egg farm12345134322243411312234421143The decoding can be conducted by taking the 1st particle of the truck category, the chicken farm, and the egg farm in order to be used to arrange the assignment, which can be put in order as in Table16 and the data in Table 18 are taken for decoding. The assignment of the truck type, suitable for the number of chickens delivered each time, is detailed in Table 19.Table 18
The particle in the first order to be assigned.
ParticleThe particle of the truck typeThe particle of the chicken farmThe particle of the egg farm1333241432414122Table 19
The particle in the first order to be assigned.
No.TruckCycleChicken farmEgg farmTypeSpaceFarmSupplyAssignRemainingFarmDemand (50%)AssignRemaining123,0001310,0005,0005,00035,0005,0000231,500135,0002,5002,50042,5002,5000331,500132,5002,500015,0002,5002,500431,5001110,0002,5007,50012,5002,5000530117,5004,0003,50024,0004,000063500113,5003,500035,0003,5001,50074500145,0001,5003,50031,5001,5000831,500143,5002,5001,00042,5002,5000941,000141,0001,000015,0001,0004,0001030125,0004,0001,00014,0004,00001141,000121,0001,000024,0001,0003,000There are differences in the assignment of chicken farms and egg farms: (1) the chicken farm shall be assigned continuously to run out the chickens and (2) egg farm, where the chicken demand is divided into two equal parts according to the constraint of the case study.In the decoding process, the conditions must be checked, such as the remaining working hours of each type of vehicle and the time spent on each shipment. Each chicken farm is able to send out most of the chickens and egg farms shall get at least 50% of all chickens as their requirement. The assignment for small-size samples, a particular type of truck usage, does not over the specified number of hours. The details are as in Table20. The assignment cost consists of the main cost which is the cost incurred due to transportation, including the distance to transport, fuel consumption rate, and fuel prices. If the transportation capacity is not full, it causes an increase in the opportunity cost. If there is no free space, the opportunity cost shall be 0, as in Table 21.Table 20
Time for assignment (time unit: hours).
No.Truck typeCycleChicken farmEgg farmAssignmentTime to load upTime to bring downTime transportTotal time121235,0000.450.52.14.8231442,5000.1750.21.9384.038331412,5000.1750.2250.7882.988431112,5000.250.2252.054.813531124,0000.40.281.1754.25631133,5000.350.282.1753.9741331,5000.150.1050.2632.4831342,5000.20.1752.3885.463921315,0000.450.452.3885.5631041321,0000.10.12.455.938Table 21
Cost of assignment.
No.TruckCycleChicken farmEgg farmTransportation costOpportunity costTotal costTypeSpace123,0001232,3048643,168231,5001441,2114541,665331,5001418963361,232431,5001111,4445411,9855301121,27501,275635001131,1701461,31674500133576144720831,5001341,6396152,254923,0001312,6701,0323,7021041,0001321,4257132,138Total14,6104,84619,456


### 5.2. Modified Particle Swarm Optimization (Modified PSO)

The update of the particle position has been modified; therefore, we called our modification method as modified PSO. Instead of using formula (17), the following formula is used to update the particles’ position to enhance the search performance of the PSO:(19)Xt+1=Xt+Vt+1,ifrandt≤CR,Rt,otherwise,Particle swarm optimization (PSO) is often trapped on the answer which is the local optimal answer. It may lead to not the most appropriate answer. In order to expand, therefore, the answer is improved and there is no change in the answer after processing 200 iterations, by randomly sampling the number of particles that might change in each particle of the truck types, the number of cycles, chicken farms, and egg farms. Then a new random numberRt is assigned to change the location to find the answer as in equation (19). A constant (CR) has a value between 0 and 1, and then a random number randt is assigned to compare with the CR. If the random value is less than or equal to CR, it shall require to change to the new position as before Xt+Vt+1. However, if the random value is greater than the CR value, the new position shall be assigned to the random value between 0 and 1, and the new number Rt due to the new position needs to be changed for only certain particles, which no need many changes from the existing searches. From the preliminary experiment, we found that the suitable value of CR is 0.8. The procedure of modified PSO is illustrated as a flowchart in Figure 1.Figure 1
Flowchart of modified PSO methodology.Table22 compares the features between modified PSO and DE, and this shows the advantage of the algorithm in this paper. The modified PSO has a lower number of parameters, steps, and processing time used in the process. Moreover, it suites for the complex problem as well.Table 22
Comparison in terms of features of DE and modified PSO.
FeaturesDEModified PSOPrincipleUsing the difference among vectors to expand the searching areaUsing cooperation among particles to find the best area which contained the best solutionNumber of parametersHighLowProcedure4 main steps:3 main steps:(1) Initial population(1) Encoding(2) Mutation(2) Decoding(3) Recombination(3) Modified particle swarm optimization(4) SelectionSuit for complex problemMediumHighProcessing timeLongShort


## 5.1. Particle Swarm Optimization (PSO)

Particle swarm optimization is one of the most widely used methods, which was first mentioned by Kennedy and Eberhart in 1995. It can find the answer by using the cooperation between the particle and its swarm and each particle searches for the appropriate value from the current location. The direction and velocity for the next position are known by considering the former direction and speed from the particle best (Pbest) and the global best (Gbest). The relationship can be shown as follows:(16)Vt+1=c0Vt+c1r1Pbest−Xt+c2r2Gbest−Xt,(17)Xt+1=Xt+Vt+1,where Vt+1 is the speed of each particle for traveling to a new position, Vt is the speed of each particle for the existing position, r1 and r2 are random number values between 0 and 1, c0, c1, and c2 are the learning coefficient constants, Xt is the existing position, Xt+1 is the new position, Pbest is the particle best, and Gbest is the global best.When the particle recognizes the new velocity (Vt+1), such particle shall change from its existing position (Xt) by using the said velocity to the new position (Xt+1). When each particle changes from its existing position to the new position, it must use its particle best and global best (equation (17)). Therefore, when the particle best is found, the whole changes to that position. Such a position might be the only local optimal solution. In order to find the solution, the particle swarm optimization method is detailed as follows.


### 5.1.1. Encoding Method

The encoding method uses the same principle with the differential evolution (DE), which assigns a random number between 0 and 1 for every particle in each particle. Then the random number of each particle is sorted in ascending order. Particles with the lowest random number shall be chosen first. Random numbers of truck types are shown in Table8. Random numbers of the chicken farm are revealed in Table 9 and random numbers of egg farms are revealed in Table 10. After that, the lowest random numbers will be considered first, and then the highest will be chosen last. Then the sequence from the said guidelines shall be decoded.Table 8
Initial particle of the truck type.
ParticleInitial particle of the truck type1234510.36620.03300.86620.53090.430420.37380.26980.54560.93800.434430.62670.62800.50890.09260.375940.60830.74640.06870.87660.5045Table 9
Initial particle of the chicken farm.
ParticleInitial particle of the chicken farm1234510.25970.14710.84200.40440.712420.31840.29530.45260.84810.121330.12320.09950.34690.32180.045640.95810.21220.57130.80340.9386Table 10
Initial particle of the egg farm.
ParticleInitial particle of the egg farm1234510.04720.62640.83700.84890.247920.39400.75090.10760.58240.541730.93130.20530.18510.47470.045640.68330.58250.27440.07460.5546


### 5.1.2. Decoding Method

The decoding method uses the same principle with the differential evolution (DE), where each cycle begins with determining the quantity to be transported by comparing the number of chickens in the first chicken farm with the demand of the first egg farm. If any amount is less, such amount shall be transported. To comply with the constraints of the case study, each egg farm shall receive at least 50 percent according to the chicken demand. However, the egg farms in the last rank may not gain the chickens as they need:(18)A1=QdA,ifQdA≤Qs,Qs,otherwise,where A1 means the quantity to be transported, QdA means the chicken demand (50 percent of the total demand), and Qs means the number of chickens produced by the chicken farms.Then the appropriate truck is chosen by considering its capacity that is greater than the quantity to be transported and must be the truck with the capacity closest to the delivered amount.Once the transportation has been completed, adjustments and validity checks must be recorded to meet the constraints of the case study. If the chicken farm still has chickens left, it will be transported next round until there are no remaining chickens from this farm, and then the next farm will be chosen for further transportation.The decoding process begins with determining the transport quantity and choosing the appropriate truck type to avoid transportation many times, which results in higher production costs. The chicken farm is able to transport all the chickens without remaining. Egg farms also get the chickens at least 50 percent of the demand. The egg farms in the first particle shall receive all the chickens as they need, while the egg farms in the last order may not receive all the chickens as they need. However, chicken transportation in each round must not be over the capacity of each vehicle and must be used not more than the specified usage hours. When decoding the initial particle, the answer is given in Table11.Table 11
The assignment costs from initial particle decoding.
Particle sequencesTransportation costOpportunity costAssignment cost113,5623,84517,407214,6104,84619,456314,0884,81118,899414,9514,15819,109513,4334,15217,585Once the initial particle has been processed (equation (17)), it provides the particle of the truck type according to Table 12, the particle of chicken farms as per Table 13, and the particle of the egg farm as per Table 14. After that, the values obtained shall be arranged in order to be assigned before-after as in Tables 15–17, respectively.Table 12
The particle of the truck type after past the process of particle swarm optimization (PSO).
ParticleThe particle of the truck type1234510.48200.3197−0.25200.19280.412920.57330.85210.31940.53520.626230.39930.49810.57630.43411.740240.2681−0.12150.68090.39330.1290Table 13
The particle of chicken farms after past the process of particle swarm optimization (PSO).
ParticleThe particle of the chicken farm1234510.82330.41770.6567−0.24850.103220.38650.22230.66170.82640.127730.83581.61210.19890.49070.750840.81780.04770.6120−0.5619−0.2719Table 14
The particle of egg farms after past the process of particle swarm optimization (PSO).
ParticleThe particle of the egg farm1234510.66850.85530.57300.80240.419621.26800.73750.92170.68070.33723−0.19300.34550.49811.09051.075440.1991−0.37280.35751.34760.5766Table 15
The particle sequences of the truck type chosen for the assignment.
ParticleThe particle of the truck type12345132112244243323334411421Table 16
The particle sequences of the chicken farm chosen for the assignment.
ParticleThe particle of the chicken farm12345133322212443344134421211Table 17
The particle sequences of the egg farm chosen for the assignment.
ParticleThe particle of the egg farm12345134322243411312234421143The decoding can be conducted by taking the 1st particle of the truck category, the chicken farm, and the egg farm in order to be used to arrange the assignment, which can be put in order as in Table16 and the data in Table 18 are taken for decoding. The assignment of the truck type, suitable for the number of chickens delivered each time, is detailed in Table 19.Table 18
The particle in the first order to be assigned.
ParticleThe particle of the truck typeThe particle of the chicken farmThe particle of the egg farm1333241432414122Table 19
The particle in the first order to be assigned.
No.TruckCycleChicken farmEgg farmTypeSpaceFarmSupplyAssignRemainingFarmDemand (50%)AssignRemaining123,0001310,0005,0005,00035,0005,0000231,500135,0002,5002,50042,5002,5000331,500132,5002,500015,0002,5002,500431,5001110,0002,5007,50012,5002,5000530117,5004,0003,50024,0004,000063500113,5003,500035,0003,5001,50074500145,0001,5003,50031,5001,5000831,500143,5002,5001,00042,5002,5000941,000141,0001,000015,0001,0004,0001030125,0004,0001,00014,0004,00001141,000121,0001,000024,0001,0003,000There are differences in the assignment of chicken farms and egg farms: (1) the chicken farm shall be assigned continuously to run out the chickens and (2) egg farm, where the chicken demand is divided into two equal parts according to the constraint of the case study.In the decoding process, the conditions must be checked, such as the remaining working hours of each type of vehicle and the time spent on each shipment. Each chicken farm is able to send out most of the chickens and egg farms shall get at least 50% of all chickens as their requirement. The assignment for small-size samples, a particular type of truck usage, does not over the specified number of hours. The details are as in Table20. The assignment cost consists of the main cost which is the cost incurred due to transportation, including the distance to transport, fuel consumption rate, and fuel prices. If the transportation capacity is not full, it causes an increase in the opportunity cost. If there is no free space, the opportunity cost shall be 0, as in Table 21.Table 20
Time for assignment (time unit: hours).
No.Truck typeCycleChicken farmEgg farmAssignmentTime to load upTime to bring downTime transportTotal time121235,0000.450.52.14.8231442,5000.1750.21.9384.038331412,5000.1750.2250.7882.988431112,5000.250.2252.054.813531124,0000.40.281.1754.25631133,5000.350.282.1753.9741331,5000.150.1050.2632.4831342,5000.20.1752.3885.463921315,0000.450.452.3885.5631041321,0000.10.12.455.938Table 21
Cost of assignment.
No.TruckCycleChicken farmEgg farmTransportation costOpportunity costTotal costTypeSpace123,0001232,3048643,168231,5001441,2114541,665331,5001418963361,232431,5001111,4445411,9855301121,27501,275635001131,1701461,31674500133576144720831,5001341,6396152,254923,0001312,6701,0323,7021041,0001321,4257132,138Total14,6104,84619,456


## 5.1.1. Encoding Method

The encoding method uses the same principle with the differential evolution (DE), which assigns a random number between 0 and 1 for every particle in each particle. Then the random number of each particle is sorted in ascending order. Particles with the lowest random number shall be chosen first. Random numbers of truck types are shown in Table8. Random numbers of the chicken farm are revealed in Table 9 and random numbers of egg farms are revealed in Table 10. After that, the lowest random numbers will be considered first, and then the highest will be chosen last. Then the sequence from the said guidelines shall be decoded.Table 8
Initial particle of the truck type.
ParticleInitial particle of the truck type1234510.36620.03300.86620.53090.430420.37380.26980.54560.93800.434430.62670.62800.50890.09260.375940.60830.74640.06870.87660.5045Table 9
Initial particle of the chicken farm.
ParticleInitial particle of the chicken farm1234510.25970.14710.84200.40440.712420.31840.29530.45260.84810.121330.12320.09950.34690.32180.045640.95810.21220.57130.80340.9386Table 10
Initial particle of the egg farm.
ParticleInitial particle of the egg farm1234510.04720.62640.83700.84890.247920.39400.75090.10760.58240.541730.93130.20530.18510.47470.045640.68330.58250.27440.07460.5546


## 5.1.2. Decoding Method

The decoding method uses the same principle with the differential evolution (DE), where each cycle begins with determining the quantity to be transported by comparing the number of chickens in the first chicken farm with the demand of the first egg farm. If any amount is less, such amount shall be transported. To comply with the constraints of the case study, each egg farm shall receive at least 50 percent according to the chicken demand. However, the egg farms in the last rank may not gain the chickens as they need:(18)A1=QdA,ifQdA≤Qs,Qs,otherwise,where A1 means the quantity to be transported, QdA means the chicken demand (50 percent of the total demand), and Qs means the number of chickens produced by the chicken farms.Then the appropriate truck is chosen by considering its capacity that is greater than the quantity to be transported and must be the truck with the capacity closest to the delivered amount.Once the transportation has been completed, adjustments and validity checks must be recorded to meet the constraints of the case study. If the chicken farm still has chickens left, it will be transported next round until there are no remaining chickens from this farm, and then the next farm will be chosen for further transportation.The decoding process begins with determining the transport quantity and choosing the appropriate truck type to avoid transportation many times, which results in higher production costs. The chicken farm is able to transport all the chickens without remaining. Egg farms also get the chickens at least 50 percent of the demand. The egg farms in the first particle shall receive all the chickens as they need, while the egg farms in the last order may not receive all the chickens as they need. However, chicken transportation in each round must not be over the capacity of each vehicle and must be used not more than the specified usage hours. When decoding the initial particle, the answer is given in Table11.Table 11
The assignment costs from initial particle decoding.
Particle sequencesTransportation costOpportunity costAssignment cost113,5623,84517,407214,6104,84619,456314,0884,81118,899414,9514,15819,109513,4334,15217,585Once the initial particle has been processed (equation (17)), it provides the particle of the truck type according to Table 12, the particle of chicken farms as per Table 13, and the particle of the egg farm as per Table 14. After that, the values obtained shall be arranged in order to be assigned before-after as in Tables 15–17, respectively.Table 12
The particle of the truck type after past the process of particle swarm optimization (PSO).
ParticleThe particle of the truck type1234510.48200.3197−0.25200.19280.412920.57330.85210.31940.53520.626230.39930.49810.57630.43411.740240.2681−0.12150.68090.39330.1290Table 13
The particle of chicken farms after past the process of particle swarm optimization (PSO).
ParticleThe particle of the chicken farm1234510.82330.41770.6567−0.24850.103220.38650.22230.66170.82640.127730.83581.61210.19890.49070.750840.81780.04770.6120−0.5619−0.2719Table 14
The particle of egg farms after past the process of particle swarm optimization (PSO).
ParticleThe particle of the egg farm1234510.66850.85530.57300.80240.419621.26800.73750.92170.68070.33723−0.19300.34550.49811.09051.075440.1991−0.37280.35751.34760.5766Table 15
The particle sequences of the truck type chosen for the assignment.
ParticleThe particle of the truck type12345132112244243323334411421Table 16
The particle sequences of the chicken farm chosen for the assignment.
ParticleThe particle of the chicken farm12345133322212443344134421211Table 17
The particle sequences of the egg farm chosen for the assignment.
ParticleThe particle of the egg farm12345134322243411312234421143The decoding can be conducted by taking the 1st particle of the truck category, the chicken farm, and the egg farm in order to be used to arrange the assignment, which can be put in order as in Table16 and the data in Table 18 are taken for decoding. The assignment of the truck type, suitable for the number of chickens delivered each time, is detailed in Table 19.Table 18
The particle in the first order to be assigned.
ParticleThe particle of the truck typeThe particle of the chicken farmThe particle of the egg farm1333241432414122Table 19
The particle in the first order to be assigned.
No.TruckCycleChicken farmEgg farmTypeSpaceFarmSupplyAssignRemainingFarmDemand (50%)AssignRemaining123,0001310,0005,0005,00035,0005,0000231,500135,0002,5002,50042,5002,5000331,500132,5002,500015,0002,5002,500431,5001110,0002,5007,50012,5002,5000530117,5004,0003,50024,0004,000063500113,5003,500035,0003,5001,50074500145,0001,5003,50031,5001,5000831,500143,5002,5001,00042,5002,5000941,000141,0001,000015,0001,0004,0001030125,0004,0001,00014,0004,00001141,000121,0001,000024,0001,0003,000There are differences in the assignment of chicken farms and egg farms: (1) the chicken farm shall be assigned continuously to run out the chickens and (2) egg farm, where the chicken demand is divided into two equal parts according to the constraint of the case study.In the decoding process, the conditions must be checked, such as the remaining working hours of each type of vehicle and the time spent on each shipment. Each chicken farm is able to send out most of the chickens and egg farms shall get at least 50% of all chickens as their requirement. The assignment for small-size samples, a particular type of truck usage, does not over the specified number of hours. The details are as in Table20. The assignment cost consists of the main cost which is the cost incurred due to transportation, including the distance to transport, fuel consumption rate, and fuel prices. If the transportation capacity is not full, it causes an increase in the opportunity cost. If there is no free space, the opportunity cost shall be 0, as in Table 21.Table 20
Time for assignment (time unit: hours).
No.Truck typeCycleChicken farmEgg farmAssignmentTime to load upTime to bring downTime transportTotal time121235,0000.450.52.14.8231442,5000.1750.21.9384.038331412,5000.1750.2250.7882.988431112,5000.250.2252.054.813531124,0000.40.281.1754.25631133,5000.350.282.1753.9741331,5000.150.1050.2632.4831342,5000.20.1752.3885.463921315,0000.450.452.3885.5631041321,0000.10.12.455.938Table 21
Cost of assignment.
No.TruckCycleChicken farmEgg farmTransportation costOpportunity costTotal costTypeSpace123,0001232,3048643,168231,5001441,2114541,665331,5001418963361,232431,5001111,4445411,9855301121,27501,275635001131,1701461,31674500133576144720831,5001341,6396152,254923,0001312,6701,0323,7021041,0001321,4257132,138Total14,6104,84619,456


## 5.2. Modified Particle Swarm Optimization (Modified PSO)

The update of the particle position has been modified; therefore, we called our modification method as modified PSO. Instead of using formula (17), the following formula is used to update the particles’ position to enhance the search performance of the PSO:(19)Xt+1=Xt+Vt+1,ifrandt≤CR,Rt,otherwise,Particle swarm optimization (PSO) is often trapped on the answer which is the local optimal answer. It may lead to not the most appropriate answer. In order to expand, therefore, the answer is improved and there is no change in the answer after processing 200 iterations, by randomly sampling the number of particles that might change in each particle of the truck types, the number of cycles, chicken farms, and egg farms. Then a new random numberRt is assigned to change the location to find the answer as in equation (19). A constant (CR) has a value between 0 and 1, and then a random number randt is assigned to compare with the CR. If the random value is less than or equal to CR, it shall require to change to the new position as before Xt+Vt+1. However, if the random value is greater than the CR value, the new position shall be assigned to the random value between 0 and 1, and the new number Rt due to the new position needs to be changed for only certain particles, which no need many changes from the existing searches. From the preliminary experiment, we found that the suitable value of CR is 0.8. The procedure of modified PSO is illustrated as a flowchart in Figure 1.Figure 1
Flowchart of modified PSO methodology.Table22 compares the features between modified PSO and DE, and this shows the advantage of the algorithm in this paper. The modified PSO has a lower number of parameters, steps, and processing time used in the process. Moreover, it suites for the complex problem as well.Table 22
Comparison in terms of features of DE and modified PSO.
FeaturesDEModified PSOPrincipleUsing the difference among vectors to expand the searching areaUsing cooperation among particles to find the best area which contained the best solutionNumber of parametersHighLowProcedure4 main steps:3 main steps:(1) Initial population(1) Encoding(2) Mutation(2) Decoding(3) Recombination(3) Modified particle swarm optimization(4) SelectionSuit for complex problemMediumHighProcessing timeLongShort


## 6. Computational Framework and Result

The proposed method is encoded and processed by Visual Studio C# with a mathematical model by Lingo v.11 via Intel Core ™ i5-2450 M CPU 2.50 GHz Ram, 6 GB, compared with solutions provided by Lingo v. 11 software. The particle swarm optimization (PSO) method has been tested with 3 groups of problems (Chicken Farm ×  Egg Farm): small size (5 × 5), medium size (10 × 10), and large size (20 × 20). The problem of the case study is that the sample has been run 5 times, and the optimal result is recorded. The details are shown in Table23.Table 23
Defining the sample sizes.
SampleNumber of the datasetsTruck type (unit: type)Round transportation (unit: round)Chicken farm (unit: farm)Egg farm (unit: farm)Small size124455Medium size12441010Large size12442020The case study1444060The proposed algorithm consists of two methods, i.e., particle swarm optimization (PSO) and modified particle swarm optimization (modified PSO) and the presented problem is compared with the best solution gained from Lingo v.11 (Lingo best solution (LBS)) and the differential evolution algorithm given in [50]. The details are presented in Table 24.Table 24
Explanation of the proposed method.
AlgorithmsDefinition of the proposed algorithmPSOParticle swarm optimizationModified PSOModified particle swarm optimizationLBSLingo v.11 best solution obtained within predefined timeDEDifferential evolution algorithm obtained by Kaewman et al. [50]


### 6.1. Datasets

Datasets consist of 3 groups of problems (Chicken Farm × Egg Farm): small-size groups (5 × 5), medium-size groups (10 × 10), and large-size groups (20 × 20), including the problem of the case study, by using the data from Table23, which are tested and compared with Lingo and DE [50].For small- and medium-sized problems, the stopping criterion of the Lingo program is set to run until finding the optimal solution. The stopping criterion of PSO and modified PSO is set to run for 5 minutes to be fairly compared with DE proposed by Kaewman et al. [50].(20)%gap=SV−SLSV×100%,where SV is the answer obtained from the metaheuristic method and SL is the answer provided by the Lingo program, and the %gap is the percentage difference of answers from both methods.From Table25, it is found that there are some answers equal to the exact method of the Lingo program, which shows that the PSO and modified PSO methods are reliable and can be used for further analysis and the %gap of all 3 methods is close to the answer obtained from the Lingo program.Table 25
Test results of small-size sample groups (5 × 5).
DatasetLBSDE%gapPSO%gapModified PSO%gap19,7239,7230.00%9,7230.00%9,7230.00%28,7538,7530.00%8,7530.00%8,7530.00%35,3305,3300.00%5,3300.00%5,3300.00%47,0567,0590.04%7,0590.04%7,0590.04%57,3177,3170.00%7,3170.00%7,3170.00%66,0986,1070.15%6,1070.15%6,1020.07%77,0047,0040.00%7,0040.00%7,0040.00%87,6497,6490.00%7,6490.00%7,6490.00%97,7617,7610.00%7,7610.00%7,7610.00%107,8947,8940.00%7,8940.00%7,8940.00%117,5667,5750.12%7,5750.12%7,5750.12%127,6837,6830.00%7,6830.00%7,6830.00%Average7,486.177,487.920.03%7,487.920.03%7,487.500.02%The second experiment has been executed with the medium size of test instances. In this dataset, 15 minutes is used to be the stopping criteria of PS and modified PSO which is equal to that of DE proposed by Kaewman [50], and the computational result is presented in Table 26.Table 26
Test results of medium-size sample groups (10 × 10).
DatasetLBSDE%gapPSO%gapModified PSO%gap111,98911,9890.00%11,9890.00%11,9890.00%211,39711,4010.04%11,4010.04%11,4010.04%311,57211,5720.00%11,5740.02%11,5720.00%412,89812,8980.00%12,8980.00%12,8980.00%512,18412,1840.00%12,1840.00%12,1840.00%611,31511,3150.00%11,3150.00%11,311−0.04%714,50814,5080.00%14,5080.00%14,505−0.02%812,61312,6130.00%12,6160.02%12,6130.00%910,90210,9210.17%10,9210.17%10,9210.17%1011,87011,8900.17%11,8930.19%11,8900.17%1115,81715,8490.20%15,8490.20%15,8470.19%1212,11412,1140.00%12,1170.02%12,1140.00%Average12,431.5812,437.830.05%12,438.750.06%12,437.080.04%According to Table26, the experimental results in a medium-size sample found that there is an average of the exact method by using the Lingo program in which the average cost of the assignment is 12,431.58 baht. Whereby, the PSO method gives an answer of 12,438.75 baht and the modified PSO method provides an answer of 12,437.08 baht; the answer is close to the means of the exact method. The %gap of all 3 methods is also similar to the answer obtained from the Lingo program. %gap is calculated using formula (20).The last experiment has been executed with the large size of test instances. In this dataset, the computational time of 30 minutes is used to be the stopping criteria of PS and modified PSO which is equal to that of DE proposed by Kaewman [50]. The results are compared with the best result of optimization software (Lingo v.11) that was found within 72 hours and the result is depicted in Table 27.Table 27
Computational result of large-size sample groups (20 × 20).
DatasetLBSDE%gapPSO%gapModified PSO%gap133,24932,716−1.63%32,716−1.63%32,716−1.63%229,94329,094−2.92%29,121−2.82%29,094−2.92%337,67236,128−4.27%36,146−4.22%36,106−4.34%438,89137,781−2.94%37,781−2.94%37,762−2.99%539,78137,895−4.98%37,898−4.97%37,795−5.25%631,48030,084−4.64%30,084−4.64%30,084−4.64%758,98457,738−2.16%57,718−2.19%57,706−2.21%889,87287,573−2.63%87,586−2.61%87,573−2.63%990,16489,079−1.22%89,104−1.19%89,007−1.30%1035,87834,871−2.89%34,902−2.80%34,812−3.06%1129,09528,049−3.73%28,049−3.73%28,006−3.89%1229,89229,152−2.54%29,198−2.38%29,110−2.69%Case study125,593114,932−9.28%114,968−9.24%114,886−9.32%Average51,576.4649,622.46−3.52%44,191.92−3.49%44,147.58−3.61%Table27, shows the experimental results of the large-sized of problem instances, the best solution obtained from Lingo program using 72 hours computational time is recorded (best solution within 72 hours). The solution of Lingo programm is used to compare with solution obtained from DE, PSO, and Modified PSO. The DE method provided the %gap different from Lingo −3.52%, indicating that the answer was better than Lingo in a limited time. The PSO and modified PSO methods gave the %gap equal to −3.49% and −3.61%, respectively.According to Table28, the statistical test results at a significant level of 0.05 in the large-sized problem groups indicated that the answers of the 3 heuristic methods were not different from the answers obtained from the Lingo program and modified PSO is significantly different from the answer obtained from Lingo and DE method. From the result obtained in Table 28, the best existing heuristics to solve this problem is differential evolution algorithm; it can reduce the total cost by 11.03%.Table 28
Statistical test results of answers in large-sized problem groups.
DEPSOModified PSOLBS0.0210.0220.020DE—0.0210.002PSO——0.001Modified PSO———Table29 compares the average of %gap between modified PSO, PSO, and DE from the literature. The results show that the solutions from modified PSO were better than those obtained by DE and PSO. The modified PSO methods provided the %gap equal to −3.10%. Therefore, the modified PSO method is efficient for the application in solving the assignment problem.Table 29
Computational results of average of %gap the sample sizes.
No.SampleDE (%)PSO (%)Modified PSO (%)1Small size0.030.030.022Medium size0.050.060.043Large size−3.05−3.01−3.134Case study−9.28−9.24−9.32Average (%)−3.06−3.04−3.10


## 6.1. Datasets

Datasets consist of 3 groups of problems (Chicken Farm × Egg Farm): small-size groups (5 × 5), medium-size groups (10 × 10), and large-size groups (20 × 20), including the problem of the case study, by using the data from Table23, which are tested and compared with Lingo and DE [50].For small- and medium-sized problems, the stopping criterion of the Lingo program is set to run until finding the optimal solution. The stopping criterion of PSO and modified PSO is set to run for 5 minutes to be fairly compared with DE proposed by Kaewman et al. [50].(20)%gap=SV−SLSV×100%,where SV is the answer obtained from the metaheuristic method and SL is the answer provided by the Lingo program, and the %gap is the percentage difference of answers from both methods.From Table25, it is found that there are some answers equal to the exact method of the Lingo program, which shows that the PSO and modified PSO methods are reliable and can be used for further analysis and the %gap of all 3 methods is close to the answer obtained from the Lingo program.Table 25
Test results of small-size sample groups (5 × 5).
DatasetLBSDE%gapPSO%gapModified PSO%gap19,7239,7230.00%9,7230.00%9,7230.00%28,7538,7530.00%8,7530.00%8,7530.00%35,3305,3300.00%5,3300.00%5,3300.00%47,0567,0590.04%7,0590.04%7,0590.04%57,3177,3170.00%7,3170.00%7,3170.00%66,0986,1070.15%6,1070.15%6,1020.07%77,0047,0040.00%7,0040.00%7,0040.00%87,6497,6490.00%7,6490.00%7,6490.00%97,7617,7610.00%7,7610.00%7,7610.00%107,8947,8940.00%7,8940.00%7,8940.00%117,5667,5750.12%7,5750.12%7,5750.12%127,6837,6830.00%7,6830.00%7,6830.00%Average7,486.177,487.920.03%7,487.920.03%7,487.500.02%The second experiment has been executed with the medium size of test instances. In this dataset, 15 minutes is used to be the stopping criteria of PS and modified PSO which is equal to that of DE proposed by Kaewman [50], and the computational result is presented in Table 26.Table 26
Test results of medium-size sample groups (10 × 10).
DatasetLBSDE%gapPSO%gapModified PSO%gap111,98911,9890.00%11,9890.00%11,9890.00%211,39711,4010.04%11,4010.04%11,4010.04%311,57211,5720.00%11,5740.02%11,5720.00%412,89812,8980.00%12,8980.00%12,8980.00%512,18412,1840.00%12,1840.00%12,1840.00%611,31511,3150.00%11,3150.00%11,311−0.04%714,50814,5080.00%14,5080.00%14,505−0.02%812,61312,6130.00%12,6160.02%12,6130.00%910,90210,9210.17%10,9210.17%10,9210.17%1011,87011,8900.17%11,8930.19%11,8900.17%1115,81715,8490.20%15,8490.20%15,8470.19%1212,11412,1140.00%12,1170.02%12,1140.00%Average12,431.5812,437.830.05%12,438.750.06%12,437.080.04%According to Table26, the experimental results in a medium-size sample found that there is an average of the exact method by using the Lingo program in which the average cost of the assignment is 12,431.58 baht. Whereby, the PSO method gives an answer of 12,438.75 baht and the modified PSO method provides an answer of 12,437.08 baht; the answer is close to the means of the exact method. The %gap of all 3 methods is also similar to the answer obtained from the Lingo program. %gap is calculated using formula (20).The last experiment has been executed with the large size of test instances. In this dataset, the computational time of 30 minutes is used to be the stopping criteria of PS and modified PSO which is equal to that of DE proposed by Kaewman [50]. The results are compared with the best result of optimization software (Lingo v.11) that was found within 72 hours and the result is depicted in Table 27.Table 27
Computational result of large-size sample groups (20 × 20).
DatasetLBSDE%gapPSO%gapModified PSO%gap133,24932,716−1.63%32,716−1.63%32,716−1.63%229,94329,094−2.92%29,121−2.82%29,094−2.92%337,67236,128−4.27%36,146−4.22%36,106−4.34%438,89137,781−2.94%37,781−2.94%37,762−2.99%539,78137,895−4.98%37,898−4.97%37,795−5.25%631,48030,084−4.64%30,084−4.64%30,084−4.64%758,98457,738−2.16%57,718−2.19%57,706−2.21%889,87287,573−2.63%87,586−2.61%87,573−2.63%990,16489,079−1.22%89,104−1.19%89,007−1.30%1035,87834,871−2.89%34,902−2.80%34,812−3.06%1129,09528,049−3.73%28,049−3.73%28,006−3.89%1229,89229,152−2.54%29,198−2.38%29,110−2.69%Case study125,593114,932−9.28%114,968−9.24%114,886−9.32%Average51,576.4649,622.46−3.52%44,191.92−3.49%44,147.58−3.61%Table27, shows the experimental results of the large-sized of problem instances, the best solution obtained from Lingo program using 72 hours computational time is recorded (best solution within 72 hours). The solution of Lingo programm is used to compare with solution obtained from DE, PSO, and Modified PSO. The DE method provided the %gap different from Lingo −3.52%, indicating that the answer was better than Lingo in a limited time. The PSO and modified PSO methods gave the %gap equal to −3.49% and −3.61%, respectively.According to Table28, the statistical test results at a significant level of 0.05 in the large-sized problem groups indicated that the answers of the 3 heuristic methods were not different from the answers obtained from the Lingo program and modified PSO is significantly different from the answer obtained from Lingo and DE method. From the result obtained in Table 28, the best existing heuristics to solve this problem is differential evolution algorithm; it can reduce the total cost by 11.03%.Table 28
Statistical test results of answers in large-sized problem groups.
DEPSOModified PSOLBS0.0210.0220.020DE—0.0210.002PSO——0.001Modified PSO———Table29 compares the average of %gap between modified PSO, PSO, and DE from the literature. The results show that the solutions from modified PSO were better than those obtained by DE and PSO. The modified PSO methods provided the %gap equal to −3.10%. Therefore, the modified PSO method is efficient for the application in solving the assignment problem.Table 29
Computational results of average of %gap the sample sizes.
No.SampleDE (%)PSO (%)Modified PSO (%)1Small size0.030.030.022Medium size0.050.060.043Large size−3.05−3.01−3.134Case study−9.28−9.24−9.32Average (%)−3.06−3.04−3.10


## 7. Conclusion and Suggestions

The case study problem was the assignment consisting of the main costs incurred from chicken transportation and depended on the difference of truck types using to deliver throughout the road conditions, which affected the fuel costs as well. Besides, the opportunity cost incurred as there was free space on the transporter truck. In which both costs had to be the lowest and the assignment needed to comply with various conditions as specified, making the problem-solving in this case study more complicated.The nature of the multistage assignment problem and various conditions caused a complicated problem. In which problem-solving with the exact method either the branch and bound method or the Lingo program could not be conducted in a short time. Therefore, problem-solving using alternative methods or the heuristics method was the appropriate choice for resolving this problem. The heuristics used in this study would use the particle swarm optimization (PSO) method.The particle swarm optimization (PSO) was the method having a small number of parameters, including a short procedure, which saves time to search for answers, but the appropriate answer was likely to not change to find the answer in other locations. This study added additional steps in order to find answers in other areas which was likely that the answer would be the optimal answer (global optimal). The results showed that the modified particle swarm optimization method provided a better answer than the particle swarm optimization method. This method might be suitable for complicated problems than the exact method of the Lingo program. There were also a small number of procedures and parameters, which make it easier to find the lowest cost as well as the amount of fuel used in operations. From the computational result, we found that modified PSO statistically outperforms the best existing heuristics which is DE proposed by Kaewman [50]. It can find 11.03% lower cost than that the DE. It means the modified PSO that we have been developed generates the same result compared with the optimal solution generated from Lingo v.11 (optimization software) in small and medium size of test problems, and when the problem size increases, the optimization software cannot solve the problem to the optimal solution and modified PSO can still find the good result compared with the lower bound generated from the optimization software and perform better than that the best existing heuristics like DE.Future research should study the problem of more complicated assignments and to comply with the conditions in the real-world (Realistic) or study other metaheuristic methods to solve problems more efficiently, by using hybrid methodologies and developing the exact method to find the answer of the assignment problem. This is another interesting way for further study. The others additional factors should be considered, for instance, the study of capability and performance of each type of vehicle and study of driver skills of driving for each type of road.



---

*Source: 5716985-2020-07-08.xml*