Keywords

1 Introduction

Many problems in engineering, planning, manufacturing and distribution, can be modeled as minimizing or maximizing a function. This class of so-called optimization, are often identified the daily life of organizations and involve different interrelated variables in a single problem, with several scenarios for analysis and decision-making. The difficulty is to find among all the solutions, the global optimal solution that meets all the criteria involved [1].

Operational Research is an area of interdisciplinary knowledge that brings together algorithms and techniques used to solve real problems for effective decision-making. One form of resolution that encompasses this field of study is the mathematical programming, which allows you to examine numerous feasible configurations of the problem in question e and offer the best solution, respecting a set of restrictions. These techniques are in view of their great utility in solving combinatorial optimization problems; among which we can mention: Problems of Flow in Networks and Logistics of Distribution; the Problem of the Traveling Clerk, the Problem of the Backpack, the Transport Problem, and the Allocation Problem, among others [2].

The Problem of the Traveling Salesman – TSP, consists of visiting a finite set of cities, in such a way that starts and ends the route in the same city, going through the others only once at the lowest possible cost [2]. The TSP has wide applicability in the real world, is easy to understand and descriptive, but classified as NP-Hard [3], because the solution space grows exponentially with the dimensions of the problem. Instances connected to n cities have (n − 1)! possible routes and n mathematical operations are processed for each route. Therefore, strategies that use metaheuristics are showing increasingly promising results, without the need to allocate large computational resources. Each metaheuristic has a search strategy, but the common goal is to escape the local minimums, in order to advance exploration in the space of search for even better solutions [4].

Simulated Annealing, is a metaheuristic based on the analogy with the physical process of annealing certain materials (annealing) initially proposed by [5], and [6] suggested its use in the computational environment, the method presents as a criterion of convergence thermodynamic principles. Atomic structures are formed as a function of the heating process, followed by the cooling of the materials. With a slow and gradual decrease in temperature, each setting has an energy level. The process terminates when the solidification point is reached, exhibiting a minimal energy configuration. The process is terminated when the solidification point is reached, with a minimum energy setting.

For mathematical modeling, we have: the state of the thermodynamic system corresponding to the current solution of the combinatorial problem; an energy equilibrium equation for the thermodynamic system represents a goal of purpose; states of the physical system are equivalent to solutions of the search space; a disturbance of a physical state relates to a selection of a nearby solution in the search space; A fast cooling of the physical system is a good location and the fundamental state of a particle system is a global problem of a combinatorial problem [6].

Currently, a large percentage of costs for companies is in the distribution of products through logistics; organizations seek processes to optimize distribution and. This research presents a problem extracted from the routine of a dairy distribution company, which consists in delivering products daily in a set of cities, departing and closing the route in the city of origin, in such a way as to minimize the cost of the trip. The objective function minimizes the cost of travel in terms of both distance and time, since deliveries are carried out on refrigerated trucks. This type of Vehicle Routing Problem (VRP) is a generalization of TSP. The Fig. 1 illustrates the complexity of the problem, locating all cities on the map. The city of origin and destination is Angicos, identified with the location symbol and the letter “A”; the others are with the location point, of the State of Rio Grande do Norte, in Brazil.

Fig. 1.
figure 1

Map showing the location of the problem [7].

The Association of Small Farmers of the backwoods of Angicos (APASA) delivers products daily in a set of cities in the state of Rio Grande do Norte. The problem is to determine the best route for product distribution across a set of n cities to minimize costs, whether using the shortest route or the route that totals the shortest travel time.

Related works address the same PCV, [8] proposed the use of a traditional genetic algorithm (AGT) to find solutions that approximate the optimal results obtained in [9] via the exact method, and [7], presented a hybrid evolutionary algorithm, the memetic algorithm (AM) that uses GA in the traditional form, except for the genetic operator rate, which includes the mutation in its operation and receives a single value for crossover and mutation execution, and local search operator execution.

In this context, this paper presents an approximate metaheuristic, called Simulated Annealing, to verify the applicability of the algorithm and validate its efficiency through previous studies cited. In its research, [9] finds that the company operates in twelve cities, including the distribution center and the consumption centers. For simulation purposes, the number of cities has been increased by [7], and will be provided by the same distribution center.

2 Objectives

The objectives of this work are: to implement the Simulated Annealing algorithm adapted to the distribution problem in a dairy distribution company; validate the efficiency of the proposed method, considering the computational performance of each execution and the quality of the solutions found in each iteration; to analyze the results obtained, which will be compared with the results of the Memetic Algorithm and the Exact Method, developed by [7] and [9].

3 Method

The computational experiments were performed considering a single route to: 48, 36, 24, 12, 7 and 6 cities, represented by n. As a minimization parameter: the distance traveled (Km) and the time spent (min), totaling the simulation of 12 problems. The algorithm proposed in this work was executed for all instances presented and previously modeled using the Scilab platform, version 6.0 and running on a Dell PowerEdge T130 Server, with Intel® Xeon® Processor Quad Core E3-1220 v6, 8 GB RAM and HD of 1 TB. The operating system is Ubuntu 18.04.1 LTS. The parameters were adjusted according to [6] and are divided into: initial temperature, which determines the amount of processing time (IT) with value 100, the minimum temperature to be used as the stopping criterion of the algorithm (FT), with a value of 0.01; the rate of reduction of temperature (α), with value 0.98; and number of steps at each temperature (NST), with value 5. Moreover, the algorithm was run 100 times. A flowchart to represent the proposed algorithm is presented in Fig. 2 and described below.

Fig. 2.
figure 2

Flowchart of the algorithm adapted to the SA. (Own authorship)

The algorithm receives as input parameters an instance of the problem, the number of solutions and the parameters of the cooling program. In this work, the initial solution is randomly generated, taking into account TSP constraints that is, not allowing the repetition of the same city. The initial solution is represented by S. After generating the set of solutions, the algorithm calculates the cost of each solution.

Subsequently, a Local Search Shift procedure is started in the solution space. The neighbor solution is represented by \( S^{\prime} \). The next step of the algorithm is to check the quality of the new solution in relation to the current solution, based on the objective function. If \( F\left( {s^{\prime}} \right) < F(s) \), \( {\text{S}^{\prime}}\) is accepted as the current solution, if \( F\left( {s^{\prime}} \right) > F(s) \), the probabilistic factor and the acceptance test, will determine whether the neighbor solution will be accepted as the current solution. This choice for a possible worst solution is the mechanism used by SA as an attempt to escape from great locations. The iterations occur until an equilibrium situation is observed. IT indicates the initial temperature e CT, the current temperature. While CT > FT, a loop of repetition is performed, having as temperature change as a decrease in temperature α, and as a stop condition the parameter that establishes the minimum temperature FT. The repetition loop Iterations have the established NST parameter as the stop condition and determine the number of iterations at each temperature. Finally, the algorithm returns as output, the distance or time of the best route. It is important to highlight that Algorithm is aimed at solving a minimization problem.

4 Results

The computational results are presented in the following tables, with the individual and comparative analysis of the proposed metaheuristics. Table 1 shows the best SA results compared to those obtained by the Memetic Algorithm and by the Exact Method. For each problem, two columns are presented, in this order: the best solution found (Min) and the time spent by the algorithm, in seconds (T(s).

Table 1. SA versus AM versus exact. (Own authorship)

In most of the problems, the SA obtained the approximation of the global optimum, with the exception of problems 7 to 12, where the exact solution returned. In general, the SA obtained results within the expected if we consider the values of the minimum solutions found and the execution time for problems with the larger number of cities.

The Table 2 presents some experiments performed with the SA, changing the parameter Ti (initial temperature) from 100 to 500 and also the size of the solution space (number of executions of the algorithm).* The solver did not find the optimal solution for this problems due to memory limit.

Table 2. IT = 100 versus IT = 500. (Own authorship)

According to [6], the quality of the solution obtained by the SA depends mainly on the initial temperature. A very high temperature, associated with a very slow cooling scheme, can lead to excellent solutions however, with very high processing time. Moreover, a low temperature tends to consume less processing time; however, it can generate rather poor solutions.

5 Conclusion

The Traveling Salesman Problem (TSP) is a classic problem and with several works that use it as a basis for studies and solving similar problems that deal with combinatorial optimization. Its variants are present in numerous practical applications. In this perspective, the demand for elaboration, modeling, implementations, and validation of methods for its resolution appears. With the comparative analysis, Simulated Annealing is a method of obtaining good solutions to difficult optimization problems. An observed characteristic is that the algorithm presented sensitivity in relation to the adjustment of parameters, which justifies the accomplishment of more tests of refinement and improvement of the strategy, in order to make it competitive.

The objectives of the work were achieved, the implementation of the metaheuristic adapted to the TSP can contribute to the problem reported in the case study, finding globally optimal solutions in some cases and close to optimal solutions in others, with viable execution times. A characteristic observed with respect to the comparison between the results, shows that the convergence to a globally optimal solution has some dependence on the parameters adjustments and, consequently, it determines the capacity of exploration of minimum solutions, that is, the algorithms present greater sensitivity in relation settings. For the problem in question, it has been exemplified that the initial temperature parameter is, by itself, an experiment object to choose the best initial configuration.

Metaheuristics have a strong characterization of the various possibilities and the flexibility of being developed and improved. Therefore, we suggest as future work, to implement new strategies for the generation of the initial solution, the neighborhood search and the adaptation of all parameters established to execute the algorithm, in order to verify the efficiency and, therefore, the competitiveness of the method. One can combine the strategy of more than one metaheuristic or hybridize an approximate model with an exact one.