Intelligent Systems II · TEE · papers
Q7(b) ACO for TSP [10]
Final examination · 24 Nov 2025
Actual TEE paper · 100 marks · 3 hours · Q1 compulsory + any 4 of Q2–Q7 · every answer verified (key errors flagged)
Question. For the four-city travelling salesman problem, the distance and pheromone matrices (A, B, C, D) are given. Apply Ant Colony Optimization. Calculate the path travelled by 2 ants to cover all cities starting from city A. Random numbers for Ant 1 are 0.3, 0.8 and for Ant 2 are 0.5, 0.7. Also update the pheromone matrix after 1 iteration. [10 marks]
Answer
Given
D=\begin{array}{c|cccc}&A&B&C&D\\\hline A&0&4&2&4\\B&4&0&3&6\\C&2&3&0&2\\D&4&6&2&0\end{array}\qquad \tau=\begin{array}{c|cccc}&A&B&C&D\\\hline A&0&1&1&1\\B&1&0&1&1\\C&1&1&0&1\\D&1&1&1&0\end{array}Assume LaTeX:
\alpha=\beta=1, LaTeX:
\rho=0.5, LaTeX:
Q=1 (class convention; not stated in the question).
To find
Tour of each ant, tour lengths, updated pheromone matrix.
Formula and why it applies
P_{ij}=\frac{\tau_{ij}\,\eta_{ij}}{\sum_{l\in\text{allowed}}\tau_{il}\,\eta_{il}},\qquad\eta_{ij}=\frac1{d_{ij}}\tau_{ij}^{new}=(1-\rho)\tau_{ij}+\sum_{k:\,ij\in\mathrm{tour}_k}\frac{Q}{L_k}The sum includes only ants whose completed tour contains edge ij. An unused edge receives no deposit but still evaporates. Here distances are symmetric, so a traversed edge updates both symmetric matrix cells. Both ants construct their tours using the old pheromones; update after both finish, including their return to A.
Solution
Step 1. Probabilities from A (both ants start at A)
\tau\eta:\;A\to B=1\times\tfrac14=0.25,\quad A\to C=1\times\tfrac12=0.5,\quad A\to D=1\times\tfrac14=0.25;\quad\text{sum}=1| Move | P | Cumulative | Range |
|---|---|---|---|
| A→B | 0.25 | 0.25 | 0–0.25 |
| A→C | 0.50 | 0.75 | 0.25–0.75 |
| A→D | 0.25 | 1.00 | 0.75–1 |
Ant 1: r = 0.3 → C. Ant 2: r = 0.5 → C.
Step 2. Probabilities from C (B and D left)
C\to B=\tfrac13=0.3333,\quad C\to D=\tfrac12=0.5;\quad\text{sum}=0.8333\Rightarrow P_{CB}=0.4,\;P_{CD}=0.6Cumulative in city order: B 0–0.4, D 0.4–1. Ant 1: r = 0.8 → D. Ant 2: r = 0.7 → D.
Step 3. Complete the tours
Only B is left, then return to A.
\text{Ant 1}=\text{Ant 2}:\;A\to C\to D\to B\to A,\qquad L=2+2+6+4=14Step 4. Pheromone update
Each ant deposits LaTeX:
Q/L=1/14=0.0714 on each edge of its tour; two ants used the same four edges (AC, CD, DB, BA), so each gets LaTeX:
2/14=0.1429.
\text{used edge: }(1-0.5)(1)+0.1429=0.6429\qquad\text{unused edge (AD, BC): }(1-0.5)(1)+0=0.5\tau_{\text{new}}=\begin{array}{c|cccc}&A&B&C&D\\\hline A&0&0.6429&0.6429&0.5\\B&0.6429&0&0.5&0.6429\\C&0.6429&0.5&0&0.6429\\D&0.5&0.6429&0.6429&0\end{array}Official marking: path of Ant 1 (3) + path of Ant 2 (3) + pheromone matrix (4).