Roach Infestation Optimization

I wrote an article titled “Roach Infestation Optimization” in the February 2016 issue of Microsoft’s MSDN Magazine. See

Roach Infestation Optimization (RIO) is a numerical optimization meta-heuristic. That means RIO finds the solution to a problem where the goal is to minimize error. RIO is very similar to particle swarm optimization (PSO).


In RIO, you maintain a collection of virtual roaches. Each roach has a position like (3.0, 6.0, -2.0, 4.0) that represents a possible solution to the minimization problem you are addressing. Roaches move towards better locations (smaller error), and they tend to move towards each other, and if they get hungry they will break away from their group.


In my article, I demonstrate how to implement RIO in the C# language to solve a standard benchmark optimization called Rastrigin’s function. I conclude that RIO is not dramatically superior to PSO, but that RIO may be useful in some problem scenarios.

This entry was posted in Machine Learning. Bookmark the permalink.