We define the FRP as follow: given a fleet of K trucks located at the Expo to N suppliers. All trucks have the same capacity q. Suppliers i has a supply of gi (for i = 1, …, N), gi < q, and must be serviced within specified time window [ei, li]. That is, a truck has to arrive after ei, but before li. For each truck, we need to find a path that begins at the Expo, visits a subset of suppliers, and then returns to the Expo without violating the capacity constraints and the time window constraints. The dij denotes the distance from supplier i to supplier j. Generally, the transportation costs include fixed costs, such as trucks purchase and depreciation, and variable costs, such as fuel consumption. Variable costs are directly related to traveling distance of the vehicle, while fixed costs are allocated to the trucks also based on its traveling distance. Hence, we consider the objective is to minimize the number of trucks, and the total length of all routes. We denote the position of the Expo as node 0 and suppliers by 1, 2, ..., N,
Truck arrival time at supplier j:
4
tcijk =the transportation cost of vehicle k from customer i to j.
ck = fixed cost of vehicle k.
The objective of the problem is defined as follows:
The objective, equation (3), is to minimize the sum of the number of trucks and the length of all routes. Equation (4) limits the number of trucks dispatched from the Expo must less than the total number of vehicles K. Equation (5) make sure that the flow conservation law holds, that is, each truck goes out from the Expo and needs to returns to it; Equations (6) and (7) ensure that a supplier is served exactly once and also served by only one truck; Equation (8) is the truck capacity constraints and equation (9) is the time window constraints.
5
1.2.1 The KG Algorithm
The solution procedure for the KG algorithm for the FRP described in the previous section is a two-stage process. The first step is to divide all supplier nodes into K clusters by minimizing the number of required trucks. The second step is to determine each route to minimize the total traveling distance of total trucks. The K-means algorithm and the genetic algorithm will serve as the main engine for step 1 and step 2 respectively. The following describes the two algorithms.
1.2.2 K-means Algorithm
The K-means algorithm is a popular clustering algorithm known for its observed speed and its simplicity. The aim of the K-means algorithm is to divide M points in N dimensions into K clusters so that the within-cluster sum of squares is minimized. We consider each cluster does not exceed the capacity of truck and minimum required
6
In above model, the objective function (10) minimizes the within-cluster sum of squares. The flow chart of the K-means algorithm is shown in Fig. 1.The algorithm for the K-means algorithm is listed as follows:
Fig. 1 K-means Algorithm.
Step 1: Randomly assign to the centre of cluster.
In the set of i, we find k subset of data as cluster centres at random. Equation (11), guarantees that each cluster’s supply gi does not exceed the capacity of truck q.
Step 2: Generate the initial cluster.
Calculate each data to a distance between each random centre of cluster. Then,
7
compare the data and determine which one is the closest to the random centre of cluster. This data will be assigned to the closest centre of cluster. Furthermore, it will form a cluster boundary resulting in a collection of the initial members of the cluster.
Step 3: Generate a new centre of mass.
According to each data within the borders, use Equation (12) to recalculate the cluster centre of mass. The previous random cluster is replaced by the new centre of mass to be the centre of the cluster.
Step 4: Change the boundary of cluster.
After assigning the new centre of mass by Equation (13), compare the distance between each data to the new centre of cluster. According to the distance, reallocate each data which belongs to the cluster. Repeat step 3 and step 4 until cluster members do not change, or exceed the capacity constraint.
Therefore, we have the outcome of K-means algorithm as clusters of suppliers and the minimum required number of trucks.
1.2.3 Genetic Algorithm
The GA is a randomized search technique and an adaptive heuristic search method based on population genetics. The search is guided by the fitness value of each individual. A GA process can be summarized as follows:
Step 1: Representation.
Encode the characteristics of each individual in the initial population as a chromosome. Typically, a chromosome is a bit string. Set the current population to this initial population. In our problem, the chromosome is the order of the sequence visited by trucks.
Step 2: Reproduction.
Select two parent chromosomes from the current population. The selection process is stochastic, and a chromosome with high fitness is more likely to be selected.
8
Step 3: Crossover.
Generate two offspring from the two parents by exchanging pieces of genetic material.
Step 4: Mutation.
Apply a random mutation to each offspring with a small probability.
Repeat steps (2), (3), and (4), until the number of chromosomes in the new population is the same as in the old population. Moreover, set the current population to the new population of chromosomes. This procedure is repeated for a fixed number of generations, or until convergence to a population of similar individuals is obtained. Then, the best chromosome generated during the search is decoded into the corresponding individual. The fitness function in the genetic algorithm is used to evaluate the performance of a chromosome which is the optimality of a set of decision variable values. That is, the fitness function of the GA is set as the objective function in our problem.