Smart devices in the social loops: criteria and algorithms for the creation of the social links