Mathematical Problems in Engineering

Volume 2017, Article ID 4628501, 9 pages

https://doi.org/10.1155/2017/4628501

## Location of Facility Based on Simulated Annealing and “ZKW” Algorithms

^{1}College of Information Science and Technology, Jinan University, Tianhe, Guangzhou 510632, China^{2}Big Data Decision Institute, Jinan University, Tianhe, Guangzhou 510632, China^{3}Institute of Fundamental and Frontier Science, University of Electronic Science and Technology of China, Chengdu 610054, China^{4}School of Computer and Information Science, Southwest University, Chongqing 400715, China

Correspondence should be addressed to Yong Deng; nc.ude.unj@gnedy

Received 13 June 2017; Revised 8 August 2017; Accepted 14 August 2017; Published 28 September 2017

Academic Editor: Erik Cuevas

Copyright © 2017 Yukun Dong et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### Abstract

To cope with the facility location problem, a method based on simulated annealing and “ZKW” algorithm is proposed in this article. The method is applied to some real cases, which aims to deploy video content server at appropriate nodes in an undirected graph to satisfy the requirements of the consumption nodes with the least cost. Simulated annealing can easily find the optimum with less reliance on the initial solution. “ZKW” algorithm can find the shortest path and calculate the least cost from the server node to consumption node quickly. The results of three kinds of cases illustrate the efficiency of our method, which can obtain the optimum within 90 s. A comparison with Dijkstra and Floyd algorithms shows that, by using “ZKW” algorithm, the method can have large iteration with limited time. Therefore, the proposed method is able to solve this video content server location problem.

#### 1. Introduction

Facility location problem, first introduced by Alfred and Friedrich [1], is a classical and well-studied problem. The goal of this problem is to find optimal locations to build facilities so that the solution of the problem can serve the consumers or clients with the least cost. Generally, the facility location problem could be divided into median problem [2, 3], covering problem [4–7], center problem [8–10], multiproduct problem [11, 12], dynamic location problem [13, 14], multiobjective location problem [15–17], competitive problem [18, 19], network reliability problem [20, 21], and network center location problem [22, 23].

All these branches are applied to many fields like fire-fighting units [24], emergency services [16, 25, 26], healthcare location [27], gas marketing hubs [28], factory sites [29], supply chain network [30–32], and so on [33]. Nowadays, with the development of Internet, more and more people surf the Internet to watch videos. And the fluency and quality of a video are vital because they will have a great impact on people’s viewing experience. Although it is quite important to determine how to deploy the server to meet the requirements of consumers for a video service provider, the practical application of the problem is limited.

In this article, a method based on the simulated annealing and “ZKW” algorithms is proposed to deal with an application in such area. Simulated annealing algorithm, developed by Kirkpatrick et al. [34, 35], can efficiently solve the NP problem with the advantages of avoiding falling into local optimum and less reliance on the initial solution; therefore, it is widely applied in many areas, such as image processing [36, 37], vehicle routing [38, 39], production scheduling [40], and machine learning [41]. “ZKW” algorithm, proposed by ZKW [42], is an efficient and fast minimum-cost flow algorithm. We try to use simulated annealing algorithm to search optimum, which is searching some network nodes in the undirected graph to deploy video content server. At the same time, “ZKW” algorithm is used to find the shortest path and calculate the least cost from the video content server to the consumption node. The result of cases given by HUAWEI Code Craft illustrates that the proposed method can efficiently solve the facility location problem and find a good plan with limited time. What is more, a comparison with traditional shortest path algorithms, Dijkstra [43] and Floyd [44] algorithms, shows that, by using “ZKW” algorithm, the running speed is greatly improved.

The paper is organized as follows. Section 2 introduces some basic concepts about the simulated annealing and “ZKW” algorithm. Section 3 is an application in the cases given by HUAWEI Code Craft, which describes the problem and illustrates the specific model of simulated annealing and “ZKW” algorithm, and gives a pseudocode. The result analyses are given in Section 4 to indicate the effectiveness of the method. The conclusions are drawn in Section 5.

#### 2. Preliminaries

In this section, some basic concepts are briefly introduced.

##### 2.1. Simulated Annealing

Simulated annealing (SA), first proposed by Metropolis et al. [45] in 1953 and further developed by Kirkpatrick et al. [34, 35] in 1983, is a stochastic searching optimization algorithm. The algorithm is deprived of the solid-annealing principle. It refers to heating the solid material at an enough high temperature, at which the inner particles of the material will become disordered and the internal energy will increase. Then, bringing down the temperature to decrease defect and reach an equilibrium at each temperature, the system’s energy is minimized [35].

In optimization problem, the simulated annealing algorithm is explained as lowering the temperature of the system until it converges to a feasible and steady solution. During the process, while the temperature is high, accepting a solution that is worse than the current solution will be allowed to ensure the algorithm to jump out of local optimum. In the meantime, a slow decrease in the probability of accepting a worse solution with exploring the solution space is adopted to allow the algorithm to gradually focus on an area to search the optimum solution [35].

Suppose that there is an optimization problem, which is where is an objective function, is a finite solution space, and is the current solution. The solution steps of simulated annealing algorithm (the flow chart is shown in Figure 1) could be depicted as follows: (1)Choose an initial solution at random and select an initial temperature as well as a final temperature .(2)Generate a domain solution , where is the domain structure of ; calculate the increment of the objection function .(3)If , then accept the new solution, , , and turn to the next step. Otherwise, generate a random number . According to the Metropolis criterion, if , accept the new solution, , .(4)If the heat balance (the inner cycle number larger than ) is reached, turn to the next step. Otherwise, go back to the second step.(5)Cool down the temperature , and . If , stop the algorithm. Otherwise, go back to the second step.