Learning Efficient Anomaly Detectors from KNN Graphs