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