In hyperspectral images, anomaly detection without prior information develops rapidly. Most of the existing methods are based on restrictive assumptions of the background distribution. However, the complexity of the environment makes it hard to meet the assumptions, and it is difficult for a pre-set data model to adapt to a variety of environments. To solve the problem, this paper proposes an anomaly detection method on the foundation of machine learning and graph theory. First, the attributes of vertexes in the graph are set by the reconstruct errors. And then, robust background endmember dictionary and abundance matrix are received by structured sparse representation algorithm. Second, the Euler distances between pixels in lower-dimension are regarded as edge weights in the graph, after the analysis of the low dimensional manifold structure among the hyperspectral data, which is in virtue of manifold learning method. Finally, anomaly pixels are picked up by both vertex attributes and edge weights. The proposed method has higher probability of detection and lower probability of false alarm, which is verified by experiments on real images.