Algebraic models for social networks