In certain swarm applications, where the inter-agent distance is not the only factor in the collective behaviours of the swarm, additional properties such as density could have a crucial effect. In this paper, we propose applying a Distance-Weighted K-Nearest Neighbouring (DW-KNN) topology to the behaviour of robot swarms performing self-organized aggregation, in combination with a virtual physics approach to keep the robots together. A distance-weighted function based on a Smoothed Particle Hydrodynamic (SPH) interpolation approach, which is used to evaluate the robot density in the swarm, is applied as the key factor for identifying the K-nearest neighbours taken into account when aggregating the robots. The intra virtual physical connectivity among these neighbours is achieved using a virtual viscoelastic-based proximity model. With the ARGoS based-simulator, we model and evaluate the proposed approach, showing various self-organized aggregations performed by a swarm of N foot-bot robots. Also, we compared the aggregation quality of DW-KNN aggregation approach to that of the conventional KNN approach and found better performance.