Anomaly detection through information sharing under different topologies