Intelligent Systems II · TEE · mocks

Q2(a) PSO, one iteration [10]

Final examination · 24 Nov 2025

100-mark timed practice using the actual Final 2025 paper. Q1 compulsory; any four of Q2–Q7. Worked solutions are below the questions.

Question. Maximize F(x_1,x_2)=2x_1^2-3x_1x_2+x_2^2+5x_1+2x_2+7LaTeX: F(x_1,x_2)=2x_1^2-3x_1x_2+x_2^2+5x_1+2x_2+7 using Particle Swarm Optimization. X=\begin{bmatrix}2.5&-3.0\\3.5&-1.5\end{bmatrix},\;V=\begin{bmatrix}0.2&0.3\\0.1&0.25\end{bmatrix}LaTeX: X=\begin{bmatrix}2.5&-3.0\\3.5&-1.5\end{bmatrix},\;V=\begin{bmatrix}0.2&0.3\\0.1&0.25\end{bmatrix}. Take W=0.9,\;c_1=c_2=1.5,\;r_1=0.5949,\;r_2=0.0855LaTeX: W=0.9,\;c_1=c_2=1.5,\;r_1=0.5949,\;r_2=0.0855. Optimize and give the solution after 1 iteration showing the step-by-step process. [10 marks]

Answer

Given

Particle 1: x=(2.5,\,-3.0)LaTeX: x=(2.5,\,-3.0), v=(0.2,\,0.3)LaTeX: v=(0.2,\,0.3). Particle 2: x=(3.5,\,-1.5)LaTeX: x=(3.5,\,-1.5), v=(0.1,\,0.25)LaTeX: v=(0.1,\,0.25).

c_1r_1=1.5\times0.5949=0.89235,\qquad c_2r_2=1.5\times0.0855=0.12825LaTeX: c_1r_1=1.5\times0.5949=0.89235,\qquad c_2r_2=1.5\times0.0855=0.12825

To find

Fitness, pbest, gbest; new velocities and positions; updated pbest and gbest.

Formula and why it applies

v_{ij}\leftarrow wv_{ij}+c_1r_1(p^b_{ij}-x_{ij})+c_2r_2(p^g_j-x_{ij}),\qquad x_{ij}\leftarrow x_{ij}+v_{ij}LaTeX: v_{ij}\leftarrow wv_{ij}+c_1r_1(p^b_{ij}-x_{ij})+c_2r_2(p^g_j-x_{ij}),\qquad x_{ij}\leftarrow x_{ij}+v_{ij}

Each particle is pulled by its own memory and by the swarm's best; we maximise, so the larger FLaTeX: F is better.

Solution

Step 1. Fitness of particle 1
F(2.5,-3)=2(6.25)-3(2.5)(-3)+9+5(2.5)+2(-3)+7=12.5+22.5+9+12.5-6+7=57.5LaTeX: F(2.5,-3)=2(6.25)-3(2.5)(-3)+9+5(2.5)+2(-3)+7=12.5+22.5+9+12.5-6+7=57.5
Step 2. Fitness of particle 2
F(3.5,-1.5)=2(12.25)-3(3.5)(-1.5)+2.25+17.5-3+7=24.5+15.75+2.25+17.5-3+7=64LaTeX: F(3.5,-1.5)=2(12.25)-3(3.5)(-1.5)+2.25+17.5-3+7=24.5+15.75+2.25+17.5-3+7=64
Step 3. pbest and gbest
ParticlePositionFpbest
1(2.5, −3.0)57.5(2.5, −3.0)
2(3.5, −1.5)64(3.5, −1.5)

No previous iteration, so pbest = current position. Largest fitness is 64, so gbest = (3.5, −1.5).

Step 4. Velocity and position of particle 1
v_{11}=0.9(0.2)+0.89235(2.5-2.5)+0.12825(3.5-2.5)=0.18+0+0.12825=0.30825LaTeX: v_{11}=0.9(0.2)+0.89235(2.5-2.5)+0.12825(3.5-2.5)=0.18+0+0.12825=0.30825
x_{11}=2.5+0.30825=2.80825LaTeX: x_{11}=2.5+0.30825=2.80825
v_{12}=0.9(0.3)+0.89235(0)+0.12825(-1.5-(-3.0))=0.27+0.192375=0.462375LaTeX: v_{12}=0.9(0.3)+0.89235(0)+0.12825(-1.5-(-3.0))=0.27+0.192375=0.462375
x_{12}=-3.0+0.462375=-2.537625LaTeX: x_{12}=-3.0+0.462375=-2.537625
Step 5. Velocity and position of particle 2 (it is gbest, so both pull terms are 0)
v_{21}=0.9(0.1)+0+0=0.09,\qquad x_{21}=3.5+0.09=3.59LaTeX: v_{21}=0.9(0.1)+0+0=0.09,\qquad x_{21}=3.5+0.09=3.59
v_{22}=0.9(0.25)+0+0=0.225,\qquad x_{22}=-1.5+0.225=-1.275LaTeX: v_{22}=0.9(0.25)+0+0=0.225,\qquad x_{22}=-1.5+0.225=-1.275
Step 6. New fitness
F(2.80825,-2.537625)=15.772536+21.378856+6.439541+14.04125-5.07525+7=59.5569LaTeX: F(2.80825,-2.537625)=15.772536+21.378856+6.439541+14.04125-5.07525+7=59.5569
F(3.59,-1.275)=25.7762+13.73175+1.625625+17.95-2.55+7=63.5336LaTeX: F(3.59,-1.275)=25.7762+13.73175+1.625625+17.95-2.55+7=63.5336
Step 7. Update pbest and gbest
ParticleNew positionNew FOld pbest Fpbest after iteration
1(2.80825, −2.537625)59.556957.5(2.80825, −2.537625) — improved
2(3.59, −1.275)63.533664(3.5, −1.5) — kept

The best pbest fitness is still 64, so gbest stays (3.5, −1.5).

Final answer. V=\begin{bmatrix}0.30825&0.462375\\0.09&0.225\end{bmatrix}LaTeX: V=\begin{bmatrix}0.30825&0.462375\\0.09&0.225\end{bmatrix}, X=\begin{bmatrix}2.80825&-2.537625\\3.59&-1.275\end{bmatrix}LaTeX: X=\begin{bmatrix}2.80825&-2.537625\\3.59&-1.275\end{bmatrix}. After one iteration particle 1 improved to F = 59.5569; the best solution so far is gbest = (3.5, −1.5) with F = 64.

Official key: fitness and gbest (5 marks), velocity and position updates (5 marks). The calculations above use the question data. The key's summary matrix writes 0.462 in place of 2.808 for x_{11}LaTeX: x_{11}; that is a copying slip.