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

'is research aims at solving the special case of multistate assignment problem.'e problem includes many special characteristics which are not normally included in the assignment problem. 'ere 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.'e proposed problem is determined as a large and complicated problemmaking the optimization software unable to find an optimal solution within the proper time.'erefore, 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. 'is method is called the modified particle swarm optimization (modified PSO). 'e proposed method was tested with three groups of tested instances, i.e., small, medium, and large groups. 'e 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).


Introduction
e egg is very important to the ai 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, ai 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.
is 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. e mathematical models for the multistage assignment problem were developed which are suitable for the case study. en, 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. ese factors may affect the quality of the chicken. erefore, 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. e 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 ailand. 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]. erefore, 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 (N 2 O), carbon dioxides (CO 2 ), 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. en, 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. erefore, this research had limitations closer to real-life working. e 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. e contributions of this paper are as follows: (1) is research combines environmental care in the assignment problem by considering road categories that impact fuel consumption. is has been a new feature for this kind of problem. (2) e proposed method is a modified metaheuristic method which was developed for solving only this problem. (3) e case study, which is a real-world problem, occurred in ailand. is 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.
is research consisted of the following structures. Section 2 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.

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. erefore, 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. e 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]. e 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. erefore, 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. e 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][20][21][22][23][24][25][26][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 (P best ) and the global best (G best ) to search for the best food resources. is is the work to benefit the herd mainly. e 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]. e 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]. e 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.
ere 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][40][41], green-VRP (G-VRP) [42], and the green-VRP pickup and delivery problem [43].
ere 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][45][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. erefore, 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. e highest possible profit will be achieved when all the needs are fulfilled. e 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. e 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. erefore, the particle swarm optimization (PSO) has been presented to execute the problems in this research.
Mathematical Problems in Engineering 3

Problem Statement
e 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. ere 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.
e 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. e 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) e egg ranch may obtain chickens from many different farms, but must not over the capabilities of such a farm. is 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. erefore, 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. e 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.
e chicken farm consists of 40 farms, and all are capable of producing chickens differently, as shown in Table 1. 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.
Egg 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 Table 3.
e 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.
e speed varies according to road conditions. For example, the main roads connecting the province are usually large with 4-6 traffic lanes. e vehicles can speed up than the roads with narrower lanes. e 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.
In 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. erefore, 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.
e road types among 6 farms are specified in Table 5 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). erefore, the fuel consumption on this route is 23 × 0.098 � 2.254 liters, as shown in Table 7.
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.

Mathematical Model Formulation
Indices i � 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 variables x ijkl � 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 cases y ijkl � 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 cases q ijkl � the amount of chickens shipped by vehicle i to deliver chickens from the farm j in the round k to the egg ranch l Parameters I � category of the truck J � amount of chicken ranch K � amount of rounds of the transportation of the truck L � number of egg farms c ijl � cost of assigning truck i to transport the chickens apart from the farm j to the egg farm l e ijl � cost of transportation on the truck i to transport the chickens apart from the farm j to the egg farm l    -  t i � the limitation to deliver chickens of the vehicle type i O ijl � 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) d l � the chicken demand from the egg farm l s j � the capacity to produce chickens from the farm j t 1 jikl � the time taken to load the chickens up the vehicle i from chicken ranch j in the round k to egg farm l p 1 ji � the staff ability of the chicken farm j to load up the chickens to the truck i t 2 ijkl � the time taken to bring the chickens down from the truck i from chicken ranch j in the round k at the egg ranch l p 2 li � the staff ability of the egg ranch l to bring chickens down from the truck type i. t 3 ijkl � 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 l t d lj � 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 l t 4 ijkl � the total operating time of the vehicle type i to deliver chicken from ranch j in the round k to egg farm l t 5 i � the limited predefined working time of truck i Objective function: Constraints: is mathematical model was formulated to execute the multistage assignment problem. e 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: X ijkl is a positive integer and has a value of 0 or 1 only (equation (2)). e amount of chickens to be transported (q ijkl ) must be a positive integer (equation (3)). e 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 (X ijkl � 0), the amount to be delivered must be equal to 0 (q ijkl � 0) (equation (8)). e amount to be delivered (q) in each cycle must not be over the capacity of the vehicle (equation (9)). e 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.

Methodology
e 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. erefore, the author has applied and developed particle swarm optimization (PSO) and modified particle swarm optimization (modified PSO) in Sections 5.1 and 5.2, respectively.

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. e direction and velocity for the next position are known by considering the former direction and speed from the particle best (P best ) and the global best (G best ). e relationship can be shown as follows: where V t+1 is the speed of each particle for traveling to a new position, V t is the speed of each particle for the existing position, r 1 and r 2 are random number values between 0 and 1, c 0 , c 1 , and c 2 are the learning coefficient constants, X t is the existing position, X t+1 is the new position, P best is the particle best, and G best is the global best. When the particle recognizes the new velocity (V t+1 ), such particle shall change from its existing position (X t ) by using the said velocity to the new position (X t+1 ). When each particle changes from its existing position to the new position, it must use its particle best and global best (equation (17)). erefore, 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.

Encoding Method.
e 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. en 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 Table 8. 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. en the sequence from the said guidelines shall be decoded.

Decoding
Method. e 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: where A 1 means the quantity to be transported, Q A d means the chicken demand (50 percent of the total demand), and Q s means the number of chickens produced by the chicken farms. en 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. e 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. e chicken farm is able to transport all the chickens without remaining. Egg farms also get the chickens at least 50 percent of the demand. e 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 Table 11.
Once 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   Mathematical Problems in Engineering 7 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. e 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 Table 16 and the data in Table 18 are taken for decoding. e assignment of the truck type, suitable for the number of chickens delivered each time, is detailed in Table 19.
ere 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. e assignment for small-size samples, a particular type of truck usage, does not over the specified number of hours. e details are as in Table 20. e 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 13: e particle of chicken farms after past the process of particle swarm optimization (PSO).  Table 14: e particle of egg farms after past the process of particle swarm optimization (PSO).   Particle  e particle of the truck type  1  2  3  4  5  1  3  2  1  1  2  2  4  4  2  4  3  3  2  3  3  3  4  4 1 1 4 2 1   1  2  3  4  5  1  3  4  3  2  2  2  4  3  4  1  1  3  1  2  2  3  4  4 2 1 1 4 3 Table 18: e particle in the first order to be assigned.
Particle e particle of the truck type e particle of the chicken farm e particle of  the egg farm  1  3  3  3  2  4  1  4  3  2  4  1  4  1  2  2   8 Mathematical Problems in Engineering

Modified Particle Swarm Optimization (Modified PSO)
. e 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: 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. en a new random number (R t ) 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 (rand t ) 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 (X t + V t+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 (R t ) 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. e procedure of modified PSO is illustrated as a flowchart in Figure 1. Table 22 compares the features between modified PSO and DE, and this shows the advantage of the algorithm in this paper.
e 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.

Computational Framework and Result
e 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. e 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). e problem of the case study is that the sample has been run 5 times, and the optimal result is recorded. e details are shown in Table 23.
e 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]. e details are presented in Table 24.
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 Table 23, 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. e 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].
where S V is the answer obtained from the metaheuristic method and S L is the answer provided by the Lingo program, and the %gap is the percentage difference of answers from both methods. From Table 25, 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.
e 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.
According to Table 26, 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. e %gap of all 3 methods is also similar to the answer obtained from the Lingo program. %gap is calculated using formula (20). e 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]. e 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, shows the experimental results of the largesized of problem instances, the best solution obtained from Lingo program using 72 hours computational time is recorded (best solution within 72 hours). e solution of Lingo programm is used to compare with solution obtained from DE, PSO, and Modified PSO. e DE method provided the %gap different from Lingo −3.52%, indicating that the answer was better than Lingo in a limited time. e Initialize P best and G best Decoding method by using equation 17 and equation 18.  PSO and modified PSO methods gave the %gap equal to −3.49% and −3.61%, respectively. According to Table 28, 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 29 compares the average of %gap between modified PSO, PSO, and DE from the literature. e results show that the solutions from modified PSO were better than those obtained by DE and PSO. e modified PSO methods provided the %gap equal to −3.10%. erefore, the modified PSO method is efficient for the application in solving the assignment problem.

Conclusion and Suggestions
e 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. e 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. erefore, problem-solving using alternative methods or the heuristics method was the appropriate choice for resolving this problem. e heuristics used in this study would use the particle swarm optimization (PSO) method. e 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. is 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). e results showed that the modified particle swarm optimization method provided a better answer than the particle swarm optimization method.
is method might be suitable for complicated problems than the exact method of the Lingo program. ere 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. is is another interesting way for further study. e 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.

Data Availability
e data used to support the findings of this study are included within the article.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.