Algebraic Models for Social Networks