Towards a computational network theory of social groups