Anomaly Detection with Score functions based on Nearest Neighbor Graphs