1. Introduction
Thailand has long been known as a farming country due to the influence of Southeast Asian monsoons, which make the landscape, resources, environment, and climate conducive to agriculture. Most of the population works in agriculture or is involved in it in some manner. Although there have been efforts to develop Thailand into an industrialized country, it still largely depends on agriculture. The evolution and development of Thai agriculture has changed over time, reflecting the worldwide flow of changes. Hens are considered to be economic animals, as farmers can generate revenue from them throughout the year. In Thailand, there is a nationwide demand for eggs, which are popular among consumers. Breeding hens, therefore, are important to the economic balance and well-being of the Thai people. However, the problem that most farmers face is that they have high operating costs and generate little profit, thus they struggle to afford the costs incurred for labor, raw materials, transportation, etc.
In recent years, the logistics cost in Thailand is 14% of gross domestic product (GDP), which is valued at more than 1912.9 million baht. Many Thai businesses face the problem of high logistics cost, especially in agricultural businesses. In this study, we focus on reducing the cost of chicken transportation, which is one of the most important business groups of the Thai agricultural industry. Chicken transportation starts from delivering young chickens to egg farms in many different areas, which affects the resource usage of trucks (road conditions). It is not possible to travel on some Thai roads with some types of trucks, and even with some types of trucks the fuel consumption is different from the average speed limit. A suitable assignment approach needs to be decided on so that the total cost is minimized. Moreover, suitable trucks should be assigned to suitable chicken farms. Suitable farms and trucks means the truck does not have much idle space during delivery. Too much idle space means the use of bigger trucks, and bigger trucks always consume more fuel than smaller trucks because the weight of the truck affects the fuel consumption rate.
In transporting chickens from farmers to buyer farms, a number of factors must be taken into account—such as the mode of transportation, time to transport, temperature, etc.—as well as making sure that chickens from different farms are not mixed during transport. Therefore, it essential to find an appropriate vehicle that meets the needs of chicken farmers to avoid mixing chickens during transport to customers. This would help to minimize assignment or production costs and would be beneficial to the chicken farms, resulting in lower production costs and higher quality chickens for the egg farms. Thus, the overall condition of the chicken industry would be improved. Furthermore, chicken farms and egg farms can use the money saved to accomplish other farm activities, such as feeding, vaccinating, or researching—that is, to further develop their farms.
This study investigated a solution to the problem of chicken transport, which is a problem of multistate assignment. This was a case study regarding appropriate vehicle assignment for the transportation of chickens directly from chicken farms to egg farms by using the lowest cost of assignment. The differential evolution was developed to solve the problem because it is effective and uses short computation time. This paper has four contributions:
- (1)
The special case of the multistage assignment problem is proposed. The attribute that makes it a special case is that the experience of the workers and the type of shipping instrument will be considered in the assignment of trucks to farms. These affect the time to ship chickens in trucks and will affect the total time that chickens can be in the trucks during transport.
- (2)
The idle space in the truck is considered as the objective function and it is converted into lost opportunity due to higher fuel consumption of bigger trucks, therefore using unsuitable trucks will generate more cost.
- (3)
The new decoding method of the DE algorithm is presented so that the proposed problem can be solved.
- (4)
The mathematical model of the proposed problem is presented.
The paper is organized as follows.
Section 2 presents the related research.
Section 3 presents the problem statement and mathematical model.
Section 4 shows the proposed heuristics (differential evolution algorithm). The computational result and a conclusion are presented in
Section 5 and
Section 6, respectively.
2. Literature Review
Assignment problem (AP): The AP evolved from the transportation problem, which is a form of proper task assignment to an employee or machine considering cost effectiveness or profit maximization in some cases. The assignment problem is a type of combinatorial problem. It has been addressed as a transportation problem, where transportation affects other jobs. The aim is to minimize the total cost of transportation. Therefore, this problem could be considered a task assignment problem [
1]. The key condition of this problem is that the assignments must be on a one-on-one basis; that is, once a task has been assigned to an employee, it cannot be assigned to another employee as well.
Previously, task assignment problems were resolved by bipartite matching. This matching method was proposed by Frobenius and Konig [
2,
3]. Later, Dantzig [
4] presented the assignment problem in the form of a linear programming problem and used the simplex method to solve it. However, there might be limitations on the size of the problem, the number of variables, and the number of constraint equations. This means that if the limitations were too great or the computer was not sufficiently capable, the simplex method would not work. Kuhn [
5] subsequently presented a solution to assigning tasks through the Hungarian method, which is a quick way to solve problems compared to simplex.
Generalized assignment problem (GAP): GAP is more flexible than AP. Unlike AP, where assignments are made on a one-on-one basis, with GAP, one task can be assigned to multiple employees or to the same employee. However, it must not exceed the capacity of the employee. Thus, GAP is more comprehensive and more closely resembles the actual situation than AP. GAP was first proposed by Ross and Soland [
6] and was found to be an NP-hard problem [
7]. This is often corrected by the exact method with small problems. The problem of 200 tasks and 20 employees was considered to be the biggest problem that could be solved by the exact method [
8]. Therefore, the heuristics method has been used to solve GAP.
The proposed problem is the multistage GAP. The GAP has no restrictions that the case study has, such as (1) the longest traveling time; (2) the effect of the shipping instrument and the experience of the workers, which affects the operating cost; (3) the idle space in the truck is considered as the objective function; (4) at least half of the demand of the egg farm has to be considered; and (5) the multistage GAP was never found in the literature.
We will move on to review the methodology to solve the special multistage assignment (S-MSA) problem. Many worldwide methods have been used to solve GAP. Both exact methods—such as branch and bound, branch and price, etc.—and heuristics methods have been used to solve the problem. Metaheuristics is one of the most commonly used methods to solve GAP. Metaheuristics is an approximation method where it is not guaranteed that the solution optioned from the method is the optimal solution. The advantage is that it uses much less computation time than the exact method, which makes it possible to solve real-world problems that cannot be solved by exact methods.
The well-known metaheuristics are the krill herd (KH) algorithm [
9,
10,
11], the cuckoo algorithm [
12,
13], the monarch butterfly optimization (MBO) [
14,
15], the hybridizing harmony search [
16], the Lévy-flight krill herd algorithm [
17], the bat algorithm [
18], elephant herding optimization (EHO) [
19], and the earthworm optimization algorithm (EWA) [
20].
Enhancing the quality of the heuristics method can be achieved in many ways, such as adjusting suitable parameters for the proposed method, increasing the search area by introducing ways to move from local optimal, and applying local search to increase the intensive search of the method [
21,
22,
23,
24,
25]. The most recent successful method was proposed by Wang [
26]. The method is called the krill herd (KH) algorithm. Many papers have proposed improving the solution quality of the KH, such as adding new attributes to the algorithm [
22], using a hybrid KH with other methods [
23,
24,
25,
26], exchanging information between top krill during the motion calculation process [
27], using the best parameters [
28], and adding local searches to improve search ability [
29]. Aside from being applicable to many types of problems, KH is valid for function optimization [
30] as well. An excellent review of the KH method has been proposed by Wang et al. [
31].
Metaheuristics has been applied to many combinatorial optimization and real-world problems, such as the parallel hurricane optimization algorithm [
32], firefly-inspired krill herd (FKH) [
33], the moth search (MS) algorithm [
34], monarch butterfly optimization [
35,
36,
37], across neighborhood search (ANS) [
38], chaotic particle-swarm krill herd (CPKH) [
39], chaotic cuckoo search (CCS) [
40], self-adaptive probabilistic neural network [
41], and the differential evolution (DE) algorithm [
42].
Differential evolution is a frequently used heuristics method. It is a way to apply the principles of evolution, and the steps are as follows: (1) initial solution, (2) mutation, (3) recombination, and (4) selection. Differential evolution was first used by Storn and Price [
43] and has since been used since to solve many problems, such as production scheduling [
44] and manufacturing problems [
45]. Liao et al. [
46] proposed two hybrid DEs to obtain truck sequences for cross-docking operations. Later, Liao et al. [
47] proposed six metaheuristic algorithms for sequencing inbound trucks for multi-door cross-docking operations under a fixed schedule of outbound truck departure. Hou [
48] proposed discrete DE (DDE) by modifying a mutation operator for the vehicle routing problem (VRP) with simultaneous pickups and deliveries (VRPPD). Recently, Dechampai et al. [
49] proposed DE to solve the capacitated VRP with the flexibility of mixing pickup and delivery services and maximum duration of a route in the poultry industry. Sethanan and Pitakaso [
50] improved DE by adding two more steps, reincarnation and survival process, to improve its intensification search [
51]. It has been proven that using different pairs of mutation and recombination processes gives different solution qualities, such as in Pitakaso and Sethanan [
50] and Boon et al. [
52]. Sethanan and Pitakaso [
50,
51] suggested that improving the DE algorithm, such as by adding more steps to the original DE, inserting local search, and adding more attributes, can improve the solution quality, but the design of the decoding method must make sure that the most important rules in solution quality are obtained. In this paper, the excellent design of a decoding method from real numbers obtained from the DE mechanism to find the solution of the proposed problem is reported. The decoding method not only makes it possible to obtain the solution, but also local search has been added to the decoding method routine. Therefore, excellent results can be gained from the proposed method.
3. Problem Statement and Mathematical Modeling
This section explains the problem statement and the mathematical model to represent the problem so that the reader has more understanding of the proposed problem.
3.1. Problem Statement
Figure 1 and
Figure 2 represent the unsolved problem and the solved problem, respectively. Chicken farms have different amounts of young chickens. The chicken farms transport the chickens to egg farms, which grow the chickens and collect the eggs to sell to end customers. The egg farms have different capacities and demands for young chickens from chicken farms. The transportation of chickens needs to use trucks. The chicken farms have workers and loading/unloading instruments such as forklifts, carts, etc. This can make for different delivery times for the chicken farm in different types of trucks. When the truck arrives at the egg farm, the egg farm also has instruments for unloading chickens from the truck, which causes different shipping times. The objective function is not only to minimize the total distance of assignment under many constraints, which will be explained later, but also to minimize the idle space of the truck when transporting chickens. The idle space is assumed to be a lost opportunity to use the suitable truck for the suitable route. Moreover, it is possible that some trucks are not used. Therefore, the problem comprises the following components:
- (1)
Assign the right truck to the right egg farm so that free space is minimized. Different farms have different levels of experience with different trucks, which can affect the loading of chickens onto the truck, which can affect the total time that the chickens are in transport.
- (2)
Assign the right egg farm to the right chicken farm to minimize so travel distance. The workers at the chicken farm and the egg farm need to be coordinated so that shipping chickens out on the trucks uses as little time as possible, therefore the quality of the chickens remains unchanged.
The problem is a special case of the multistage assignment problem (S-MAP). The objective function is to minimize total distance and minimize free space in the truck. This objective needs to be optimized while keeping the following limitations or constraints:
- (1)
Transportation of chickens from chicken farms to egg farms is done only by direct transport. There is no chicken picking from other farms and no eggs are sent to other farms. This is because egg farms need to control the quality and breed of the chickens and prevent communicable diseases.
- (2)
A chicken farm can send chickens to an egg farm more than once.
- (3)
A chicken farm can sell all of its chickens.
- (4)
Egg farms may receive chickens from more than one farm, but they may not exceed the capacity of such farms.
- (5)
Egg farms will receive chickens for at least 50% of the demand. However, some egg farms may not be able to do this. Transportation time should not exceed 8 h, which includes the time spent loading the chickens onto the vehicle, transfer, and removal.
- (6)
The vehicles used for transport are sufficient for the needs.
- (7)
Chicken farms may use more than one type of vehicle and each type can be used for more than one round.
There are 40 chicken farms in the case study, and the capacity of a chicken farm is from 5000 to 20,000 chickens per planning period. There are four types of truck available, which have a capacity of 2000 to 12,000 chickens per round of travel. There are 60 egg farms in the system, for which chicken farms need to deliver at least 50% of the demand.
3.2. Mathematical Modelling
The S_MAP can be modeled as follows:
Indices
i = 1, 2, 3, 4 (4 truck types) |
j = 1, 2, 3, …, J (J number of chicken farms; 40 farms) |
k = 1, 2, 3, 4 (4 rounds of transportation) |
l = 1, 2, 3, …, L (L number of egg farms; 60 farms) |
Decision Variables
| Decision variable |
| Truck (i) is assigned to transport chickens from chicken farm (j) on the round of transporting (k) to egg farm (l) |
| Truck (i) is assigned to transport chickens from chicken farm (j) on the round of transporting (k) to egg farm (l) |
| Number of chickens transported by truck (i) from chicken farm (j) on round (k) to egg farm (l) |
Parameters
| Cost of truck type assignment (i) to transport chickens from farm (j) to egg farm (l) |
| Capacity of truck (i) to transport chickens (unit: chicken) |
| Cost of lost opportunity due to truck not completely loaded (i) from chicken farm (j) to egg farm (l) (unit: baht per chicken) |
| Demand for chickens by egg farm (l) |
| Capacity of chicken breeding of farm (j) |
| Time spent loading chickens onto truck (i) at chicken farm (j) |
| Performance of employees at chicken farm (j) to carry chickens into truck (i) |
| Time spent removing chickens from truck (i) at egg farm (l) |
| Performance of employees at egg farm (l) to remove chickens from truck (i) |
| Time spent traveling from the truck station to chicken farm (j) then to egg farm (l), and then from egg farm (l) back to the truck station |
| Time spent for truck (i) to go from the station to chicken farm (j) to convey chickens on round (k) to egg farm (l) |
| Time spent for an assignment of each round, not to exceed 8 h, consisting of the time to load chickens at chicken farm (i) , time to transport from farm (i) to egg farm (l) , and time to remove chickens from the truck at egg farm (l) , or the overall time to use the truck |
| Usage time of truck type |
Remark 1.The time for and does not include the usage time to load and remove chickens from the truck.
Objective Function
This mathematical model was created to solve multistage assignment problems. The objective function aims to investigate how to assign the task in order to gain the lowest cost of the assignment, for which distance is the key factor (part1 of Equation (1)). The cost of opportunity loss is due to the truck not being completely loaded. This means that there is free space on the truck for each round of transporting (part2 of Equation (1)).
The relevant limitations begin from the decision variables , which are the counting numbers and equal to 0 or 1 only (Equation (2)). The number of chickens prepared for transport must be equal in the positive integer only (Equation (3)). Egg farm (i) can receive chickens from farm (j) by using truck (i) for transportation round (k) only one time (Equation (4)). Epidemics may be prevented because chickens are transported from different places, and an egg farm (l) may not receive as many chickens as it needs (Equation (5)). Each egg farm (i) will receive at least 50% of the chickens it needs (Equation (6)). Each chicken farm (j) will be able to deliver all chickens to the egg farm until there are no more chickens at the farm (Equation (7)). If there is no assignment , the number to transport is equivalent to 0 as well (Equation (8)).
The quantity to be transported (q) in each round shall not exceed the capacity of the truck (Equation (9)). The time spent loading chickens onto the truck is represented by Equation (10). The quantity of chickens to be transported (q), the performance of the workers in loading chickens (zup), and the time taken to remove chickens from the truck are represented by Equation (11). The quantity of chickens to be transported (q), the performance of the workers in removing chickens from the truck (zdn), and the time spent on transportation from the station to the chicken farm, and then from the chicken farm to the egg farm, and finally getting back to the station, which does not include time for loading and removing chickens, depends on distance and driving speed (Equation (12)). Equation (13) is the overall time for an assignment. The time spent loading chickens (tup), time spent traveling (ttrans), and time spent removing chickens from the truck (tdn) must not exceed 8 h (Equation (14)). The usage time of each type of truck may not exceed the working hours that have been set (Equation (15)). Equation (16) fixes a round of assignments starting at the first round.
5. Computational Framework and Result
The proposed heuristics were executed and compared with the solution generated by Lingo v.11. We reprogrammed the proposed heuristics in C++ and simulated it on a computer with Intel (R) Core i7-3520M CPU @ 2.90 GHz Ram 8.00 GB. We tested our algorithms with three groups of test instances, small, medium, and large. The simulation was executed five times until the best solution was selected, as shown in the table. Details of the test instances are shown in
Table 16.
From
Table 16, we test our 37 tested instances, composed of 12 small, medium, and large instances and 1 case study. For small and medium test instances, the proposed method was compared with the exact method. The exact method used here is Lingo v.11. For the large instances and the case study, the proposed method was compared with the lower bound generated by Lingo v.11 within 72 h.
The first experiment was executed with the small and medium test instances. The stopping criterion for Lingo v.11 was when it found the optimal solution. The best solution and computation time were collected. The stopping criterion for DE was when it found the optimal solution (the same as Lingo v.11) or when it reached 500 iterations. The results are shown in
Table 17 and
Table 18 for small and medium randomly generated datasets, respectively. The simulation was executed in 12 test instances, each of which had a size of 5 × 5 (number of egg farms × number of chicken farms). The best solutions out of five runs are shown in
Table 17 and
Table 18.
Table 17 shows a small group of problem instances. In one out of five instances, the proposed heuristic could not find the optimal solution. The average gap (%diff.) of DE from the solution generated by Lingo v.11 was 0.03% and it used 10.57 times (9.09/0.86) less computation time. The simulation was executed for 12 test instances, each with a size of 10 × 10 (number of egg farms × number of chicken farms). The best solutions out of five runs are shown in
Table 18.
Table 18 shows a medium-sized test, for which the sample size is 10 × 10. Lingo v.11 took 100.83 s on average to find a 0.05% better solution than DE, but DE used only 1.68 s computation time on average to find that solution.
The next experiment was executed with a large size of test instances. The stopping criterion of Lingo v.11 was 72 h or 4320 min. The best solution found within that time was collected to compare with the result generated by DE. The stopping criterion of DE was set at 1000 iterations. The solution is shown in
Table 19. This group includes the case study (40 × 60).
Table 19 shows a large-scale problem test, for which the sample size was 20 × 20. The result generated by Lingo v.11 within 72 h had an average cost of 51,576.46 baht, while the result generated by DE was 49,622.46 baht, or 4.52% less, using 491 times less computation time. The comparison of Lingo v.11 and DE shown in
Table 17,
Table 18 and
Table 19 was statistically tested using Wilcoxon signed-rank test with 95% confidence interval. The statistical test results are shown in
Table 20.
From
Table 20, we can see that in the small and medium groups, the performance of DE and Lingo v11 was not significant different, and for the large size, DE had significantly lower cost than Lingo v.11.
6. Conclusions and Suggestions
The purpose of resolving the multistage assignment problem is to minimize the cost of assignment. The case study in this research consisted of the main cost of transportation, which relies on the distance to transport as well as the cost of opportunity loss related to truck incapacity.
The resolution started from the development of a mathematical model that consisted of the cost of chicken transportation and opportunity loss. The model had to comply with the conditions as well. Then, the mathematical model was applied to find the best answer using Lingo v.11. Unfortunately, when the problem size is large, Lingo v.11 is not able to solve the problem into optimality, therefore the metaheuristics have to be further developed to get the solution for the case study and the large problem size.
Later, DE was developed to solve the multistage assignment problem, and the results of the efficiency of DE vs. Lingo v.11 were compared. In the case that Lingo v.11 can find the optimal solution, we compared the proposed heuristic (DE) with the optimal solution. The time Lingo v.11 used to find the optimal solution was recorded for all test instances. In this case, DE will use number of iterations (set to 500 from the preliminary test). The computation results show that in small- and medium-sized test instances, DE uses much less computation time than Lingo v.11 while obtaining less than a 1% cost difference (0.03% and 0.05%, respectively) from the optimal solution. In the large-sized problem instances, DE found a 3.52% better solution while using 491 times less computation time than Lingo v.11. Thus, we can see that the performance of DE is better when the problem size is larger. DE obtains better solutions than Lingo v.11 when it uses much more computation time. DE is suitable to solve big problems that an exact method like Lingo v.11 cannot solve.
From the computation results shown in
Table 18,
Table 19 and
Table 20 we can see that when the problem size is small, Lingo v.11 can always find the optimal solution and DE sometimes has worse solution quality than Lingo v.11. This is the weak point of the proposed heuristics: in small- and medium-sized test instances, it cannot find the optimal solution even when we increase the iterations to 1000 or 1500. This means that, in small-sized test instances, DE converts fast and sticks on the local optimal. When there is a large size of test instances, DE can find a better solution than Lingo v.11, because when the problem size is large, it is hard for the exact method to solve to optimality, and when the computation time is set at 72 h, Lingo v.11 is not yet finished with the search while DE, the metaheuristic, can finish the search activity.
Future research should study more complicated assignment problems as well as the current problems or other metaheuristic methods to enhance solutions through hybrid methodologies. Algorithm designers need to add a search mechanism that allows the proposed solution to escape from the local optimal to the general mechanism of DE so that the ability to escape from the local optimal will be increased.