Agent preferences and the topology of networks.