Co-evolution of Selection and Influence in Social Networks