Optimal combination rules for adaptation and learning over networks