Search code examples
algorithmoptimizationartificial-intelligenceparticle-swarm

Particle Swarm Optimization (PSO) with invalid candidate solutions


I created a simple model for an off-grid neighborhood its energy balance, based on solar, wind and some energy storage. I use PSO to find the minimum required solar and wind capacity required for no loss of power throughout a full year.

More capacity is more cost, so the cost is minimized. Candidate solutions where there is loss of power should not be considered as solutions. Could you advice me on how to implement the no loss of power criteria?

What I did now is: when a configuration results in loss of power, I assign that candidate solution a high cost. This seems to work, but is not what you would call, very elegant...


Solution

  • My answer is about generally approaching a problem with "invalid" states (loss of power in your example), and does not take the chosen optimization method (PSO) into account.

    1. Add a high additive penalty for each "unit" of loss of power. This will only work if loss of power is quantifiable. Just a boolean value (valid/invalid) won't work because it does not tell how far we are from a valid solution.

    2. Search only in the sub-space of valid (lossless) configurations. If there is enough freedom in such subspace to run the search, and good valid states completely "surrounded" by invalid states are unlikely, the search will do just fine.