Immune Plasma Algorithm (IPA)

The Immune Plasma Algorithm, commonly known as IPA, is a bio-inspired metaheuristic optimization algorithm based on the concept of immune plasma treatment. In the original research paper, it is also referred to as the IP algorithm. The main idea is to transfer useful information from strong candidate solutions to weak candidate solutions, similar to how antibody-rich plasma from recovered individuals may support critical patients.

This article explains IPA in detail from an algorithmic point of view. We will cover the biological inspiration, the optimization model, the main parameters, the mathematical equations, the workflow, the balance between exploration and exploitation, and the practical points that should be considered when implementing the algorithm.

Introduction

Optimization problems appear in many areas of computer engineering, communication networks, artificial intelligence, logistics, scheduling, simulation-based systems, and engineering design. In many real-world cases, the number of possible solutions is very large, and the search space may be nonlinear, noisy, constrained, or expensive to evaluate.

Traditional exact methods can solve some optimization problems, especially when the mathematical structure is simple and well-defined. However, many practical problems cannot be solved efficiently using exact methods because the search space becomes too large or because the objective function depends on simulation, measurement, or complex system behavior.

For this reason, researchers often use metaheuristic optimization algorithms. These algorithms do not guarantee the exact global optimum in every case, but they can usually find high-quality solutions within a reasonable amount of time.

The Immune Plasma Algorithm belongs to this family of metaheuristics. Like Genetic Algorithm, Particle Swarm Optimization, Artificial Bee Colony, and similar methods, IPA works with a population of candidate solutions and improves them iteratively.

Biological Inspiration Behind IPA

The biological inspiration of IPA comes from convalescent plasma therapy, also called immune plasma treatment. In this treatment idea, plasma taken from recovered individuals contains antibodies that may help critical patients fight the same infection.

IPA converts this biological idea into an optimization model. A strong individual in the population represents a good solution. A weak individual represents a poor solution. The algorithm tries to improve weak individuals by using information from strong individuals.

Biological ConceptOptimization Meaning
IndividualCandidate solution
Immune responseFitness or objective value
Recovered individualStrong solution
Critical patientWeak solution
Plasma transferInformation transfer from strong solution to weak solution
Infection spreadingGenerating variation in the population
Antibody memoryPreserving or modifying useful solution patterns

The algorithm does not simulate medicine directly. It only uses the biological logic as an inspiration for designing a search mechanism.

What Is the Immune Plasma Algorithm?

The Immune Plasma Algorithm is a population-based optimization algorithm. This means that it works with a group of candidate solutions instead of a single solution. Each individual in the population represents one possible answer to the optimization problem.

The algorithm evaluates each individual using a fitness function. In a minimization problem, smaller fitness values represent better solutions. In a maximization problem, the objective can usually be converted into a minimization form.

IPA improves the population through three main operations:

  • Infection spreading: creates new variations and supports exploration.

  • Plasma transfer: improves weak solutions using strong solutions and supports exploitation.

  • Donor update: modifies or reinitializes donor solutions to maintain search activity.

Problem Representation

Assume we have an optimization problem with \(D\) decision variables. Each individual \(x_k\) in the population is represented as a vector:

\[ x_k = \left[x_{k,1}, x_{k,2}, x_{k,3}, \ldots, x_{k,D}\right] \]

Here, \(x_k\) is the \(k\)-th individual, and \(x_{k,j}\) is the \(j\)-th decision variable of that individual.

The population size is denoted by \(PS\). Therefore, the full population can be represented as:

\[ X = \left\{x_1, x_2, x_3, \ldots, x_{PS}\right\} \]

Each individual is evaluated using an objective function:

\[ f(x_k) \]

For a minimization problem, the best solution is the individual with the smallest objective value.

Main Parameters of IPA

Before running IPA, the following parameters should be defined:

  • \(PS\): Population size.

  • \(D\): Number of decision variables.

  • \(NoD\): Number of donors selected from the best individuals.

  • \(NoR\): Number of receivers selected from the worst individuals.

  • \(t_{max}\): Maximum number of fitness evaluations.

  • \(t_{cr}\): Current number of fitness evaluations.

  • \(f(x)\): Objective function used to evaluate solution quality.

The values of these parameters affect the behavior of the algorithm. A larger population may increase diversity but also increases computational cost. A larger number of donors and receivers may strengthen the plasma transfer stage, but it may also increase exploitation pressure.

Step 1: Initial Population Generation

IPA starts by generating an initial population of candidate solutions. Each variable is generated randomly within its lower and upper bounds.

\[ x_{k,j} = x^{low}_{j} + r(0,1)\left(x^{high}_{j} - x^{low}_{j}\right) \]

Where:

  • \(x_{k,j}\) is the \(j\)-th variable of the \(k\)-th individual.

  • \(x^{low}_{j}\) is the lower bound of the \(j\)-th variable.

  • \(x^{high}_{j}\) is the upper bound of the \(j\)-th variable.

  • \(r(0,1)\) is a random number between 0 and 1.

  • \(k = 1,2,\ldots,PS\).

  • \(j = 1,2,\ldots,D\).

This step gives the algorithm a starting set of solutions distributed across the search space. A diverse initial population helps IPA avoid focusing too early on one region.

Step 2: Fitness Evaluation

After generating the population, each individual is evaluated using the objective function:

\[ fitness_k = f(x_k) \]

In a minimization problem, the individual with the smallest fitness value is considered the best individual:

\[ x_{best} = \arg\min_{x_k \in X} f(x_k) \]

The value \(x_{best}\) is updated whenever a better solution appears during the search process.

Step 3: Infection Spreading

The infection spreading stage models how infection spreads between individuals. In optimization terms, this step creates a new candidate solution by using the difference between two individuals.

For an individual \(x_k\), another random individual \(x_m\) is selected from the population, where \(m \neq k\). Then a new infected candidate is generated as follows:

\[ x^{inf}_{k,j} = x_{k,j} + r(-1,+1)\left(x_{k,j} - x_{m,j}\right) \]

Where:

  • \(x^{inf}_{k,j}\) is the \(j\)-th variable of the infected candidate.

  • \(x_{k,j}\) is the current value of the \(j\)-th variable of individual \(x_k\).

  • \(x_{m,j}\) is the \(j\)-th variable of another randomly selected individual \(x_m\).

  • \(r(-1,+1)\) is a random value between -1 and +1.

The term \(\left(x_{k,j} - x_{m,j}\right)\) creates a direction based on the difference between two individuals. The random multiplier controls how strongly the new candidate moves in that direction.

After generating \(x^{inf}_k\), the algorithm evaluates it. If the infected candidate is better than the current individual, it replaces the current individual:

\[ x_k = \begin{cases} x^{inf}_k, & \text{if } f(x^{inf}_k) < f(x_k) \\ x_k, & \text{otherwise} \end{cases} \]

This comparison is done using the fitness of the complete solution, not a single variable. That is important because the objective function evaluates the entire vector \(x_k\).

Why Infection Spreading Matters

Infection spreading is mainly responsible for exploration. It allows the population to test new regions of the search space. Because every individual may be infected using another randomly selected individual, the algorithm can generate different movements during the search.

At the same time, the update is controlled. IPA does not accept every generated candidate. It only accepts the infected candidate if it improves the current solution. This gives the algorithm a balance between randomness and quality control.

Step 4: Selecting Donors and Receivers

After infection spreading, IPA ranks the population according to objective value. For a minimization problem:

  • The best \(NoD\) individuals are selected as donors.

  • The worst \(NoR\) individuals are selected as receivers.

Donors represent recovered or strong individuals. Receivers represent critical or weak individuals. The purpose of this step is to identify which solutions should guide the search and which solutions need improvement.

This is one of the core ideas of IPA. The algorithm does not only preserve strong solutions. It actively uses them to improve weak solutions through the plasma transfer mechanism.

Step 5: Plasma Transfer

Plasma transfer is the main exploitation mechanism in IPA. A receiver individual \(x^{rcv}_k\) is selected from the receiver group. A donor individual \(x^{dnr}_m\) is selected from the donor group. Then the treated receiver is generated as follows:

\[ x^{rcv-p}_{k,j} = x^{rcv}_{k,j} + r(-1,+1)\left(x^{rcv}_{k,j} - x^{dnr}_{m,j}\right) \]

Where:

  • \(x^{rcv}_{k,j}\) is the \(j\)-th variable of the receiver.

  • \(x^{dnr}_{m,j}\) is the \(j\)-th variable of the donor.

  • \(x^{rcv-p}_{k,j}\) is the \(j\)-th variable of the receiver after plasma treatment.

  • \(r(-1,+1)\) is a random number between -1 and +1.

The first plasma dose follows a special decision rule. If the treated receiver becomes better than the donor, the receiver is updated and the plasma treatment may continue:

\[ x^{rcv}_k = \begin{cases} x^{rcv-p}_k, & \text{if } f(x^{rcv-p}_k) < f(x^{dnr}_m) \\ x^{dnr}_m, & \text{otherwise} \end{cases} \]

If the first dose is successful enough to make the receiver better than the donor, IPA assumes that the receiver has strongly benefited from the treatment. The treatment can then continue with additional doses.

For the second and later plasma doses, the condition becomes simpler. The treated receiver is accepted if it improves the current receiver:

\[ x^{rcv}_k = \begin{cases} x^{rcv-p}_k, & \text{if } f(x^{rcv-p}_k) < f(x^{rcv}_k) \\ x^{rcv}_k, & \text{otherwise} \end{cases} \]

If no improvement is achieved, the plasma treatment for that receiver stops.

Why Plasma Transfer Matters

Plasma transfer is responsible for exploitation. It helps weak solutions move toward more promising areas of the search space by using information from strong solutions.

This mechanism is useful because weak individuals are not simply discarded. Instead, they are improved using the structure of better individuals. This can help the population recover from poor regions and concentrate more search effort around useful areas.

Step 6: Donor Update

After donors contribute to plasma transfer, IPA updates the donor individuals. This stage models the idea that the antibody level or immune response of a donor may change over time.

A donor can be locally modified using:

\[ x^{dnr}_{m,j} = x^{dnr}_{m,j} + r(-1,+1)x^{dnr}_{m,j} \]

This modification searches around the donor solution and may refine a promising region.

Alternatively, the donor may be reinitialized using the same formula used for generating the initial population:

\[ x^{dnr}_{m,j} = x^{low}_{j} + r(0,1)\left(x^{high}_{j} - x^{low}_{j}\right) \]

This reinitialization can introduce a new region into the search space. Therefore, donor update contributes to both exploration and exploitation.

Boundary Handling

IPA equations may generate values outside the allowed lower and upper bounds. For example, infection spreading or plasma transfer may produce a variable value smaller than \(x^{low}_{j}\) or greater than \(x^{high}_{j}\).

For this reason, a boundary handling method should be applied after generating any new candidate solution. A simple clipping strategy can be written as:

\[ x_{k,j} = \begin{cases} x^{low}_{j}, & \text{if } x_{k,j} < x^{low}_{j} \\ x^{high}_{j}, & \text{if } x_{k,j} > x^{high}_{j} \\ x_{k,j}, & \text{otherwise} \end{cases} \]

Other boundary strategies can also be used, such as random regeneration, reflection, or repair based on the problem structure.

Complete IPA Workflow

The complete workflow of IPA can be summarized as follows:

  1. Define the parameters \(PS\), \(D\), \(NoD\), \(NoR\), and \(t_{max}\).

  2. Generate the initial population using the lower and upper bounds.

  3. Evaluate all individuals using the objective function.

  4. Set \(x_{best}\) as the best individual in the initial population.

  5. Apply infection spreading to generate new infected candidates.

  6. Accept infected candidates only if they improve the current individuals.

  7. Rank the population according to fitness value.

  8. Select the best \(NoD\) individuals as donors.

  9. Select the worst \(NoR\) individuals as receivers.

  10. Apply plasma transfer from donors to receivers.

  11. Continue plasma treatment while improvement is achieved.

  12. Update donor individuals through local modification or reinitialization.

  13. Update \(x_{best}\) whenever a better solution appears.

  14. Repeat the process until \(t_{cr}\) reaches \(t_{max}\).

Algorithm Steps in Structured Form

  1. Input: objective function \(f(x)\), bounds \(x^{low}\) and \(x^{high}\), population size \(PS\), dimension \(D\), number of donors \(NoD\), number of receivers \(NoR\), and maximum evaluation number \(t_{max}\).

  2. Initialization: generate \(PS\) candidate solutions using:

    \[ x_{k,j} = x^{low}_{j} + r(0,1)\left(x^{high}_{j} - x^{low}_{j}\right) \]
  3. Evaluation: calculate \(f(x_k)\) for each individual and set \(x_{best}\).

  4. Infection spreading: for each individual, generate \(x^{inf}_k\) using:

    \[ x^{inf}_{k,j} = x_{k,j} + r(-1,+1)\left(x_{k,j} - x_{m,j}\right) \]
  5. Infection acceptance: replace \(x_k\) with \(x^{inf}_k\) only if:

    \[ f(x^{inf}_k) < f(x_k) \]
  6. Donor and receiver selection: sort the population. Select the best \(NoD\) individuals as donors and the worst \(NoR\) individuals as receivers.

  7. Plasma transfer: for each receiver, select a donor and generate the treated receiver:

    \[ x^{rcv-p}_{k,j} = x^{rcv}_{k,j} + r(-1,+1)\left(x^{rcv}_{k,j} - x^{dnr}_{m,j}\right) \]
  8. First dose rule: if \(f(x^{rcv-p}_k) < f(x^{dnr}_m)\), update the receiver with \(x^{rcv-p}_k\) and continue treatment. Otherwise, update the receiver with \(x^{dnr}_m\) and stop treatment.

  9. Next dose rule: for later doses, continue only while \(f(x^{rcv-p}_k) < f(x^{rcv}_k)\).

  10. Donor update: modify or reinitialize donor solutions using:

    \[ x^{dnr}_{m,j} = x^{dnr}_{m,j} + r(-1,+1)x^{dnr}_{m,j} \]

    or:

    \[ x^{dnr}_{m,j} = x^{low}_{j} + r(0,1)\left(x^{high}_{j} - x^{low}_{j}\right) \]
  11. Stopping condition: stop when the current number of evaluations reaches \(t_{max}\).

  12. Output: return the best solution \(x_{best}\).

Simple Manual Example

Assume we want to minimize the following simple function:

\[ f(x) = x^2 \]

The best possible solution is:

\[ x = 0 \]

because:

\[ f(0) = 0 \]

Assume the initial population contains four individuals:

IndividualValueFitness
\(x_1\)\(-6\)\(36\)
\(x_2\)\(4\)\(16\)
\(x_3\)\(-1\)\(1\)
\(x_4\)\(8\)\(64\)

Since this is a minimization problem, \(x_3 = -1\) is the best individual and can be selected as a donor. The worst individual is \(x_4 = 8\), so it can be selected as a receiver.

Now apply plasma transfer from donor \(-1\) to receiver \(8\). Assume the random value is \(-0.95\):

\[ x^{rcv-p} = 8 + (-0.95)\left(8 - (-1)\right) \]\[ x^{rcv-p} = 8 + (-0.95)(9) \]\[ x^{rcv-p} = 8 - 8.55 = -0.55 \]

Now calculate the fitness of the treated receiver:

\[ f(-0.55) = (-0.55)^2 = 0.3025 \]

The treated receiver is better than the donor because:

\[ 0.3025 < 1 \]

So the treatment is successful, and the receiver is updated from \(8\) to \(-0.55\). This example shows how a weak solution can move into a better region by using information from a strong solution.

Exploration and Exploitation in IPA

A strong optimization algorithm should balance two important behaviors:

  • Exploration: searching new regions of the solution space.

  • Exploitation: improving solutions around promising regions.

IPA uses different mechanisms to control this balance:

IPA StageMain Role
Initial populationExploration
Infection spreadingExploration and controlled variation
Donor selectionIdentifying promising solutions
Receiver selectionTargeting weak solutions for improvement
Plasma transferExploitation
Donor updateBoth exploration and exploitation

If the algorithm explores too much, it may waste evaluations on unpromising regions. If it exploits too much, it may get trapped in a local optimum. IPA tries to balance these two behaviors through infection spreading, plasma transfer, and donor update.

Computational Complexity

The computational cost of IPA depends mainly on the number of fitness evaluations. If the maximum number of evaluations is \(t_{max}\), and evaluating one solution costs \(O(D)\), then the general running time can be written as:

\[ O(t_{max} \times D) \]

However, IPA also performs internal operations such as sorting the population, selecting donors and receivers, applying plasma transfer, and updating donors.

For one cycle, the internal computational complexity can be expressed as:

\[ O\left(PS \log(PS) + D(PS + NoR + NoD)\right) \]

The term \(PS \log(PS)\) comes mainly from sorting the population. The term \(D(PS + NoR + NoD)\) comes from updating individuals across the problem dimensions.

Why Evaluation Budget Matters

IPA may perform a variable number of fitness evaluations in each cycle, especially because plasma treatment can continue for more than one dose. For this reason, comparing IPA with other algorithms only by iteration count may be unfair.

A fair comparison should use the same maximum number of objective function evaluations:

\[ t_{max}^{IPA} = t_{max}^{competitor} \]

This makes the comparison based on the same computational budget, which is more reliable than comparing only the number of iterations.

Choosing IPA Parameters

The best parameter values depend on the problem, but the following guidelines are useful:

  • Start with a moderate population size such as \(PS = 30\) or \(PS = 50\).

  • Use small donor and receiver values at the beginning, such as \(NoD = 1\) and \(NoR = 1\).

  • Increase \(NoR\) when many weak solutions need stronger correction.

  • Increase \(NoD\) when the algorithm needs guidance from more than one strong solution.

  • Use the same evaluation budget when comparing IPA with other algorithms.

  • Run multiple independent trials because IPA is stochastic.

For research experiments, one run is not enough. The mean, standard deviation, best result, convergence behavior, and statistical tests should be reported.

Applications of IPA

IPA can be applied to many optimization problems where candidate solutions can be evaluated using a fitness function. Possible application areas include:

  • Wireless sensor network deployment.

  • Coverage maximization.

  • Routing optimization.

  • Traffic signal timing optimization.

  • Traffic recovery and digital twin simulation.

  • Resource allocation.

  • Scheduling problems.

  • Signal decomposition and noise reduction.

  • Simulation-based engineering design.

IPA is especially useful when the objective function is available but the search space is too large to examine exhaustively.

Advantages of IPA

  • Population-based structure: IPA works with many solutions, which supports diversity.

  • Clear improvement mechanism: Weak solutions are directly improved using strong solutions.

  • Exploration and exploitation balance: Infection spreading supports exploration, while plasma transfer supports exploitation.

  • Flexible design: The algorithm can be adapted to different continuous optimization problems.

  • Simulation compatibility: IPA can be used with objective functions based on simulation outputs.

Limitations of IPA

Like other metaheuristic algorithms, IPA has limitations:

  • It does not guarantee the exact global optimum.

  • Its performance depends on parameter settings.

  • It may require many fitness evaluations for expensive problems.

  • Boundary handling must be implemented carefully.

  • Results should be validated using multiple runs and statistical analysis.

These limitations do not make IPA weak. They simply mean that it should be implemented and evaluated carefully.

Common Implementation Mistakes

  • Writing equations as code: Mathematical equations should be written using MathJax or LaTeX syntax, not inside code blocks.

  • Ignoring boundaries: Infection and plasma equations may generate values outside the allowed range.

  • Wrong donor and receiver selection: Donors should be selected from the best individuals, while receivers should be selected from the worst individuals.

  • Unfair comparison: IPA should be compared with other algorithms using the same number of fitness evaluations.

  • Using one run only: Since IPA is stochastic, one run cannot prove performance.

  • Over-tuning: Parameters should not be tuned in a way that makes the comparison biased.

Conclusion

The Immune Plasma Algorithm is a bio-inspired optimization algorithm that transforms the idea of immune plasma treatment into a population-based search method. Each individual represents a candidate solution, and the quality of that solution is represented by its objective function value.

The algorithm starts by generating a random population, evaluating solutions, spreading infection to create variations, selecting donors and receivers, applying plasma transfer, updating donors, and repeating the process until the evaluation budget is reached.

The strength of IPA comes from its balance between exploration and exploitation. Infection spreading allows the algorithm to discover new regions, while plasma transfer helps weak solutions improve using information from strong solutions. Donor update adds another layer of search flexibility by either refining strong solutions or introducing new ones.

When implemented with proper boundary handling, fair evaluation budgets, multiple independent runs, and statistical validation, IPA can be a strong optimization method for complex engineering, network, simulation, and artificial intelligence problems.

Reference

Aslan, S., & Demirci, S. (2020). Immune Plasma Algorithm: A Novel Meta-Heuristic for Optimization Problems. IEEE Access (link).