Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
The Application of Simulated Annealing for Logistics Amber Amber Laboratory - ADN.cn Introduce myself Name: Hu Nickname: Amber School: Fuzhou No.1 Middle School I had taken part in Nation Olympiad in Informatics. Mathematic modeling In logistics, there are many problems of combination optimization. Their functions are so complex that they are very hard to solve in a expected time. Traveling Salesman Problem (TSP) It’s a typical and useful problem in logistics. The simple description of TSP is that a person wants to find the shortest plan (order) to travel all the n cities. The person visits each city once and only once, and returns to the starting city. Mathematic modeling The mathematical formulation of TSP: Let the distance between two cities, city i and city j be dist(i,j) Statement: In this lecture dist(i,j) is the Euclid distance. Let the plan (order) to travel all n cities be P=p1p2…pn-1pn.There doesn’t exist pi=pj. Let p1=pn+1 for expressing simply. Mathematic modeling The total distance of the plan (order) P is the function - the sum of all distances in plan. n f ( P) dist ( pi , pi 1 ) i 1 The aim of TSP is to get the minimum of this function f(P). Mathematic modeling The right figure shows how to travel all the 30 cities. This solution is not the best solution for this map, namely not the minimum of the function. The rule of nature Consider the rules of nature: Substance always closes to the lowest energy state. For example, consider the configuration of extranuclear electrons. If there are a electron closing to a nude atom, then that electron must be automatically arranged to the lowest energy orbit. Simulated Annealing Notice there exists the similarity between the minimum of the function and the lowest energy state. Can we design an algorithm that can find the minimum automatically as substance closing to the lowest energy state? Simulated Annealing Consider annealing solids When a physical system is at a high temperature, the atoms in the system are in a highly disordered state, and the total energy of the system is also high. Lowering the temperature of the system results in the atoms of the system acquiring a more orderly state, thus reducing the energy of the system. This process of cooling is known as annealing . Simulated Annealing Simulated Annealing (SA) is developed to simulate the behaviour of atoms at lowering temperature. It begins with an initial solution. In simulated annealing, we generate a neighbour solution using an interchange operation. The neighbour is accepted if it is better. It is also accepted with a certain probability if it is worse. The probability of accepting an worse solution decreases as the temperature. SA is terminated if temperature closes to 0 or there is no better solution for certain times. Simulated Annealing Simulated Annealing (SA) Algorithm: 1 Initialization: system’s prime temperature T, initial solution S0, iterating times at each temperature stage L, Termination condition AIM 2 while (true) 2.1 for each k=1..L, do 2.1.1 to 2.1.4 2.1.1 Generate new solution SN from current solution S, get their distinction D. 2.1.2 if (D<0 or satisfy probability exp( D/T)), then S:=SN. 2.1.3 if (current solution S<best solution SB), then SB:=S. 2.1.4 if (T closes to 0 or the iterating times that there exists no new better solution is greater than AIM), then consider S is the best solution and go to 3. 2.2 diminish temperature 2.3 S=SB 3 output the best solution SB Simulated Annealing TSPSA This is the experiment version written by Amber. This program uses Simulated Annealing Algorithm to solve TSP. The left figure of the windows shows the current solution in Annealing every 5 iterations. We can see that the solution is getting better and better. Cooling Schedule SA is controlled by Cooling Schedule. Cooling Schedule contains the prime temperature T, diminished rate k, iterating times at each temperature stage L, termination condition AIM. In order to work best, SA must be under a good combination of Cooling Schedule values which must be determined by large-scale experiment Application SA is not only used in solving TSP. It is the general algorithm for optimization. For example, the post offices setting problem is that to build some post offices in a city, minimizing the total cost of service – the distances between each postman and his client. Thank you. Simulated Annealing For example, to grow a crystal, which is highly ordered, the system needs to be heated to a temperature which allows many atomic rearrangements. Then the system must be carefully cooled, ensuring a thermal equilibrium is reached at each temperature stage, until the system is `frozen' into a good crystal. Simulated Annealing This process of cooling is known as annealing. If the cooling process is performed too quickly, extensive irregularities can be locked into the crystals structure, with the resulting energy level far greater than in a perfect crystal.