Swarm algorithm is probably not the word you're looking for, as it conjures associations with flocking.
What I think you're trying to say is some sort of level of detail (LoD) for behaviour, which isn't a bad idea at all. After all, behaviour can be simulated at different granularities (e.g. we don't need to simulate every sub-atomic particle's movement to animate a walking dog).
Example: In a 3D medieval battle game you wouldn't animate every individual bone on a single soldier which shows up as 4 pixels on the player's screen, instead you would treat the soldier's battalion as a single entity (the military catch-all phrase "unit" is most appropriate here) and consider only its movements in reaction to the world state. This would result in a simple translation vector, which you of course still need to apply to each individual soldier, so you will never get rid of the loop(*), but you will be able to minimize the number of calculations needed within it.
Once the battalion gets closer to the camera you add a check to make sure each soldier is touching the terrain, and closer still you'll actually start animating them individually.
Rewinding from this example to your current endeavor, depending on the distance of the entity from the player's view (and the speed with which the player would be able to move the view) you would:
- translate and animate them normally (when the units are on screen)
- translate but not animate (when they are just off screen)
- update them less than once per frame (when they are further away)
- not even update them (if this wouldn't lead to strange situations)
For 2 and 3 you would be able to use the method of grouping the behaviour of multiple entities, especially if they were supposed to move in (relative) unison anyway.
In closing: whether this is applicable to your game depends on its mechanics, and (as was already mentioned) if you actually need these optimizations: avoid "premature optimization". :-)
(*) Though one could make use of a scene graph to defer the propagation of the translation to the drawing phase of the game loop.