In this talk, I present our stochastic algorithm for separation and integration in heterogeneous particle systems. Achieving separation or integration depends only on a single global parameter determining whether particles prefer to be next to other particles of the same color or not. The algorithm is a generalization of a previous distributed, stochastic algorithm for compression that can be viewed as a special case of separation where all particles have the same color. However, it is significantly more challenging to prove that the desired behavior is achieved in the heterogeneous setting, necessitating the use of new tools like the cluster expansion from statistical physics.