Economic analysis of social structure