0% found this document useful (0 votes)
5 views11 pages

Lec 11

The lecture on Swarm Intelligence introduces its concepts, algorithms, and applications, targeting undergraduate computer science students. Key topics include the principles of decentralized control, self-organization, and adaptability, along with various algorithms like Particle Swarm Optimization and Ant Colony Optimization. The lecture also discusses the advantages and challenges of implementing Swarm Intelligence in problem-solving scenarios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views11 pages

Lec 11

The lecture on Swarm Intelligence introduces its concepts, algorithms, and applications, targeting undergraduate computer science students. Key topics include the principles of decentralized control, self-organization, and adaptability, along with various algorithms like Particle Swarm Optimization and Ant Colony Optimization. The lecture also discusses the advantages and challenges of implementing Swarm Intelligence in problem-solving scenarios.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Kerbala University Machin Learning II

College of Computer Science and Information Technology


Department of Computer Science Dr. Elaf Adil – 4 Lecture

Swarm Intelligence
Algorithms
4h Lecture Dr. Elaf Adil

Learning Objectives
The general objective of the lecture:
To introduce the concept of Swarm Intelligence.
Detailed objectives:

By the end of the lecture, students should be able to:


✅ Understand Swarm Intelligence (SI).

✅ Explore Swarm Intelligence Algorithms.

✅ Analyze the Advantages and Challenges of Swarm Intelligence

The target audience of the lecture:

Undergraduate-stage (3rd stage) students in computer science.


• Lecture duration: 1 lecture.
• Lecture duration: 2 hours.
Kerbala University Machin Learning II
College of Computer Science and Information Technology
Department of Computer Science Dr. Elaf Adil – 4 Lecture

1. Introduction to Swarm Intelligence


Swarm Intelligence (SI) is a branch of Artificial Intelligence (AI) that studies the
collective behavior of decentralized, self-organized systems, typically inspired by
natural phenomena such as ant colonies, bird flocking, and fish schooling. These
systems demonstrate that intelligence can emerge from the interactions of simple
individuals, leading to complex and adaptive group behaviors.

Key Idea:

• Decentralized Control: No single leader; individuals follow simple rules.

• Self-Organization: Global patterns emerge from local interactions.

• Adaptability: The system can adjust to changes in the environment.

• Robustness: The system remains functional even if some individuals fail.

2. Why Do Animals Swarm?

Animals swarm for several reasons, including:


Kerbala University Machin Learning II
College of Computer Science and Information Technology
Department of Computer Science Dr. Elaf Adil – 4 Lecture

• Foraging: To find food more efficiently.

• Migration: To travel long distances with minimal energy.

• Defense: To protect against predators by forming large groups.

• Reproduction: To increase the chances of finding mates.

3. Core Principles of Swarm Intelligence

a. Stigmergy:
Indirect communication through the environment. Agents modify the
environment, and these changes influence the behavior of other agents.

Example:

• Ants: Ants leave pheromone trails to guide other ants to food sources.

b. Positive Feedback:

Successful behaviors are reinforced, leading to more individuals adopting them.

Example:

• Pheromone Trails: More ants follow a strong pheromone trail, making it


even stronger.

c. Negative Feedback:
Unsuccessful behaviors are discouraged, preventing the system from getting
stuck in suboptimal solutions.

Example:

• Pheromone Evaporation: Pheromone trails evaporate over time, reducing


the likelihood of following outdated paths.

d. Local Interactions:
Kerbala University Machin Learning II
College of Computer Science and Information Technology
Department of Computer Science Dr. Elaf Adil – 4 Lecture

Agents interact with their immediate neighbors, leading to global patterns.

Example:

• Bird Flocking: Birds adjust their flight based on the movements of nearby
birds.

4. Swarm Intelligence Algorithms

a. Particle Swarm Optimization (PSO):

• Inspiration: Social behavior of birds and fish.

• Mechanism: Particles (representing potential solutions) move through the


solution space, adjusting their positions based on their own experience and
the experience of neighboring particles.

• Applications: Optimization problems, function minimization, neural network


training.

• Video Link: https://www.youtube.com/watch?v=KmfNQTe-pRE

b. Ant Colony Optimization (ACO):

• Inspiration: Foraging behavior of ants.

• Mechanism: Artificial ants build solutions by moving through a graph,


depositing pheromones

• on the edges they traverse. The probability of choosing a path is influenced


by the amount of pheromone.

• Applications: Traveling Salesman Problem (TSP), vehicle routing, network


routing.

• https://www.youtube.com/watch?v=ozkBd2p2piU
Kerbala University Machin Learning II
College of Computer Science and Information Technology
Department of Computer Science Dr. Elaf Adil – 4 Lecture

c. Artificial Bee Colony (ABC):

• Inspiration: Foraging behavior of honey bees.

• Mechanism: Artificial bees search for food sources (solutions) and share
information about the quality of these sources. The colony evolves over time
to find the best solutions.

• Applications: Numerical optimization, data clustering, job scheduling.

• Video Link: https://www.youtube.com/watch?v=1MX2WN-7Xzc

d. Glowworm Swarm Optimization (GSO):


Kerbala University Machin Learning II
College of Computer Science and Information Technology
Department of Computer Science Dr. Elaf Adil – 4 Lecture

• Inspiration: Behavior of glowworms (fireflies).

• Mechanism: Glowworms are attracted to brighter neighbors, leading to the


formation of clusters around optimal solutions.

• Applications: Multimodal optimization, robotics.

• https://www.youtube.com/watch?v=JC41M7RPSec

5. Advantages and Challenges

Advantages:

• Scalability: Can handle large-scale problems with many agents.

• Flexibility: Can be applied to a wide range of problems.

• Robustness: Resilient to the failure of individual agents.

• Parallelism: Multiple agents can work simultaneously, speeding up the


solution process.

Challenges:

• Parameter Tuning: Finding the right parameters for the algorithms can be
difficult.

• Convergence: Ensuring that the algorithm converges to an optimal solution.


• Complexity: Understanding and modeling the behavior of swarms can be
complex.
• Computational Cost: High computational resources may be required for
large swarms.
Particle Swarm Optimization
• A search technique used in computing to find near-optimal solutions to
optimization problems.
Kerbala University Machin Learning II
College of Computer Science and Information Technology
Department of Computer Science Dr. Elaf Adil – 4 Lecture

• PSO is a swarm intelligence inspired by the natural social behavior and


dynamic movements with communications of insects, birds, and fish.
• Uses a number of particles that constitute a swarm moving around in the
search space looking for the best solution.
• Each particle in the search space adjusts its “flying” according to its own
flying experience as well as the flying experience of other particles.
Key Terms
• Particles iii: Any possible solution.
• Population NNN: Group of all particles.
• Search Space [a,b]: All possible solutions to the problem.
• Each particle is assumed to have two characteristics:
o A position xi
o A velocity vi
• Each particle keeps track of:
o Personal best pbest
o Global best gbest

Velocity Equation:

Key Components:
1. Inertia Weight (θ)
Kerbala University Machin Learning II
College of Computer Science and Information Technology
Department of Computer Science Dr. Elaf Adil – 4 Lecture

- Prevents the particle from drastically changing direction.

- The value of θ varies linearly from 0.9 to 0.4.

2. Cognitive and Social Learning Rates (c1 and c2)

- c1: Encourages the particle to track its best-known position (personal


learning).

- c2: Encourages the particle to move toward the global best position found by
the swarm (social learning).

3. Random Factors (r1 and r2)

- These are uniformly distributed random numbers between 0 and 1, ensuring


variability in the search process.

- Compute the fitness function f(xi).


- Update the personal best pbest,i and the global best gbest.

Update Conditions:

pbest,i = xi if f(xi) is better than f(pbest,i )

gbest= pbest,i if f(pbest,i ) is better than f(gbest)

Case Evaluations:

Cases Better than pbest Better than gbest Remark


1 ❌ ❌ No update of pbest and gbest
2 ✅ ❌ Update pbest but not gbest
3 ✅ ✅ Update both pbest and gbest
Kerbala University Machin Learning II
College of Computer Science and Information Technology
Department of Computer Science Dr. Elaf Adil – 4 Lecture

Case 1: Minimization Case 2: Minimization

x = 5 → f(x) = 50 x = 2 → f(x) = 25
pbest= 3 → f(pbest) = 30 pbest= 3 → f(pbest) = 30
gbest= 7 → f(gbest) = 20 pbest= x
gbest= 7 → f(gbest) = 20

Case 3: Minimization

x = 9 → f(x) = 10
pbest= 3 → f(pbest) = 30
pbest= x
pbest= 7 → f(gbest) = 20
gbest= pbest

Update Rules Table:

Parameters required from the user:


✔ Population size (N)

✔ Initial position (x) and initial velocity (v)

✔ Inertia weight (θ)

✔ Individual and social cognitive factors (c1 and c2)

✔ Uniformly distributed random numbers (r1 and r2) in the range (0,1)

✔ Termination criteria (e.g., number of iterations T)


Kerbala University Machin Learning II
College of Computer Science and Information Technology
Department of Computer Science Dr. Elaf Adil – 4 Lecture
Kerbala University Machin Learning II
College of Computer Science and Information Technology
Department of Computer Science Dr. Elaf Adil – 4 Lecture

<Best Regards>Dr. Elaf Adil

You might also like