Social learning over weakly-connected graphs