#### 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).

#### 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 (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. 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. 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.

#### 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 (*P*_{best}) and the global best (*G*_{best}) 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 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.

The 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.

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. 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 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). Therefore, 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.

#### 4. Mathematical Model Formulation

Indices = 1, 2, 3, …, (types of trucks from to ) = 1, 2, 3, …, (chicken farms to *J*) = 1, 2, 3, …, (transportation rounds 1 to ) = 1, 2, 3, …, (egg farms to ) Decision variables = 1, chickens are assigned to the truck to ship the chickens from the farm in the round to deliver them to the egg farm = 0, other cases = 1, there is the vehicle type to deliver the chickens from the farm in the round to transport to the egg farm = 0, other cases = the amount of chickens shipped by vehicle to deliver chickens from the farm in the round to the egg ranch Parameters = category of the truck = amount of chicken ranch = amount of rounds of the transportation of the truck = number of egg farms = cost of assigning truck to transport the chickens apart from the farm to the egg farm = cost of transportation on the truck to transport the chickens apart from the farm to the egg farm = the limitation to deliver chickens of the vehicle type = the opportunity cost of inefficient transportation by truck to deliver chickens from the farm to the egg ranch (unit: baht per chicken) = the chicken demand from the egg farm = the capacity to produce chickens from the farm = the time taken to load the chickens up the vehicle from chicken ranch in the round *k* to egg farm *l* = the staff ability of the chicken farm to load up the chickens to the truck = the time taken to bring the chickens down from the truck from chicken ranch *j* in the round *k* at the egg ranch = the staff ability of the egg ranch to bring chickens down from the truck type . = traveling time of vehicle type from the service center to the chicken farm to transport the chicken in the round to the egg ranch = the time taken for transporting the chicken from the service center to the chicken ranch and the time spent to travel from the chicken ranch to the egg ranch = the total operating time of the vehicle type to deliver chicken from ranch in the round to egg farm = the limited predefined working time of truck Objective function: Constraints:

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: is a positive integer and has a value of 0 or 1 only (equation (2)). The amount of chickens to be transported () must be a positive integer (equation (3)). The egg ranch () can only get chickens apart from the chicken farm () by employing the truck () in the round () 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 () might not receive chickens as its demand (equation (5)) and each egg farm () shall get not less than 50 percent of the chickens, according to their requirement (equation (6)). Each chicken ranch () is able to send chickens to all egg farms with no leftover at the farm (equation (7)). If the assignment is not occurred ( = 0), the amount to be delivered must be equal to 0 ( = 0) (equation (8)). The amount to be delivered () 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 . Equation (12) determines the total traveling time of truck to deliver the assigned egg farm. Equations (13) and (14) determine the total time that truck 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 must be executed before round .

#### 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 Sections 5.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 () and the global best (). The relationship can be shown as follows:where is the speed of each particle for traveling to a new position, is the speed of each particle for the existing position, and are random number values between 0 and 1, , , and are the learning coefficient constants, is the existing position, is the new position, is the particle best, and is the global best.

When the particle recognizes the new velocity (), such particle shall change from its existing position () by using the said velocity to the new position (). 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 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. Then the sequence from the said guidelines shall be decoded.

###### 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:where means the quantity to be transported, means the chicken demand (50 percent of the total demand), and *Q*_{s} 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 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 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.

The 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. The assignment of the truck type, suitable for the number of chickens delivered each time, is detailed in Table 19.

There 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 Table 20. 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.

##### 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:

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 number 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 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 . 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 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.

Table 22 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.

#### 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 Table 23.

The 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.

##### 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. 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].where is the answer obtained from the metaheuristic method and is the answer provided by the Lingo program, and the 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 of all 3 methods is close to the answer obtained from the Lingo program.

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.

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. The of all 3 methods is also similar to the answer obtained from the Lingo program. 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, 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 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. 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.

#### 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.

#### Data Availability

The data used to support the findings of this study are included within the article.

#### Conflicts of Interest

The authors declare that there are no conflicts of interest regarding the publication of this paper.

#### Acknowledgments

This paper was supported by KKU-En Grad Camp 2016, Faculty of Engineering, Khon Kaen University, Thailand. This project was funded by the Faculty of Engineering, Khon Kaen University, Thailand.