Optimal aggregation strategies for social learning over graphs