Field of Invention
The present invention relates to a field of optimizing methods, and more particularly to a quantum evolution method introducing an elite group and a state preference.
Description of Related Arts
Quantum evolution methods are based on state vector expression of quantum, wherein probability amplitudes of quantum bits are used for representing chromosome encoding, in such a manner that a chromosome is able to express multiple superimposed states; and quantum revolving door and quantum NOT gate are used for chromosome updating, so as to achieve optimized solution of a target. However, conventional quantum convergence direction cannot be effectively controlled, which may cause degradation. Conventionally, there are many improvements for the quantum evolution methods, but none effectively overcomes the problem of convergence direction. Therefore, how to speed up the convergence of the quantum evolution methods, and how to control the convergence direction for preventing degradation, so as to improve method stability, are real key to quantum methods.
An object of the present invention is to overcome the above technical defects, and provide a quantum evolution method which effectively controls a convergence direction, wherein an elite group and a state preference are introduced for controlling the convergence direction, so as to improve method stability.
Accordingly, in order to accomplish the above object, the present invention provides:
a quantum evolution method, comprising steps of:
(1) according to the quantum evolution method, initializing a generation number t=0, and initializing a population Q(t)={q1t, q2t, . . . , qnt}, wherein n is a population size, t is the generation number, qit is a No. i individual in a No. t generation, and i ∈[1,n]; defining
wherein qit, comprises m quantum bits, α represents a probability of each of the quantum bits that a state thereof is 0, β represents a probability of each of the quantum bits that the state thereof is 1, and |α|2+|β|2=1; wherein the quantum bits are randomly generated, and satisfy an equation:
(αijt, βijt)=(sign(rand[0,1]−0.5)*/√{square root over (2)}, sign(ramd[0,1]−0.5)*/√{square root over (2)}),
wherein αijt represents a probability of a No. j quantum bit of the No. i individual in the No. t generation that a state thereof is 0, and βijt represents a probability of the No. j quantum bit of the No. i individual in the No. t generation that a state thereof is 1; initializing an optimal solution collection B(t), and inputting a string b, which comprises m 0-characters, into B(t) as an initial optimal solution;
(2) observing Q(t), and observing all individuals in the No. t generation, wherein for qit, the m quantum bits are all observed for generating a string xit with a length of m, wherein i is a corresponding individual, t is the generation number, and all individuals in the string xit correspond to the quantum bits of qit; if a quantum bit is 0, then 0 is written to a corresponding location in the string xit, and if the quantum bit is 1, the 1 is written to the corresponding location in the string xit; finally generating P(t)={x1t, x2t, . . . , xnt };
(3) evaluating each xit with an evaluation function, and inputting evaluating results into a fitness function F(t), F(t)={f1t, f2t, . . . , fnt}, wherein fit represents a fitness of qit which is the No. i individual in the No. t generation, and n is the population size of the No. t generation;
(4) selecting an elite group E(t) from P(t), specifically comprising steps of:
(4.1) comparing all the individuals in the No. t generation with a worst individual of the No. t generation which is evaluated by the fitness function in the step (3), constructing {tilde over (f)}it=abs(fit−min(F(t)));
(4.2) representing a probability that xit enters the elite group by a probability function Sit,
and constructing S(t)={s1t, s2t, . . . , snt}; and
(4.3) based on S(t), deciding whether the individuals in P(t) are selected to enter the elite group E(t) by a roulette method, E(t)={e1t, e2t, . . . , ept}, wherein p is a total individual quantity in the elite group;
(5) evolving the No. t generation population Q(t) through
so as to obtain a No. t+1 generation population Q(t+1),
wherein sign(αijtβijt) represents a quadrant location of a current quantum bit,
is a phase angle rotation weight of the elite group E(t), so the elite group actively guides evolution of the whole population; a value of Δφijk is selected according to: 1) if the individual qit in the No. t generation enters the elite group, then Δφijk=0; 2) if the individual qit in the No. t generation fails to enter the elite group and xijt=ekjt, then Δφijk=0; 3) if the individual qit in the No. t generation fails to enter the elite group while xijt is in a ‘0’ state and ekjt is in a ‘1’ state, then Δφijk=φ1, wherein φ1 is a rotation value evolving towards the ‘1’ state, so as to increase a probability that xijt evolves from the ‘0’ state to the ‘1’ state; and 4) if the individual qit in the No. t generation fails to enter the elite group while xijt is in the ‘1’ state and ekjt is in the ‘0’ state, then Δφijk=φ0, wherein φ0 is a rotation value evolving towards the ‘0’ state, so as to increase a probability that xijt evolves from the ‘1’ state to the ‘0’ state; wherein xit is the quantum bits of the individual qit in the No. t generation, which is determined in the step (2); and ekt is all individuals of the elite group E(t), which is determined in the step (4), k ∈[1, p], xijt and ekjt respectively represent the No. j quantum bit of xit and ekt in the No. t generation;
for controlling an evolution direction so as to uniformly evolve towards the ‘1’ state, introducing a state preference for further weighting, specifically comprising steps of: when the individual qit in the No. t generation fails to enter the elite group while xijt is in the ‘0’ state and ekjt is in the ‘1’ state, increasing a value of φ1 so as to increase a probability that xijt evolves from the ‘0’ state to the ‘1’ state; when the individual qit in the No. t generation fails to enter the elite group while xijt is in the ‘1’ state and ekjt is in the ‘0’ state, decreasing a value of φ0 so as to decrease a probability that xijt evolves from the ‘1’ state to the ‘0’ state; in such a manner that total evolution is towards the ‘1’ state;
(6) using xit with a highest fitness, which is selected from P(t) by the fitness function F(t) in the step (3), as an optimal solution of the No. t generation; comparing the optimal solution of the No. t generation with an optimal solution b obtained before the No. t generation, wherein if the optimal solution of the No. t generation is better than the optimal solution before the No. t generation, then the optimal solution of the No. t generation is inputted into B(t−1) for replacing b, so as to obtain B(t); otherwise, the original optimal solution b in B(t−1) remains, so as to obtain B(t); and (7) judging a shutdown condition, specifically: when the optimal solution b in the B(t) is not a globally optimal solution, b is a string comprising m 1-characters and the generation number t is lower than a certain limit, executing t=t+1, and returning to the step (2) for further evolution; otherwise, outputting the optimal solution b in the B(t).
Preferably, in the step (5), introducing the state preference for controlling a convergence direction of the quantum evolution method specifically comprises steps of: using φ1 and φ0 for increasing or decreasing a state value of the current quantum bit, wherein if the current quantum bit is in the ‘1’ state, a tendency that a quantum moves to 0 is decreased by decreasing φ0 ; if the current quantum bit is in the ‘0’ state, a tendency that a quantum moves to 1 is increased by increasing φ1.
Preferably, in the step (3), for evaluating each xit the evaluation function, all quantum bits of xit are added together, and a result thereof is inputted into F(t) as a fitness fit of xit.
Preferably, in the step (4.3), for deciding whether the individuals in P(t) are selected to enter the elite group E(t) by the roulette method based on S(t), the fitness fit of all the individuals in the No. t generation is calculated, then a fitness sum
of all the individuals in the No. t generation is calculated, probabilities that the individuals in P(t) enter the elite group E(t) is
p individuals with highest probabilities are selected to enter the elite group E(t).
Preferably, in the step (6), b in the optimal solution collection B(t) is the optimal solution of the No. t generation, and an updating process thereof is: during initializing, the optimal solution b is the string comprising m 0-characters; when the generation number t=0, the optimal solution obtained through the step (2) and the step (3) is surely better than the initial optimal solution; as a result, replacing the initial optimal solution by the optimal solution, and inputting in the optimal solution collection B(t) as the optimal solution b, so as to obtain a current generation optimal solution collection B(0); when the generation number t=1, repeating the step (2) and the step (3), comparing an obtained optimal solution with the optimal solution in B(0), wherein if the optimal solution when t=1 is better than the optimal solution in B(0), then the optimal solution when t=1 is inputted into B(t) as b, so as to obtain a current generation optimal solution collection B(1); if the optimal solution when t=1 is worse than the optimal solution in B(0), then the original optimal solution b in B(1) remains, so as to obtain B(1); when the generation number is t, comparing the optimal solution of the No. t generation with the optimal solution b in B(t−1), so as to obtain B(t).
The present invention has a simple structure, and introduces the elite group and the state preference for weighting quantum evolution, which finally achieves optimized solution. By weighting control of the convergence direction, quantum degradation is inhibited and method stability is improved.
Referring to drawings and a preferred embodiment, the present invention is further illustrated.
Referring to
(1) executing a step 101, specifically: initializing a generation number t=0, wherein a population size n=20, a parallel population number N=30, and a max generation number is 10000 (i.e. t ∈[0,10000]);
is a No. i individual in a No. t generation (i ∈[1, n]) , and qit comprises m quantum bits; α and β respectively represent probabilities of a state of 0 or 1, and |α|2+|β|2=; wherein wherein the quantum bits are randomly generated, and satisfy an equation:
(αijt, βijt)=(sign(rand[0,1]−0.5)*1/√{square root over (2)}, sign(rand[0,1]−0.5)*1/√{square root over (2)}),
wherein αijt represents a probability of a No. j quantum bit of the No. i individual in the No. t generation that a state thereof is 0, and βijt represents a probability of the No. j quantum bit of the No. i individual in the No. t generation that a state thereof is 1; inputting a string b, which comprises m 0-characters, into B(t) as an optimal solution;
(2) executing a step 102, specifically: observing all individuals in the No. t generation, and generating P(t)={x1t, x2t, . . . , xnt}, wherein xit represents strings comprising 0 or 1 with a length of m, 0 means the individual is valueless and 1 means valuable;
(3) executing a step 103, specifically: evaluating each xit of P(t) in the No. t generation, constructing a fitness function F(t)={f1t, f2t, . . . , fnt}, wherein fit represents a fitness of the No. i individual in the No. t generation;
(4) executing a step 104, specifically: constructing an elite group E(t), and comparing all values in the fitness function F(t) with a min value in the F(t) for obtaining {tilde over (f)}it with an equation:
{tilde over (f)}
i
t
=abs(fit−min(F(t)));
constructing a probability function Sit, which represents a probability that xit of P(t) enters the elite group, with an equation:
constructing S(t)={s1t, s2t, . . . , snt};
deciding whether the individuals in P(t) are selected to enter the elite group E(t) by a roulette method, E(t)={e1t, e2t, . . . , ept}, wherein p is a total individual quantity in the elite group; here, p=20;
(5) executing a step 105, specifically: evolving Q(t), and evolving the quantum bits based on the elite group with
for rotating Q(t), wherein
sign(αijtβijt) represents a quadrant location of a current quantum bit,
is a phase angle rotation weight of the elite group E(t), so the elite group actively guides evolution of the whole population; values of Δφijk are listed in Table 1;
for preventing degeneration of conventional quantum evolution methods, introducing a state preference for further weighting, specifically comprising steps of: using φ1 and φ0 for increasing or decreasing a state value of the current quantum bit, wherein if the current quantum bit is in the ‘1’ state, a tendency that a quantum moves to 0 is decreased by decreasing φ0 ; if the current quantum bit is in the ‘0’ state, a tendency that a quantum moves to 1 is increased by increasing φ1; wherein values of φ1 and φ0 are determined by the population size and the individual quantity in the elite group, which is generally sufficient when 0≦φ0≦φ1, as shown in
(6) executing a step 106, specifically: using xit with a highest fitness of P(t) as an optimal solution of the No. t generation; comparing the optimal solution of the No. t generation with an optimal solution b obtained before the No. t generation, wherein if the optimal solution of the No. t generation is better than the optimal solution before the No. t generation, then the optimal solution of the No. t generation is inputted into B(t−1) for replacing b, so as to obtain B(t); otherwise, the original optimal solution b in B(t−1) remains, so as to obtain B(t); and
(7) executing a step 107, specifically: judging a shutdown condition, specifically: when the optimal solution b in the B(t) is not a globally optimal solution, b is a string comprising m 1-characters and the generation number t is lower than a certain limit, executing t=t+1, and returning to the step (2) for further evolution; otherwise, outputting the optimal solution b in the B(t).
A famous NP problem—knapsack problem is adapted as an example. The problem is: under a certain knapsack volume, how to reach a max total price of items with different prices and sizes. There are five knapsacks with different volumes of 600, 1200, 1800, 2400 and 3000 in the example. Comparison is provided between the quantum evolution method of the present invention with the elite group and the state preference (PEQIEA), a quantum evolution method (QIEA), a quantum evolution method with H quantum (HQIEA), improved quantum evolution method (IQIEA), quantum evolution method with fitness (FQIEA), hybrid quantum evolution method (QEP), and a comprehensively learning quantum evolutionary approach (CLQIEA) for comparison.
wherein GS is a max value obtained by a greedy method, and UL is an ideal limit.
Referring to Table 2, values obtained by PEQIEA of the present invention are better than solutions in any other cases, while stability is also greater.
Number | Date | Country | Kind |
---|---|---|---|
201410831269.4 | Dec 2014 | CN | national |
This is a U.S. National Stage under 35 U.S.0 371 of the International Application PCT/CN2015/092174, filed Oct. 19, 2015, which claims priority under 35 U.S.C. 119(a-d) to CN 201410831269.4, filed Dec. 29, 2014.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/CN2015/092174 | 10/19/2015 | WO | 00 |