Keywords

1 Introduction

Efficient supply chain management has led to increased profit, increased market share, reduced operating cost, and improved customer satisfaction for many businesses [8]. For this purpose, it is getting more and more important in information and communications technologies to solve optimization problem such as the uncapacitated facility location problem (UFLP) which is a combinatorial optimization problem. The objective of the UFLP is to optimize the cost of transport to each customer and the cost associated to facility opening, when the set of potential locations of facilities and the customers are given, whereas UFLP is known to be NP-hard (see [6]). In the context of performing economic activities efficiently, various objects have been considered as facilities, such as manufacturing plants, storage facilities, warehouses, libraries, fire stations, hospitals or wireless service stations. Several techniques have been applied to the UFLP such as the swarm intelligence algorithms or a meta-heuristics algorithm; particle swarm optimization (PSO) [3], ant colony optimization (ACO) [5], artificial bee colony algorithm (ABC) [9], and genetic algorithm [7].

The method of simulating swarm intelligence is inspired by the movement and foraging behavior in herd animals [10]. As typical examples, particle swarm optimization was inspired by the behavior of groups of birds and fish, ant colony optimization was inspired by the foraging behavior of ants. These have been applied to a wide range of computational problems like data mining and image processing [1] in addition to numerous optimization problems like the traveling salesman problem and the flow shop scheduling problem.

Inspired by the foraging behavior of honey bee swarm, D. Karaboga [4] proposed the artificial bee colony (ABC) algorithm, which is an optimization algorithm developed for a function optimization. In the ABC algorithm model, a honey bee swarm consists of three types of bees which carry out different tasks. The first group of bees are called employed bees. They have a potential solution, evaluate its fitness value and keep the better solutions in their memory. The second group of bees are called the onlooker bees. They choose potential solutions on the basis of information provided by the employed bees. If a potential solution has high fitness value, many onlooker bees choose the solution. The third group of bees are called the scout bees. They explore new potential solutions randomly. An employed bee whose potential solution has been abandoned becomes a scout bee. The ABC algorithm is operated in an iterative manner by these three groups of artificial honey bees to search a better solution. The ABC algorithm is applied to many real-world problems, however, its mechanism has not been understood in detail. In this paper we examine the fitness function that is an important piece of the ABC algorithm by implementing several variants and comparing with the original fitness function.

The paper is organized as follows. In Sect. 2 we review the uncapacitated facility location problem and application of the ABC algorithm to the UFLP. In Sect. 3 we show the results of our experiments and we examine the fitness function of the ABC algorithm applied to the UFLP. In the last section, we summarize our findings.

2 Artificial Bee Colony Algorithm for the Uncapacitated Facility Location Problem

2.1 Uncapacitated Facility Location Problem

In the UFLP, a finite set F of facilities can be opened and a finite set D of customers are present. Each facility i in F has a fixed opening cost \(f_{i}\in \mathbb {R}_{+}\), where \(\mathbb {R}_{+}\) stands for the set of positive real numbers. For each pair of i in F and \(j \in D\), a transport cost \(c_{ij}\in \mathbb {R}_{+}\) for serving the customer j from facility i is specified. It is possible to open any number of facilities and to assign each user to any of the facilities opened that will serve for the user. The task of the UFLP is to minimize the sum of the opening costs of the facilities and the transport costs for each customer, that is, to minimize

$$ \sum _{i \in X} f_{i} + \sum _{j \in D} c_{\sigma (j)j} $$

where \(X\subseteq F\) is a subset of facilities to be opened and \(\sigma :D\rightarrow X\) is an assignment of each customer to an appropriate facility.

2.2 Artificial Bee Colony Algorithm

In the UFLP with n potential facilities, that is \(|F| = n\), for each employed bee k is given the open facility vector \(Y_{k}=[y_{k1}, y_{k2}, y_{k3},...,y_{kn}]\) representing a potential solution, where \(y_{ki}=1\) if the i-th facility is open and \(y_{ki}=0\) otherwise.

For the open facility vector \(Y_{k}\) of an employed bee k, X is defined to be the set of facilities i in F such that \(y_{ki} = 1\). Then the allocation \(\sigma : D\rightarrow X\) for \(Y_k\) from each customer in D to an appropriate facility in X is uniquely determined for the transport costs \(c_{ij}\) as follows. For each j in D, \(\sigma (j)\) is defined to be \(i \in X\) so that \(c_{ij}\) is the smallest among \(\{c_{hj}\; |\; h \in X\}\). If there are several such i, we choose one of them randomly. The total cost \(x_{k}\) for each employed bee k is computed as the sum of the fixed cost of opening facility determined by the open facility vector \(Y_{k}\) and the transport cost of each customer to the opened facilities.

Table 1. Open facility vector for an employed bee k

Let us see a concrete example shown in Table 1. In this example, 5 facilities A, B, C, D, E and 4 customers a, b, c, d are given and the open facility vector \(Y_{k}\) for an employed bee k is given as [1, 0, 0, 1, 1]. The total cost \(x_{k}\) for the employed bee k is calculated as follows:

figure a

The fitness value \(fitness(x_{k}) \) of the potential solution of the employed bee k is calculated from its total cost \(x_{k}\) by the formula below that is given in [4].

$$\begin{aligned} fitness(x_{k}) \left\{ \begin{array}{lll} \frac{1}{1+x_{k}} &{} \qquad if &{} \; \quad x_{k} \ge 0 \\ 1+abs(x_{k}) &{} \qquad if &{} \;\quad x_{k} < 0 \end{array} \right. \end{aligned}$$
(1)

where \(abs(x_{k})\) stands for the absolute value of \(x_{k}\). We remark that a larger fitness value is better.

Step 1: Initialization. First, each entry in the open facility vector \(Y_{k}\) of each employed bee k is initialized to either 0 or 1 at random. We compute the fitness value \(fitness(x_{k})\) by the formula (1) for each employed bee k in the population \(B_{1}\) of employed bees. We remark that we do not use the later part \(1+abs(x_{k})\) in the formula (1) because \(x_{k}\) is always a positive number in case of the UFLP.

Step 2: Employed Bee Phase. In each iteration, each employed bee k obtains a new potential solution candidate by manipulating the current potential solution. The open facility vector for k is updated by randomly selecting one facility i in F and switching the bit corresponding to the selected facility (see Fig. 1). If the fitness value of the new open facility vector for k is larger than the fitness value of the previous vector for k, we update the open facility vector for k.

Fig. 1.
figure 1

Update of open facility vector

Step 3: Onlooker Bee Phase. To update onlooker bees, we select stochastically one of the potential solutions, that is, one of the open facility vectors of the employed bees, according to the probability \(p_{k}\) determined by the following formula:

$$\begin{aligned} p_{k} = \frac{fitness(x_{k})}{\sum ^{B_{1}}_{l=1} fitness(x_{l})} \end{aligned}$$
(2)

Note that the selection follows the probability above and so employed bees with larger fitness value have more bigger chance to be chosen. Like the process similar to Step 2, if the open facility vector of the selected employed bee has larger fitness value than the onlooker bee’s current solution, then we replace the potential solution of the onlooker bee with the open facility vector of the selected employed bee. This procedure is repeated for all onlooker bees in the population \(B_{2}\) of the onlooker bees.

Step 4: Scout Bee Phase. For a cut limit c which is determined in advance, if the fitness value of the open facility vector of an employed bee is not improved during c times iteration, then the employed bee is discarded. We harvest the employed bee whose open facility vector was discarded and turn it into a scout bee by giving a new random open facility vector. This operation prevents the search from falling into local optima.

Step 5: Termination Condition of Iteration. The termination condition is determined by the number N of iterations set in advance. When the program reaches N, it outputs the open facility vector whose fitness value is the largest and execution stops.

figure b

3 Experimental Results

We examine the fitness function given by (1) when we implement the ABC algorithm for the UFLP to investigate the adequateness of the fitness function.

The ABC Algorithm was coded in C# language using Visual Studio and run on an Intel Core i3 3.07 GHz Desktop with 2.0 GB memory. We used 12 data sets (cap 71, 72, 73, 74, 101, 102, 103, 104, 131, 132, 133, 134) of benchmark problems from OR-Library [2] compiled by J.E. Beasley. UFLP is called Uncapacitated Warehouse Location Problem in the OR-Library. There are three groups of benchmark problems of size \(m \times n\), where m is the number of customers and n is the number of facilities: \(50\times 16\) (cap 71, 72, 73, 74), \(50 \times 25\) (cap 101, 102, 103, 104), \(50 \times 50\) (cap 131, 132, 133, 134), and the optimal solutions for those instances are known. The performance of our program was evaluated by average relative percent error (ARPE), hit to optimum rate (HR) and average computational processing time (ACPU) that are introduced in [3].

ARPE is the average of the difference from the optimum expressed in percentages, and the lower ARPE shows it produces better solutions. HR represents the number that the algorithm finds the optimal solutions across all repetitions and the higher HR shows better performance. HR takes a value from 0.00 to 1.00 where 1.00 implies that the algorithm finds the optimal solution with probability 1. ACPU represents the time (in seconds) that the algorithm spends to output one solution and the lower ACPU shows better performance.

ARPE is defined by

$$\begin{aligned} ARPE = \sum ^{R}_{i=1} \left( \frac{H_{i}-U}{U} \right) \times \frac{100}{R} \end{aligned}$$
(3)

where \(H_{i}\) denotes the i-th replication solution value, U is the optimal value provided by [2], and R is the number of replications. In Table 2, we summarize the data sets we used for our experiments. It shows the size of data sets and the optimal solutions.

Table 2. Benchmark

3.1 Experiment 1

We conducted an experiment to investigate 5 different candidates for fitness value as follows:

$$\begin{aligned} fitness(x_{k}) = 1 \end{aligned}$$
(4)
$$\begin{aligned} fitness(x_{k}) = \frac{1}{1+x_{k}} \end{aligned}$$
(5)
$$\begin{aligned} fitness(x_{k}) = \frac{1}{1+(x_{k}-x_{*})} \end{aligned}$$
(6)
$$\begin{aligned} fitness(x_{k}) = \frac{1}{1+{(x_{k}-x_{*})}^{2}} \end{aligned}$$
(7)
$$\begin{aligned} fitness(x_{k}) = \frac{1}{1+\sqrt{x_{k}-x_{*}}} \end{aligned}$$
(8)

where \( x _ {*} \) represents the best solution obtained so far. Note that the formula (5) is the original fitness function given in [4].

The results obtained in this experiment are shown in Figs. 2 and 3. For the benchmark problem cap131, we set a population of employed bees \(B_ {1} = 50\), a population of onlooker bees \(B_ {2} = 200\), and the number of repetitions \(N = 100\) and the cut limit c ranges between 5 and 50. The x-axis of the graph represents the cut limit c and the y-axis of the graph represents HR in Fig. 2 and ARPE in Fig. 3, respectively. Comparing the formulas (4) and (5), we found that the two formulas show almost the same results. This implies that the formula (5) does not have a desired property as a fitness function. The formulas (6), (7) and (8) are designed so that the fitness value is affected largely by the value of \(x_k\). If the cut limit c is set small, we obtain better results in the formulas (6), (7) and (8) than the formula (5), on the other hand, the cut limit c gets larger, then the formula (5) gives a better result. This indicates that we can obtain a better result in a shorter computation, although the search may fall in a local optimal.

Table 3. Experimental Results of the proposed fitness value

3.2 Experiment 2

Considering the results of Experiment 1, we propose the following formula for the fitness value:

$$\begin{aligned} fitness(x_{k}) = \frac{1}{Q+(x_{k}-x_{*})} \end{aligned}$$
(9)

where Q is an arbitrary constant, given as a parameter to the algorithm.

Fig. 2.
figure 2

Experiment 1: HR

Fig. 3.
figure 3

Experiment 1: ARPE

Fig. 4.
figure 4

Experiment 2: HR

Fig. 5.
figure 5

Experiment 2: ARPE

Figures 4 and 5 show how the value of cut limit c between 5 and 50 affects HR and ARPE for the benchmark problem cap131 with bee populations \(B_ {1} = 50\), \(B_ {1} = 20\) and the number of iterations \(N = 100\). If \(Q = 10^6\) or \(10^8\), the fitness value of (5) is almost the same as the one for (9). If \(Q = 1\), the fitness value of (9) is almost the same as the one for (6). If \(Q = 10^{4}\), the fitness value of (9) is better than (5). As a result of the experiment, we believe that the ABC algorithm operates more efficiently by the fitness formula (9) with \(Q = 10^{4}\).

Finally, we show the result of performing the proposed fitness value and conventional fitness value for each set of benchmark problems in Table 3, where we set the population of employed bees \(B_ {1} = 50\), the population of the onlooker bees \(B_ {1} = 200\), the cut limit \(c = 20\) and the number of repetitions \(N = 100\).

4 Conclusions

In this paper we discussed the fitness function of the ABC algorithm for the UFLP by carrying out experiments of several variants and comparing with the original fitness function. Our experiment indicates the conventional formula (5) for the fitness value of the ABC algorithm is almost same as the fitness of a constant function given by (4) for the benchmark problems and so it seems inadequate for the UFLP. Therefore, we proposed a new formula (9) which can appropriately weight the fitness value according to problem instances. Using the formula (9) with a smaller value of Q, we can find more open facility vectors whose total costs are low and it makes the search efficient. However, we consider that the algorithm falls in a local optima when we use a too small value of Q and the algorithm does perform adequately. In our experiment, the ABC algorithm with the fitness function (9) with \(Q = 10^4\) performs best and exceeds the original formula (5). The new candidate for the fitness function is worth being applied to other problems, although we do not know how to adjust the value of Q for specific optimization problem. It will be our future research to study how to adjust the value Q for a specific optimization problem such as TSP.