Decentralized clustering and linking by networked agents