Hydrodynamic limit in a particle system with topological interactions