Anomaly detection in dynamic networks