Discussion on optimal solution algorithm

Source: Internet
Author: User


People who do not know how to optimize want to have a common way to solve his problems, but unfortunately there is no such method exists, fast methods require certain conditions, such as the common strong convex, linear, can be decomposed what. At present, the research is more mature is the strong convex light source can be decomposed

Non-convex no particularly effective method to solve, if it is strong convex, why use so complex method to find the best solution? It is because it is not a strong convex that the optimization method is used. Even if the convex, also divided into several different situations, only with a ladder degree, to achieve the convergence rate of Newton gradient method, in the convex problem, there are non-smooth functions, is also a bad solution.

The dynamic programming in algorithmic theory, greedy algorithm and so on are the basic theories. In practice, it is often necessary to combine with the computational method. The following are the best solution algorithms that can be implemented directly by means of tools.


Mountain Climbing algorithm: Mountain climbing algorithm is a simple greedy search algorithm, is an improvement of depth first search, using feedback information to help generate solution decision, belongs to the artificial intelligence algorithm.

The heuristic method is used to select an optimal solution from the adjacent solution space of the current solution and replace it with the current solution until a local optimal solution is reached.

Disadvantage: The result may not be optimal because it is not a full search.

The following problems are commonly found in mountain climbing algorithms:

1), local maximum: A node is higher than any neighbor, but it is not the highest point of the whole problem.

2), Highland: Also known as flat-topped, once the search reaches the Highlands, it is impossible to determine the best direction of the search, will generate random movement, resulting in reduced search efficiency.

3), Ridge: The search may be on both sides of the ridge and back concussion, the pace is very small.

Algorithm process: Starts with the current node and compares the values of the surrounding neighbor nodes. If the current node is the largest, then the current node is returned as the maximum value (both peak peaks), and instead the current node is replaced with the highest neighbor node, thus achieving the goal of climbing up to the top of the mountain. This loops until the highest point is reached.

Advantages: Avoid traversal, select some nodes by inspiration, so as to achieve the purpose of improving efficiency.

The implementation of mountain climbing algorithm is very simple, its main disadvantage is that it will fall into local optimal solution, but not necessarily can search the global optimal solution. 1: Assuming that the C point is the current solution, the local optimal solution of the mountain climbing algorithm searching for point A will stop the search, because at a point no matter in the direction of the small amount of movement can not get a better solution.


Simulated annealing algorithm:

Simulated annealing is actually a greedy algorithm, but its search process introduces random factors. The simulated annealing algorithm takes a certain probability to accept a solution that is worse than the current solution, so it is possible to jump out of the local optimal solution to achieve the global optimal solution. Taking Figure 1 as an example, the simulated annealing algorithm will accept the move of E in a certain probability after searching for the local optimal solution A. Maybe after a few times this is not the local optimal move will reach D point, then jumped out of the local maximum of a.

The simulated annealing algorithm describes:

If J (Y (i+1)) >= J (Y (i)) (that is, a better solution is obtained after moving), the movement is always accepted

If J (Y (i+1)) < J (Y (i)) (that is, the solution after the move is less than the current solution), the move is accepted at a certain probability, and the probability decreases gradually over time (decreasing gradually to stabilize)

The calculation of "certain probability" here refers to the annealing process of metal smelting, which is the origin of the name of the simulated annealing algorithm.

According to the thermodynamic principle, when the temperature is T, there is a probability that the energy difference for the de's cooling is P (DE), expressed as:

P (DE) =exp (de/(KT))

where k is a constant, exp represents a natural exponent, and de<0. The formula is plainly: the higher the temperature, the greater the probability that the energy difference will reduce the cooling of the de, and the lower the temperature, the less the probability of cooling. And since DE is always less than 0 (otherwise it is not called annealing), so de/kt < 0, so the function value range of P (DE) is (0,1).

As the temperature t decreases, the P (DE) gradually decreases.

We see the movement of a poor solution at once as a temperature-hopping process, and we accept such movement with probability P (dE).

There is an interesting metaphor for the mountain climbing algorithm and simulated annealing:

Mountain climbing algorithm: The rabbit jumps to the place higher than now. It found the highest mountain not far away. But this mountain is not necessarily Everest. This is the mountain climbing algorithm, it can not guarantee that the local optimal value is the global optimal value.

Simulated annealing: The rabbit was drunk. It jumped randomly for a long time. During this period, it may go high, or it may step into the ground. However, it gradually woke up and jumped in the highest direction. This is simulated annealing.

Genetic algorithm (GA, Genetic algorithm)

Also called evolutionary algorithms. Genetic algorithm is a heuristic search algorithm, which is inspired by Darwin's theory of evolution and used for reference to the evolutionary process of biology. So before introducing genetic algorithm, it is necessary to introduce the knowledge of biological evolution briefly.

Algorithmic thinking

Using the theory of biological evolution, genetic algorithm will solve the problem of simulation into a process of biological evolution, through replication, crossover, mutation and other operations to produce the next generation of solutions, and gradually eliminate the low degree of fitness function value of the solution, increase the value of the solution of high fitness function. This evolution of n generation is likely to evolve an individual with a high degree of fitness function.

For example, using a genetic algorithm to solve the "0-1 knapsack problem" idea: 0-1 the solution of the backpack can be encoded as a string of 0-1 strings (0: No, 1: take); first, randomly produce m 0-1 strings and then evaluate the merits of these 0-1 strings as a solution to the 0-1 knapsack problem; Randomly select some strings to generate the next generation of M strings by crossing, mutation, and more, and the better solution is chosen in a higher probability. After the evolution of the G generation, it is possible to produce an "approximate optimal solution" for the 0-1 knapsack problem.

Coding: You need to encode the solution of the problem in the form of a string to use a genetic algorithm. The simplest encoding is the binary encoding, which encodes the solution of the problem into the form of a bits array. For example, the solution to the problem is an integer, so it can be encoded in the form of an bits array. The solution to the 0-1 string as a 0-1 knapsack problem belongs to the binary encoding.

Genetic algorithms have 3 of the most basic operations: selection, crossover, mutation. (Three specific methods of operation see related papers)

Basic Genetic algorithm optimization

The following methods can optimize the performance of genetic algorithms.

Elitism (elitist strategy) selection: is an optimization of the basic genetic algorithm. In order to prevent the optimal solution of evolutionary process from being destroyed by crossover and mutation, the optimal solution of each generation can be copied intact to the next generation.

Insert operation: An insert operation can be added based on 3 basic operations. The insert action shifts a random fragment of a chromosome to another random position.

Ant Colony algorithm:

Ant colony algorithm (ant colony Optimization, ACO), also known as Ant algorithm, is a probability-based algorithm used to find the optimal path in the graph. Marco Dorigo in his doctoral dissertation in 1992, inspired by the behavior of ants discovering pathways in the search for food. Ant colony algorithm is a kind of simulation evolutionary algorithm, the preliminary research shows that the algorithm has many excellent properties. Aiming at the optimization design of PID controller parameters, the results of ant colony algorithm design are compared with the results of genetic algorithm design, and the numerical simulation results show that Ant colony Algorithm has the validity and application value of a new simulated evolutionary optimization method.

Artificial Firefly algorithm:

Nesterov Method:

Discussion on optimal solution algorithm

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.