All Topics  
Simulated annealing

 

   Email Print
   Bookmark   Link






 

Simulated annealing



 
 
Simulated annealing (SA) is a generic probabilistic metaheuristic
Metaheuristic

A metaheuristic is a heuristic method for solving a very general class of computing problems by combining user-given procedural parameters ? usually heuristics themselves ? in the hope of obtaining a more efficient or more robust procedure....
 for the global optimization
Global optimization

Global optimization is a branch of applied mathematics and numerical analysis that deals with the optimization of a function or a Set of functions to some criteria....
 problem of applied mathematics
Applied mathematics

Applied mathematics is a branch of mathematics that concerns itself with the mathematical techniques typically used in the application of mathematical knowledge to other domains....
, namely locating a good approximation to the global minimum
Global optimum

In mathematics, a global optimum is a selection from a given domain which yields either the highest value or lowest value , when a specific function is applied....
 of a given function
Function (mathematics)

The mathematical concept of a function expresses dependence between two quantities, one of which is known and the other which is produced. A function associates a single output to each input element drawn from a fixed Set , such as the real numbers , although different inputs may have the same output....
 in a large search space
Search space

Search space may refer to one of the following.*In optimization , the domain of the function to be optimized*In search algorithms of computer science, the set of all possible solutions...
. It is often used when the search space is discrete (e.g., all tours that visit a given set of cities). For certain problems, simulated annealing may be more effective than exhaustive enumeration — provided that the goal is merely to find an acceptably good solution in a fixed amount of time, rather than the best possible solution.

The name and inspiration come from annealing
Annealing (metallurgy)

Annealing, in metallurgy and materials science, is a heat treatment wherein a material is altered, causing changes in its properties such as strength and hardness....
 in metallurgy
Metallurgy

Metallurgy is a domain of materials science that studies the physical and chemical behavior of metallic Chemical element, their intermetallics, and their mixtures, which are called alloys....
, a technique involving heating and controlled cooling of a material to increase the size of its crystal
Crystal

A crystal or crystalline solid is a solid material whose constituent atoms, molecules, or ions are arranged in an orderly repeating pattern extending in all three spatial dimensions....
s and reduce their defects
Crystallographic defect

Crystalline solids have a very regular atomic structure: that is, the local positions of atoms with respect to each other are repeated at the atomic scale....
.






Discussion
Ask a question about 'Simulated annealing'
Start a new discussion about 'Simulated annealing'
Answer questions from other users
Full Discussion Forum



Encyclopedia


Simulated annealing (SA) is a generic probabilistic metaheuristic
Metaheuristic

A metaheuristic is a heuristic method for solving a very general class of computing problems by combining user-given procedural parameters ? usually heuristics themselves ? in the hope of obtaining a more efficient or more robust procedure....
 for the global optimization
Global optimization

Global optimization is a branch of applied mathematics and numerical analysis that deals with the optimization of a function or a Set of functions to some criteria....
 problem of applied mathematics
Applied mathematics

Applied mathematics is a branch of mathematics that concerns itself with the mathematical techniques typically used in the application of mathematical knowledge to other domains....
, namely locating a good approximation to the global minimum
Global optimum

In mathematics, a global optimum is a selection from a given domain which yields either the highest value or lowest value , when a specific function is applied....
 of a given function
Function (mathematics)

The mathematical concept of a function expresses dependence between two quantities, one of which is known and the other which is produced. A function associates a single output to each input element drawn from a fixed Set , such as the real numbers , although different inputs may have the same output....
 in a large search space
Search space

Search space may refer to one of the following.*In optimization , the domain of the function to be optimized*In search algorithms of computer science, the set of all possible solutions...
. It is often used when the search space is discrete (e.g., all tours that visit a given set of cities). For certain problems, simulated annealing may be more effective than exhaustive enumeration — provided that the goal is merely to find an acceptably good solution in a fixed amount of time, rather than the best possible solution.

The name and inspiration come from annealing
Annealing (metallurgy)

Annealing, in metallurgy and materials science, is a heat treatment wherein a material is altered, causing changes in its properties such as strength and hardness....
 in metallurgy
Metallurgy

Metallurgy is a domain of materials science that studies the physical and chemical behavior of metallic Chemical element, their intermetallics, and their mixtures, which are called alloys....
, a technique involving heating and controlled cooling of a material to increase the size of its crystal
Crystal

A crystal or crystalline solid is a solid material whose constituent atoms, molecules, or ions are arranged in an orderly repeating pattern extending in all three spatial dimensions....
s and reduce their defects
Crystallographic defect

Crystalline solids have a very regular atomic structure: that is, the local positions of atoms with respect to each other are repeated at the atomic scale....
. The heat causes the atom
Atom

|-! bgcolor=gray | Properties|-||}The atom is a basic unit of matter consisting of a dense, central atomic nucleus surrounded by a electron cloud of electric charge electrons....
s to become unstuck from their initial positions (a local minimum of the internal energy
Internal energy

In thermodynamics, the internal energy of a thermodynamic system, or a physical body with well-defined dimension, denoted by U, or sometimes E, is the total of the kinetic energy due to the motion of molecules and the potential energy associated with the vibrational and electricity energy of atoms within molecules or crysta...
) and wander randomly through states of higher energy; the slow cooling gives them more chances of finding configurations with lower internal energy than the initial one.

By analogy with this physical process, each step of the SA algorithm replaces the current solution by a random "nearby" solution, chosen with a probability that depends on the difference between the corresponding function values and on a global parameter T (called the temperature), that is gradually decreased during the process. The dependency is such that the current solution changes almost randomly when T is large, but increasingly "downhill" as T goes to zero. The allowance for "uphill" moves saves the method from becoming stuck at local minima—which are the bane of greedier
Greedy algorithm

A greedy algorithm is any algorithm that follows the problem solving metaheuristic of making the locally optimal choice at each stagewith the hope of finding the global optimum....
 methods.

The method was independently described by S. Kirkpatrick, C. D. Gelatt and M. P. Vecchi in 1983 , and by V. Cerný in 1985 . The method is an adaptation of the Metropolis-Hastings algorithm
Metropolis-Hastings algorithm

In mathematics and physics, the Metropolis-Hastings algorithm is a method for creating a Markov chain that can be used to generate a sequence of Sample_%28statistics%29 from a probability distribution that is difficult to Sampling from directly....
, a Monte Carlo method
Monte Carlo method

Monte Carlo methods are a class of computational algorithms that rely on repeated random sampling to compute their results. Monte Carlo methods are often used when computer simulation physics and mathematics systems....
 to generate sample states of a thermodynamic system, invented by N. Metropolis
Nicholas Metropolis

Nicholas Constantine Metropolis was a Greek American mathematician, physicist, and computer scientist....
 et al in 1953 .

Overview

In the simulated annealing (SA) method, each point s of the search space is analogous to a state
State (physics)

In physics,the term state is used in several related senses,each expressing something about the way a physical system ontology.#In the sense state of matter, state describes the organization of matter in a phase....
 of some physical system
Physical system

In physics the word system has a technical meaning, namely, it is the portion of the physical universe chosen for analysis. Everything outside the system is known as the environment, which in analysis is ignored except for its effects on the system....
, and the function E(s) to be minimized is analogous to the internal energy
Internal energy

In thermodynamics, the internal energy of a thermodynamic system, or a physical body with well-defined dimension, denoted by U, or sometimes E, is the total of the kinetic energy due to the motion of molecules and the potential energy associated with the vibrational and electricity energy of atoms within molecules or crysta...
 of the system in that state. The goal is to bring the system, from an arbitrary initial state, to a state with the minimum possible energy.

The basic iteration

At each step, the SA heuristic considers some neighbour s' of the current state s, and probabilistically decides between moving the system to state s' or staying in state s. The probabilities are chosen so that the system ultimately tends to move to states of lower energy. Typically this step is repeated until the system reaches a state that is good enough for the application, or until a given computation budget has been exhausted.

The neighbours of a state

The neighbours of each state (the candidate moves) are specified by the user, usually in an application-specific way. For example, in the traveling salesman problem, each state is typically defined as a particular tour (a permutation
Permutation

In several fields of mathematics the term permutation is used with different but closely related meanings. They all relate to the notion of mapping the element s of a set to other elements of the same set, i.e., exchanging elements of a set....
 of the cities to be visited); and one could define the neighbours of a tour as those tours that can be obtained from it by exchanging any pair of consecutive cities.

Acceptance probabilities

The probability of making the transition from the current state to a candidate new state is specified by an acceptance probability function , that depends on the energies and of the two states, and on a global time-varying parameter called the temperature.

One essential requirement for the probability function is that it must be nonzero when , meaning that the system may move to the new state even when it is worse (has a higher energy) than the current one. It is this feature that prevents the method from becoming stuck in a local minimum—a state that is worse than the global minimum, yet better than any of its neighbours.

On the other hand, when goes to zero, the probability must tend to zero if , and to a positive value if . That way, for sufficiently small values of , the system will increasingly favor moves that go "downhill" (to lower energy values), and avoid those that go "uphill". In particular, when becomes 0, the procedure will reduce to the greedy algorithm
Greedy algorithm

A greedy algorithm is any algorithm that follows the problem solving metaheuristic of making the locally optimal choice at each stagewith the hope of finding the global optimum....
—which makes the move only if it goes downhill.

In the original description of SA, the probability was defined as 1 when — i.e., the procedure always moved downhill when it found a way to do so, irrespective of the temperature. Many descriptions and implementations of SA still take this condition as part of the method's definition. However, this condition is not essential for the method to work, and one may argue that it is both counterproductive and contrary to its spirit.

The function is usually chosen so that the probability of accepting a move decreases when the difference increases—that is, small uphill moves are more likely than large ones. However, this requirement is not strictly necessary, provided that the above requirements are met.

Given these properties, the evolution of the state depends crucially on the temperature . Roughly speaking, the evolution of is sensitive to coarser energy variations when is large, and to finer variations when is small.

The annealing schedule

Another essential feature of the SA method is that the temperature is gradually reduced as the simulation proceeds. Initially, is set to a high value (or infinity), and it is decreased at each step according to some annealing schedule—which may be specified by the user, but must end with towards the end of the allotted time budget. In this way, the system is expected to wander initially towards a broad region of the search space containing good solutions, ignoring small features of the energy function; then drift towards low-energy regions that become narrower and narrower; and finally move downhill according to the steepest descent heuristic.










Example illustrating the effect of cooling schedule on the performance of simulated annealing. The problem is to rearrange the pixel
Pixel

In digital imaging, a pixel is the smallest item of information in an image. Pixels are normally arranged in a 2-dimensional grid, and are often represented using dots, squares, or rectangles....
s of an image so as to minimize a certain potential energy
Potential energy

Potential energy can be thought of as energy stored within a physical system. It is called potential energy because it has the potential to be converted into other forms of energy, such as kinetic energy, and to do Mechanical work in the process....
 function, which causes similar colours to attract at short range and repel at slightly larger distance. The elementary moves swap two adjacent pixels. The images were obtained with fast cooling schedule (left) and slow cooling schedule (right), producing results similar to amorphous
Amorphous solid

An amorphous solid is a solid in which there is no long-range order of the positions of the atoms. . Most classes of solid materials can be found or prepared in an amorphous form....
 and crystalline solids, respectively.


It can be shown that for any given finite problem, the probability that the simulated annealing algorithm terminates with the global optimal
Global optimum

In mathematics, a global optimum is a selection from a given domain which yields either the highest value or lowest value , when a specific function is applied....
 solution approaches 1 as the annealing schedule is extended. This theoretical result, however, is not particularly helpful, since the time required to ensure a significant probability of success will usually exceed the time required for a complete search of the solution space.

Pseudocode

The following pseudocode implements the simulated annealing heuristic, as described above, starting from state s0 and continuing to a maximum of kmax steps or until a state with energy emax or less is found. The call neighbour(s) should generate a randomly chosen neighbour of a given state s; the call random should return a random value in the range . The annealing schedule is defined by the call temp(r), which should yield the temperature to use, given the fraction r of the time budget that has been expended so far.

s ? s0; e ? E(s) // Initial state, energy. sb ? s; eb ? e // Initial "best" solution k ? 0// Energy evaluation count. while k < kmax and e > emax // While time remains & not good enough: sn ? neighbour(s) // Pick some neighbour. en ? E(sn) // Compute its energy. if en < eb then // Is this a new best? sb ? sn; eb ? en // Yes, save it. if P(e, en, temp(k/kmax)) > random then // Should we move to it? s ? sn; e ? en // Yes, change state. k ? k + 1 // One more evaluation done return sb // Return the best solution found.

Actually, the "pure" SA algorithm does not keep track of the best solution found so far: it does not use the variables sb and eb, it lacks the first if inside the loop, and, at the end, it returns the current state s instead of sb. While saving the best state is a standard optimization, that can be used in any metaheuristic
Metaheuristic

A metaheuristic is a heuristic method for solving a very general class of computing problems by combining user-given procedural parameters ? usually heuristics themselves ? in the hope of obtaining a more efficient or more robust procedure....
, it breaks the analogy with physical annealing — since a physical system can "store" a single state only.

Saving the best state is not necessarily an improvement, since one may have to specify a smaller kmax in order to compensate for the higher cost per iteration. However, the step sb ? sn happens only on a small fraction of the moves. Therefore, the optimization is usually worthwhile, even when state-copying is an expensive operation.

Selecting the parameters

In order to apply the SA method to a specific problem, one must specify the following parameters: the state space, the energy (goal) function E, the candidate generator procedure neighbour, the acceptance probability function P, and the annealing schedule temp. These choices can have a significant impact on the method's effectiveness. Unfortunately, there are no choices of these parameters that will be good for all problems, and there is no general way to find the best choices for a given problem. The following sections give some general guidelines.

Diameter of the search graph

Simulated annealing may be modeled as a random walk on a search graph
Graph theory

In mathematics and computer science, graph theory is the study of graph : mathematical structures used to model pairwise relations between objects from a certain collection....
, whose vertices are all possible states, and whose edges are the candidate moves. An essential requirement for the neighbour function is that it must provide a sufficiently short path on this graph from the initial state to any state which may be the global optimum. (In other words, the diameter of the search graph must be small.) In the traveling salesman example above, for instance, the search space for cities has
Factorial

In mathematics, the factorial of a negative and non-negative numbers integer n, denoted by n!, is the Product of all positive integers less than or equal to n....
 (2.5 quintillion) states; yet the neighbour generator function that swaps two consecutive cities can get from any state (tour) to any other state in maximum steps.

Transition probabilities

For each edge of the search graph, one defines a transition probability, which is the probability that the SA algorithm will move to state when its current state is . This probability depends on the current temperature as specified by temp, by the order in which the candidate moves are generated by the neighbour function, and by the acceptance probability function P. (Note that the transition probability is not simply , because the candidates are tested serially.)

Acceptance probabilities

The specification of neighbour, P, and temp is partially redundant. In practice, it's common to use the same acceptance function P for many problems, and adjust the other two functions according to the specific problem.

In the formulation of the method by Kirkpatrick et al., the acceptance probability function was defined as 1 if , and otherwise. This formula was superficially justified by analogy with the transitions of a physical system; it corresponds to the Metropolis-Hastings algorithm
Metropolis-Hastings algorithm

In mathematics and physics, the Metropolis-Hastings algorithm is a method for creating a Markov chain that can be used to generate a sequence of Sample_%28statistics%29 from a probability distribution that is difficult to Sampling from directly....
, in the case where the proposal distribution of Metropolis-Hastings is symmetric. However, this acceptance probability is often used for simulated annealing even when the neighbour function, which is analogous to the proposal distribution in Metropolis-Hastings, is not symmetric, or not probabilistic at all. As a result, the transition probabilities of the simulated annealing algorithm do not correspond to the transitions of the analogous physical system, and the long-term distribution of states at a constant temperature need not bear any resemblance to the the thermodynamic equilibrium distribution over states of that physical system, at any temperature. Nevertheless, most descriptions of SA assume the original acceptance function, which is probably hard-coded in many implementations of SA.

Efficient candidate generation

When choosing the candidate generator neighbour, one must consider that after a few iterations of the SA algorithm, the current state is expected to have much lower energy than a random state. Therefore, as a general rule, one should skew the generator towards candidate moves where the energy of the destination state is likely to be similar to that of the current state. This heuristic
Heuristic

Heuristic is an adjective for methods that help in problem solving, in turn leading to learning and discovery. These methods in most cases employ experimentation and trial-and-error techniques....
 (which is the main principle of the Metropolis-Hastings algorithm
Metropolis-Hastings algorithm

In mathematics and physics, the Metropolis-Hastings algorithm is a method for creating a Markov chain that can be used to generate a sequence of Sample_%28statistics%29 from a probability distribution that is difficult to Sampling from directly....
) tends to exclude "very good" candidate moves as well as "very bad" ones; however, the latter are usually much more common than the former, so the heuristic is generally quite effective.

In the traveling salesman problem above, for example, swapping two consecutive cities in a low-energy tour is expected to have a modest effect on its energy (length); whereas swapping two arbitrary cities is far more likely to increase its length than to decrease it. Thus, the consecutive-swap neighbour generator is expected to perform better than the arbitrary-swap one, even though the latter could provide a somewhat shorter path to the optimum (with swaps, instead of ).

A more precise statement of the heuristic is that one should try first candidate states for which is large. For the "standard" acceptance function above, it means that is on the order of or less. Thus, in the traveling salesman example above, one could use a neighbour function that swaps two random cities, where the probability of choosing a city pair vanishes as their distance increases beyond .

Barrier avoidance

When choosing the candidate generator neighbour one must also try to reduce the number of "deep" local minima — states (or sets of connected states) that have much lower energy than all its neighbouring states. Such "closed catchment basins" of the energy function may trap the SA algorithm with high probability (roughly proportional to the number of states in the basin) and for a very long time (roughly exponential on the energy difference between the surrounding states and the bottom of the basin).

As a rule, it is impossible to design a candidate generator that will satisfy this goal and also prioritize candidates with similar energy. On the other hand, one can often vastly improve the efficiency of SA by relatively simple changes to the generator. In the traveling salesman problem, for instance, it is not hard to exhibit two tours , , with nearly equal lengths, such that (0) is optimal, (1) every sequence of city-pair swaps that converts to goes through tours that are much longer than both, and (2) can be transformed into by flipping (reversing the order of) a set of consecutive cities. In this example, and lie in different "deep basins" if the generator performs only random pair-swaps; but they will be in the same basin if the generator performs random segment-flips.

Cooling schedule

The physical analogy that is used to justify SA assumes that the cooling rate is low enough for the probability distribution of the current state to be near thermodynamic equilibrium
Thermodynamic equilibrium

In thermodynamics, a thermodynamics#Thermodynamic system is said to be in thermodynamic equilibrium when it is in thermal equilibrium, mechanical equilibrium, and chemical equilibrium....
 at all times. Unfortunately, the relaxation time—the time one must wait for the equilibrium to be restored after a change in temperature—strongly depends on the "topography" of the energy function and on the current temperature. In the SA algorithm, the relaxation time also depends on the candidate generator, in a very complicated way. Note that all these parameters are usually provided as black box functions
Procedural parameter

In computing, a procedural parameter is a parameter of a subroutine that is itself a procedure.This concept is an extremely powerful and versatile programming tool, because it allows programmers to modify certain steps of a library in arbitrarily complicated ways, without having to understand or modify the code of that procedure....
 to the SA algorithm.

Therefore, in practice the ideal cooling rate cannot be determined beforehand, and should be empirically adjusted for each problem. The variant of SA known as thermodynamic simulated annealing tries to avoid this problem by dispensing with the cooling schedule, and instead automatically adjusting the temperature at each step based on the energy difference between the two states, according to the laws of thermodynamics.

Restarts

Sometimes it is better to move back to a solution that was significantly better rather than always moving from the current state. This is called restarting. To do this we set s and e to sb and eb and perhaps restart the annealing schedule. The decision to restart could be based on a fixed number of steps, or based on the current energy being too high from the best energy so far.

Related methods

  • Quantum annealing
    Quantum annealing

    In mathematics and applications, quantum annealing is a general method for finding the global minimum of a given objective function over a given set of candidate solutions , by a process analogous to quantum fluctuations....
     uses "quantum fluctuations" instead of thermal fluctuations to get through high but thin barriers in the target function.


  • Stochastic tunneling
    Stochastic tunneling

    Stochastic tunneling is an approach to global optimization based on the Monte Carlo method-Sampling of the function to be minimized....
     attempts to overcome the increasing difficulty simulated annealing runs have in escaping from local minima as the temperature decreases, by 'tunneling' through barriers.


  • Tabu search
    Tabu search

    Tabu search is a optimization method, belonging to the class of Local search techniques. Tabu search enhances the performance of a local search method by using memory structures: once a potential solution has been determined, it is marked as "taboo" so that the algorithm does not visit that possibility repeatedly....
     normally moves to neighbouring states of lower energy, but will take uphill moves when it finds itself stuck in a local minimum; and avoids cycles by keeping a "taboo list" of solutions already seen.


  • Stochastic gradient descent
    Stochastic gradient descent

    Stochastic gradient descent is a general optimization algorithm, but is typically used to fit the parameters of a machine learning model .In standard gradient descent, the true gradient is used to update the parameters of the model....
     runs many greedy searches from random initial locations.


  • Genetic algorithms maintain a pool of solutions rather than just one. New candidate solutions are generated not only by "mutation" (as in SA), but also by "combination" of two solutions from the pool. Probabilistic criteria, similar to those used in SA, are used to select the candidates for mutation or combination, and for discarding excess solutions from the pool.


  • Ant colony optimization
    Ant colony optimization

    The ant colony optimization algorithm , is a probability technique for solving computational problems which can be reduced to finding good paths through graph s....
     (ACO) uses many ants (or agents) to traverse the solution space and find locally productive areas.


  • The cross-entropy method
    Cross-entropy method

    The cross-entropy method attributed to Reuven Rubinstein is a general Monte_Carlo_method approach toCombinatorial optimization and Continuous optimization multi-extremal Optimization and importance sampling....
     (CE) generates candidates solutions via a parameterized probability distribution. The parameters are updated via cross-entropy minimization, so as to generate better samples in the next iteration.


  • Harmony search
    Harmony search

    Harmony search is a metaheuristic algorithm mimicking the improvisation process of musicians. In the process, each musician plays a note for finding a best harmony all together....
     mimics musicians in improvisation process where each musician plays a note for finding a best harmony all together.


  • Stochastic optimization
    Stochastic optimization

    Stochastic optimization methods are optimization algorithms which incorporate probability elements, either in the problem data , or in the algorithm itself , or in both ....
     is an umbrella set of methods that includes simulated annealing and numerous other approaches.


See also

  • Adaptive simulated annealing
    Adaptive simulated annealing

    Adaptive simulated annealing is a variant of simulated annealing algorithm in which the algorithm parameters that control temperature schedule and random step selection are automatically adjusted according to algorithm progress....
  • Markov chain
    Markov chain

    In mathematics, a Markov chain, named after Andrey Markov, is a stochastic process with the Markov property. Having the Markov property means that, given the present state, future states are independent of the past states. In other words, the description of the present state fully captures all the information that could influence th...
  • Combinatorial optimization
    Combinatorial optimization

    Combinatorial optimization is a branch of Optimization . Its domain is optimization problems where the set of feasible solutions is Discrete set or can be reduced to a discrete one, and the goal is to find the best possible solution....
  • Automatic label placement
    Automatic label placement

    Automatic label placement refers to the computer methods of placing labels automatically on a map or chart. This is related to the Labeling ....
  • Multidisciplinary optimization
  • Place and route
    Place and route

    Place and Route is a stage in the design of Printed Circuit Boards, Integrated Circuits, and Field programmable gate arrays. As implied by the name, it is composed of two steps, placement and routing ....
  • Traveling salesman problem
  • Reactive search
    Reactive search

    Reactive search is the common name for a family of optimization algorithms based on the Local search techniques. It refers to a class of heuristics that automatically adjust their working parameters during the optimization phase....
  • Graph cuts in computer vision
    Graph cuts in computer vision

    As applied in the field of computer vision, Cut can be employed to Polynomial time solve a wide variety of low-level computer vision problems , such as image smoothing, the stereo correspondence problem, and many other computer vision problems that can be formulated in terms of energy minimization....


External links

Online demonstration. This is a debatable implementation of SA, being more like a hill-climbing algorithm. An open-source C++ framework for simulated annealing and other metaheuristic algorithms. A Java applet that allows you to experiment with simulated annealing. Source code included. An open-source MATLAB program for general simulated annealing exercises. Adaptive Simulated Annealing
Adaptive simulated annealing

Adaptive simulated annealing is a variant of simulated annealing algorithm in which the algorithm parameters that control temperature schedule and random step selection are automatically adjusted according to algorithm progress....
 (ASA) Free C-language simulated annealing code with many tuning options. A Wikiversity project. : SIMPSA (combination of SA and SIMPLEX), SCA, PSO. . It tries to find a maze with the longest path.