You are on page 1of 67

Department of Computer Science, Christian-Albrechts University, Kiel, 9th February, 2010

Designing of Adaptive Quantum inspired Evolutionary


Algorithm for Constraint Optimization Problems

Ashish Mani
Dayalbagh Educational Institute, Agra, India
Outline
• Evolutionary Algorithms
• Quantum Inspiration
• Existing QiEA
• Proposed Adaptive QiEA
• Constraint Handling Techniques
• Some Examples
• Testing and Results
• Conclusions and Future Work
• References
• Questions???
Evolutionary Algorithms

Population based stochastic search and optimization


techniques inspired by nature’s laws of evolution.

Application

Large Search Space


Near Optimal Solution is acceptable
Efficient Deterministic Solutions are not available
Evolutionary Algorithms


Population of individuals which represents solutions.

Individuals Compete against each other.

New individuals are generated from old ones through
recombination and mutation.

New individuals compete (possibly also with parents) for survival.

Natural selection leads to improvement in the fitness of the
population.
General Scheme of EAs

Ref: www.cs.vu.nl/~gusz/ecbook/slides/What_is_an_EA.ppt
Pseudo-code for typical EA

• Initialize
• Evaluate
• Do {
– Select Parents
– Recombine
– Mutate
– Evaluate
– Select Individuals for next Generation
– } While (!Termination_Criteria)
Limitations of EAs

Premature convergence
Slow convergence, stagnation
Sensitivity to choice of parameters

Efforts have been made to understand and overcome such


limitations.
EAs as problem solvers:
Goldberg’s 1989 view
Performance of methods on problems

Special, problem tailored method

Evolutionary algorithm

Random search

Scale of “all” problems


Michalewicz’ 1996 view
EA 4
Performance of methods on problems

EA 2
EA 3

EA 1

Scale of “all” problems


No Free Lunch Theorem (1997)

• "a general-purpose universal optimization strategy is


theoretically impossible, and the only way one strategy
can outperform another is if it is specialized to the specific
problem under consideration"
Limitations of EA
1) Premature convergence
2) Slow convergence, stagnation
3) Sensitivity to choice of parameters

Many efforts have been made to overcome limitations 1)


and 2) by establishing a good balance between the
Exploitation and Exploration.

Limitation 3) can be overcome by Adaptivity (Hypothesis).

Latest Effort is Adaptive QiEA


Quantum Inspiration
Quantum inspired EA

• EA inspired by the principles of Quantum Mechanics.

• Improve the balance between exploration and exploitation.

• Quantum computing paradigm is conjectured more powerful.

– Important principles of Quantum Mechanics are


Superposition, Entanglement, Interference and
Measurement.

– Principles mostly utilized are superposition and


measurement for improving diversity.
Quantum Principles:
• • Superposition
• A particle can assume different positions, have different values of energy,
spin and phase simultaneously, with each of them defined by a different
probability amplitude.

– • Measurement
• When a particle (or a quantum system) interacts with its environment,
the superposition is destroyed and the system collapses into one single
real state, as it is measured in the classical physics (Heisenberg).

• • Entanglement
• Two or more particles, regardless of their location, define the same state,
with the same probability function. The two particles can be viewed as
“correlated”, undistinguishable, “synchronized”, coherent.
Quantum Computing
• The smallest information element in quantum computer is a
qubit, which is quantum analog of classical bit.
• It is represented by a unit vector in Hilbert space with |0> and |1>
as the basis states. The qubit can be represented by the vector |
ψ>, which is given by:
|ψ> = α|0> + β|1>. (1)
where |α|2 and |β|2 are the probability amplitudes of the qubit to
be in state |0> and |1> and should satisfy the condition:
|α|2 + |β|2 = 1. (2)
• The qubits can store, in principal exponentially more information
than classical bits.
• However, these qubits exist in quantum computing systems and
are constrained by several limitations.
• The simulation of the qubits is inefficient on classical computers.
Existing QiEA framework
• Probabilistic nature of qubits has been widely used for
maintaining diversity [4].
• A single qubit is attached to each solution vector and the solution
is obtained by taking measurement in binary coded as well as real
coded QiEA.
• The qubit associated with solution vector is also evolved by using
quantum gate operators, which are influenced by phase rotation
transformation used in Grover’s Algorithm for searching unsorted
database.
• Further, the past efforts have also used mutation operator and
local heuristics [2].
Ref.: Patvardhan et. al. (2007)

QiEA
• Observation
– Process of generating binary string by observing a qubit string
i=> 1 2 3 4 5 ........ N
Q (|α|2) 0.17 0.78 0.72 0.41 0.89 ......... 0.36
R 0.24 0.07 0.68 0.92 0.15 ......... 0.79
P 1 0 0 1 0 ......... 1

Alters the elements of Q such that , in subsequent


iterations, there is a higher probability of generation
of solution strings, which are similar to best solution.

• Updating qubit string


Salient Points of Reported Efforts
• No direct correspondence between the solution vector and
qubits especially in case of real coded QiEA [2].
• The quantum rotation gates / operators also behave
independent of the information from the problem and the
solution domain assuming that the quantum behavior would
help in reaching the solution.
• However, it should not be forgotten that such algorithms are to
be run on classical computers without simulating any quantum
phenomena.
• Further, it can be argued that increasing the diversity by
collapsing the solution qubit may affect the exploitation.
Proposed Adaptive QiEA

• Different approach

• Two Qubits

• Superposition as well as Entanglement Principle

• Quantum Rotation inspired Adaptive Crossover


Two Qubits

• Helps in overcoming limitations associated with the classical EA

• The first qubit, |ψ1(t)> stores design variables of solution vector.

• The second qubit, |ψ2i(t)> stores scaled and ranked objective


function value of the solution vector.

• The second qubit is used as feedback in parameter - tuning free


adaptive quantum inspired rotation crossover operator used for
evolving the first qubit
Entanglement Principle
The mathematical representation of the classical
implementation of entanglement principle is as given below:

|ψ2i(t)> = f1(|ψ1i(t)>) (3)

|ψ1i(t+1)> = f2(|ψ2i(t)>, |ψ2j(t)>,|ψ1i(t)>, |ψ1j(t)>) (4)

where |ψ1i> and ψ1j> are the first qubits associated with the ith
and jth solution vectors respectively, |ψ2i> is the second qubit
associated with the ith solution vector, t is iteration number, f1 and
f2 are the functions through which both the qubits are classically
entangled.
Quantum Rotation inspired Adaptive Crossover
• A quantum rotation inspired adaptive and parameter tuning
free crossover operator is designed.
• The second qubits’s amplitude is used for determining the angle
of rotation for evolving the first qubit. The following equation is
used for the purpose:
ψ1i(t+1) = ψ1i(t) + f(ψ2i(t), ψ2j(t))*( ψ1j(t) - ψ1i(t)) (5)
where t is iteration number, ψ1j can be the best solution vector
or any other randomly or deterministically selected solution
vector.
Rotations strategies

• Rotation towards Best (R-I)

• Rotation towards Better (R-II)

• Rotation away from Worse (R-III)

• The rotation crossover operator balances the exploration


and exploitation and converges the solution vector
adaptively towards global optima.
Adaptive Crossover

• The function f(ψ2i(t), ψ2j(t)) controls gross and fine search.

• Presently, f(ψ2i(t), ψ2j(t)) generates a random number either


between (0, |α2i - α2j|) or (0,||α2j|2 - | α2i|2|).

• Random_var(0, |α2i - α2j|) is used for the gross search

• Random_var (0, ||α2j|2 -| α2i|2|) is used for the fine search.

• The salient feature of the new quantum rotation inspired


crossover operator is the adaptive change of each variable in
the solution vector and at the same time, it is problem driven
rather than being an arbitrary choice of the user.
Engineering Optimization Problems

Optimize f(x),
Such that
xil < xi < xui xi – ith variable, xil and xui are lower and upper
limits of xi.
gj (x) < 0; j - number of inequality constraints .
hK (x) = 0; k - number of equality constraints.
where x = (x1 ,x2 ,…,xN ) ε RN.

• f(x), g(x) and h(x) can be non-convex, non linear, non differential,
multi-modal and of high dimension.
• Such problems are in NP Hard complexity Class
Constraint Handling Techniques
Constraint Handling

• Penalty Based Techniques


– Death Penalty
– Penalty Factor
• Static, Dynamic, Adaptive
– Feasibility Rules
Stochastic Ranking
• Multiobjective Algorithms
• Repair Based Methods
Constraint Handling Design guidelines

• Feasible solutions
• Diversity
• Parameter fine-tuning Free
• Efficient
• Simple
Comparison of Constraint Handling Techniques

Criterion Static Dynamic Adaptive Death F. Stoch. Desired


Penalty Penalty Penalty Penalty Rules Ranking Techniq
Factor Factor Factor ue
(small
Penalty)
Feasible No No No Yes Yes No Yes
Solutions

Diversity Good Fair Fair- Poor Fair Good Good


Good

Parameter No No May Be Yes Yes No Yes


-Tuning
Free
Efficiency Good Good Poor – Poor Good Fair Good
Fair
Simplicity Yes May Be May Be Yes Yes Yes Yes
Objective

• To design a constraint handling technique which is free of any


parameter setting and has wide applicability.
• No single constraint handling technique meets the objective.

• Two possible approaches:

– Modify and Augment an existing technique

– Hybridize two known complementary techniques


Proposed Technique

• Hybridize – Two Complementary Techniques

– Feasibility Rules

– Adaptive Penalty Factor Method


Complementary Constraint Handling Techniques

Criterion Static Dynamic Adaptive Death F. Stoch. Desired


Penalty Penalty Penalty Penalty Rules Ranking Techniq
Factor Factor Factor ue
(small
Penalty)
Feasible No No No Yes Yes No Yes
Solutions

Diversity Good Fair Fair- Poor Fair Good Good


Good

Parameter No No May Be Yes Yes No Yes


-Tuning
Free
Efficiency Good Good Poor – Good Good Fair Good
Fair
Simplicity Yes May Be May Be Yes Yes Yes Yes
Pseudo code – AQiEA using Feasibility Rules
Initialize Quantum inspired Register QR1A.
While (!termination_criteria)
{
Compute fitness of QR1 using Feasibility Rules.
Assign QR2 on the basis of the fitness of QR1A.
Perform Adaptive Quantum inspired Crossover on QR1A.
Select next generation using Feasibility Rules.
}

Accep ted fo r p ub lic atio n in Internatio nal Jo urnal of F uturistic Co mp uting App lic at
Feasibility Rules

Quantum inspired Register QR1A’s Fitness evaluated using


Feasibility rule :

• If the two individuals being compared are both feasible, the


one with better objective function value f(x) is considered
fitter.

• If one individual is feasible and the other unfeasible, the


feasible one is fitter.

• If both individuals are infeasible, the one with lower level of


constraint violation or degree of infeasibility is selected.
Pseudo code for AQiEA with Hybrid CHT
Initialize two Quantum inspired Registers: QR1A and QR1B.
While (!termination_criteria) {
Compute fitness of QR1A using Feasibility Rules.
Assign QR2A on the basis of the fitness of QR1A.
Perform Adaptive Quantum inspired Crossover on QR1A.
Select next generation for QR1A.
If (! Improvement_ QR1A) {
Compute Adaptive Penalty Factor.
Compute fitness of QR1B using Adaptive Penalty Factor method.
Assign QR2B on the basis of fitness of QR1B.
Perform Adaptive Quantum inspired Crossover on QR1B.
Select next generation for QR1B.
Swap some members of QR1A and QR1B. C o m m un ic ated
} }
Adaptive Penalty Factor
It is designed to make the objective function value of the fittest
individuals in Quantum inspired Registers QR1A and QR1B equal.

fBAi(x) = fBBi(x) + S * CVBi

Where fBAi(x) = Objective function value of Best Individual of QR1A in the ith generation.
fBBi(x) = Objective function value of Best Individual of QR1B in the ith generation.
CVBi = Constraint Violation of Best Individual of QR1B in the ith generation.

This automatically chooses a new value of penalty factor for


the generation to guide the search in entire solution domain.
APF (cont.)
The equation for computing adaptive penalty factor ‘S’, is as follows:
If (CVBi > 0)
{S = (fBAi(x) – fBBi(x)) / CVBi for Minimization
S = (fBBi(x) – fBAi(x)) / CVBi for Maximization }
else
S=0
If (S <=0)
S=0
Where fBAi(x) = Objective function value of Best Individual of QR1A in
the ith generation.
fBBi(x) = Objective function value of Best Individual of QR1B in the ith
generation.
CVBi = Constraint Violation of Best Individual of QR1B in the ith
generation.
Parameters
Fitness Evaluation: The individuals in Quantum inspired Registers
QR1A and QR1B are evaluated differently for determining the
fitness.
QR1B’s fitness is evaluated by using modified objective function
value, which is determined by using adaptive penalty factor.
• Objective function = f(x).

• Constraint Violation = Degree of infeasibility = {Σ(gi+(x)) + Σ(|


hi*(x)|)}, where gi+(x) = max {0,gi(x)} and hi*(x) = 0 if |hi(x)| -δ <
0 else hi(x), δ = 10-10.

• Modified Objective function Φ = f(x) + S*{Σ(gi+(x)) + Σ(|hi*(x)|)}.


Parameters (cont.)

Swap: It exchanges part of Quantum inspired Registers QR1A and


QR1B so that search can be guided towards global optima while
maintaining diversity in either of the populations.

The fittest member of both QR1A and QR1B are copied in the least
fit member of the either registers.

• Further 10% of the population is randomly exchanged.


Testing
• QiEA is a probabilistic algorithm so simulations have been
performed to statistically determine both :

– Robustness

– Efficiency

• The proposed algorithm has been tested on the widely studied


benchmark problems for testing similar Algorithms.

• Test cases have been designed to validate various design


alternatives.

• Further, it has been compared with present state of art


algorithms.
Welded Beam

• The first problem (P-1) is designing of a Welded Beam for


minimum cost, subject to some constraints [10]. The
objective is to find the minimum fabrication cost,
considering four design variables and constraints of shear
stress, bending stress in the beam, buckling load on the bar,
and end deflection on the beam.
• There are four variables and seven inequality constraints.
Compressed air storage tank

• The second problem (P-2) is designing a compressed air storage


tank with a working pressure of 3,000 psi and a minimum
volume of 750 ft3. A cylindrical vessel is capped at both ends by
hemispherical heads. Using rolled steel plate, the shell is made
in two halves that are joined by two longitudinal welds to form
a cylinder. The objective is to minimize the total cost, including
the cost of the materials forming the welding [10]. The design
variables are: thickness, thickness of the head, the inner radius
and the length of the cylindrical section of the vessel. The
variables x1 and x2 are discrete values, which are integer
multiples of 0.0625 inch.
Speed Reducer
• The third problem (P-3) is designing of the speed reducer
[11] and is concerned with the face width, module of the
teeth, number of teeth on the pinion, length of the first shaft
between bearings, length of the second shaft between
bearings, and diameter of the first shaft (all variables are
continuous except number of teeth on pinion that is
integer). The weight of the speed reducer is to be minimized
subject to the constraints on bending stress of the gear
teeth, surface stress, transverse deflections of the shafts and
stresses in the shaft.
Tension / Compression spring
• The fourth problem (P-4) is minimizing the
weight of a tension / compression spring,
subject to constraints of minimum deflection,
shear stress, surge frequency, and limits on
outside diameter and on design variables.
There are three design variables: the wire
diameter, the mean coil diameter, and the
number of active coils [10].
Himmelblau`s Problem

• The fifth problem (P-5) was originally proposed by


Himmelblau [8], there are five design variables, six
nonlinear inequality constraints and 10 boundary
conditions.
Testing

• Thirty independent runs have been performed for each problem


using the proposed algorithm.

• Algorithm was implemented in ‘C’ programming language on an


IBM Workstation with Pentium-IV 2.4 GHz processor, 2GB RAM
and Windows XP platform.
Test Cases
• SC-I is the Standard Configuration with all the three types of
rotations R-I, R-II and R-III in random mode

• The second configuration (SC-II) uses deterministic rotation


instead of random rotation in standard configuration

• The third configuration (SC-III) uses R-I and R-III of the


standard configuration but not R-II, i.e. random exploration
is turned off to find the effectiveness of exploration part of
the AQCO.

• The fourth configuration (SC-IV) uses standard configuration


but without swap to validate the choice of constraint
handling technique.
Results: Experimental Results with (SC-I)
(Table – I)

Prob-# P-1 P-2 P-3 P-4 P-5

Best 1.724852 6059.714335 2996.348165 0.012665 -31025.56024

Median 1.724852 6059.714340 2996.348165 0.012665 -31025.56024

Mean 1.724852 6067.956545 2996.348165 0.012665 -31025.56024

S.D. 0.000 13.847791 0.000000 0.000000 0.00000

Worst 1.724852 6090.586470 2996.348165 0.012665 -31025.56024


Table 2: Experimental Results with deterministic
rotation (SC-II)

Prob-# P-1 P-2 P-3 P-4 P-5

Best 1.724854 6059.714 2996.348 0.012665 -31025.56024

Median 1.810436 6210.742 3005.682 0.012707 -31025.56024

Mean 1.822122 6392.163 3000.869 0.012702 -31025.56024

S.D. 0.129626 0445.282 5.7376 3.66E-05 0.000

Worst 2.118418 7399.902 3009.521 0.012789 -31025.56024


Table 3: Experimental results with limited
exploration in FR part (SC-III)

Prob-# P-1 P-2 P-3 P-4 P-5

Best 1.724891 6059.715 2996.423 0.012668 -31025.6

Median 1.847461 6370.78 3004.579 0.012681 -31025.5

Mean 1.844187 6475.491 3002.084 0.01273 -31024.8

S.D. 0.135925 0501.534 4.950 0.000142 1.65816

Worst 2.179912 7332.852 3010.661 0.013132 -31020.2


Table 4: Experimental Results without swap (SC-IV)

Prob-# P-1 P-2 P-3 P-4 P-5

Best 1.724852 6059.714 2996.348 0.012665 -31025. 6

Median 1.725503 6071.783 2996.348 0.012668 -31025. 6

Mean 1.733061 6096.073 2996.348 0.01267 -31025. 6

S.D. 0.017874 72.6556 0.000 0.000 0.0

Worst 1.80037 6288.677 2996.348 0.012679 -31025. 6


Convergence Graph for the Problem P-1.
Objective function value

No. of Function Evaluations


Convergence Graph for the Problem P-2
Objective function value

No. of Function Evaluations


Convergence Graph for the Problem P-4
Objective function value

No. of Function Evaluations


Comparative Performance

Table 5 presents comparison of the proposed Adaptive Real


coded QiEA (AQiEA) with the existing state of art algorithms like
RQiEA [2007], ECPSO [2008] and DTS [2002] on best solution of
problems P-1, P-2 and P-4.
COMPARATIVE RESULTS OF WELL KNOWN ALGORITHMS ON
BEST SOLUTION

Prob-# P-1 P-2 P-4

AQiEA 1.7248520 6059.714 0.012665

RQIEA[4] 1.7513172 6088.568 0.012680

ECPSO [8] 1.7248600 6059.714 0.012669

DTS [9] 1.7282260 6059.946 0.012681


Discussion

• It is clear that the performance of the proposed algorithm as


indicated by the quality of solution is superior to the existing
techniques for this problem.

• The algorithm is Robust and Efficient .


Conclusions
• Constrained Optimization is an important problem in the
engineering domain for which a new adaptive quantum inspired
evolutionary algorithm is proposed.

• The algorithm uses two qubits representation instead of one and


utilizes the quantum entanglement and superposition principles
hitherto not tapped.

• It does not require mutation or local heuristic for improving the


solution quality but still provides better solutions than the state of
the art approaches.

• It uses the latest hybrid constraint handling technique.

• Future work would involve applications in new areas and in-depth


analyses to understand the working of the proposed algorithm.
References
1. Z. Michalewicz, Genetic Algorithms + Data Structures = Evolution Programs. Berlin: Springer-Verlag, 1996.
2. K.H. Han and J.H. Kim, “Quantum-Inspired Evolutionary Algorithms with a New Termination Criterion, Hε Gate
and Two Phase Scheme,” IEEE Trans. Evo. Co., vol. 8, no. 2, 2004, pp. 156—168.
3. M.A. Nielsen and I.L. Chuang, Quantum Computation and Quantum Information. Cambridge: Cambridge
University Press, 2006.
4. F.S. Alfares and I.I. Esat, “Real-coded Quantum Inspired Evolutionary Algorithm Applied to Engg. Optimiz.
Problems,” 2nd Int. Symp. On LAFMVV IEEE C S, 2007, pp.169-176.
5. A. Mani and C. Patvardhan, “A Novel Hybrid Constraint Handling Technique for Evolutionary Optimization”,
Proc. IEEE CEC 2009, doi.ieeecomputersociety.org/10.1109/CEC.2009.4983265
6. F. Herrera, M. Lozano and A.M. Sanchez, “A Taxonomy for the crossover operator for Real-coded Genetic
Algorithms,” Int. J. Intelligent Systems, vol 18, 2003, pp. 309--338.
7. K. Deb, “An efficient constraint handling method for genetic algorithms,” J. Comput. Methods Appl. Mech.
Eng., vol. 186, no. 2/4, 2000, 311--338.
8. C.A.C. Coello, “Theoretical and numerical constraint handling techniques used with evolutionary algorithms”,
J. Comput. Methods Appl. Mech., vol. 191, 2002, pp. 1245--1287.
9. Q. He, L. Wang, and F. Huang, “Nonlinear Constrained Optimization by Enhanced Co-evolutionary PSO,” Proc.
IEEE CEC, 2008, pp. 1436-1441.
10. C.A.C. Coello and E.F. Montes, “Constraint-handling in genetic algorithms through the use of dominance-based
tournament selection,” J. Adv. Engrg. Informatics, vol. 16, 2002, pp. 192--203.
11. J. Golinski, “An Adaptive Optimization System Applied to Machine Synthesis,” Mech. Mach. Theory, vol. 8, no.
4, 1973, pp. 419--436.
Before I say Thanking You

???

You might also like